-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metric computations #35
Conversation
@ataha24 @jclauneuro - Are there other useful metrics related to AFIDs that we might want to implement prior to merging this (following a review)? |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #35 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 10 12 +2
Lines 654 760 +106
==========================================
+ Hits 654 760 +106
|
17ed7d0
to
46d3787
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally sure about this API but I'm also not sure that any of my suggestions are really any better. I think having a concrete use-case for this would help clarify. Maybe it would be useful for visualizations or a way to calculate AFLEs from a set of AfidSet
s? Anyway I think it bears a little discussion before merging
I am in the process of rewriting this a little bit (and may benefit from a call to discuss this more), but one thought that came out of this - if we are storing information regarding the afids pair that computes the distances, then all the current distance parameters (x, y, z) could just be a property computed from afids_pair parameter. Which then adds an additional question of should For reference, here is a screenshot of the current state (and what is causing me to go in circles a litlte bit): |
Okay, I think taking a step back and thinking about use cases for this might be helpful.
So I guess ultimately making an |
I agree with most of this, though I would think we might still want to have EDIT: After working through this a little more, I think I am okay with AfidDistance being its own class with no explicit |
Yeah I think with this setup |
Alright, a slightly bigger refactor from how this was initially implemented. Also realized I never responded to one of your original comments, but I foresee utility for these in the plotting. This, for the moment just implements (a slight variant) of the metrics you had mentioned. I think I would like EDIT: Also, as you noted, we should have a discussion about this (next meeting?) prior to merging. |
09684df
to
9372487
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple more small changes but this is looking good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a merge from main but otherwise LGTM
- update AfidPosition dunder to perform subtraction along spatial dimensions - add compute_AFLE method to compute and return errors along each spatial dimension, as well as afle - add tests for AFLE
- AfidDistance class now takes in a pair of `AfidPosition`s as separate parameters, and defines the distance errors via properties. Note, this change was made to eliminate an explicit call to `compute_distance` in `metrics.py` - Made this still flexible enough to not constrain to corresponding pairs of AFIDs (separate class will be made for this). A warning is thrown to the user however the different AFIDs are compared. - Update documentation to reflect these changes
This commit adds an object that stores the information regarding two AfidSet objects and the distances between corresponding AfidPositions. Additionally adds tests and documentations.
This commit adds a metric function that computes the mean spatial position given a list of AfidSets. Adds in associated tests and docstrings. Additionally, makes use of lambda function rather than iterating across list for tests.
This commit primarily adds in function to compute mean Euclidean distance given a list of AfidDistanceSet objects and implements the associated tests. Additionally, makes some minor changes to the afid_sets strategy, namely the coordinate system list it draws from. Should only be 'LPS' or 'RAS' once it has been converted to an ``AfidSet``. Lastly, adds in checks to make sure the inputs to the metric are of the correct type and if necessary, whether there is a common element.
- Input parameters changed to provide a list of AfidSets and a template / common afid_set to compare against - AfidDistanceSets are computed within the function rather than relying on user for computation
Proposed changes
This initializes a
metrics.py
for some functions that act on a list of valid inputs to compute metrics such as mean distance or mean AFID location. Also introduces two new classes:AfidDistance
, which contains information regarding the AFID pair used for computation, as well as both the Euclidean distance and distance along each spatial component. This was made flexible to be able to handle computation between any two AFIDsAfidDistanceSet
, which contains information regarding the validAfidSet
s used for computation, returning distances between corresponding pairs of AFIDs for a fullAfidSet
.As is, this is ready for a review, but open to suggestions of other metrics to implement.
Types of changes
What types of changes does your code introduce? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you are unsure about any of the choices, don't hesitate to ask!poe quality
taskNotes
All PRs will undergo the unit testing before being reviewed. You may be requested to explain or make additional changes before the PR is accepted.