-
Notifications
You must be signed in to change notification settings - Fork 19
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
Gp/feat/aman arbitrary path #1057
Conversation
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.
Looks good -- a couple of requests though:
get
and__contains__
have not been changed. I think we should support the same treatment for keys provided there (but this is probably debatable).- The tests don't test very much right now... please expand.
- Mention this behavior in the docs (see axisman.rst, add a few lines after paragraph of "Note the boresight entry is marked with")
Thanks!
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 think mattew covered everything I had in mind.
I think the answer to this is "not enough that we care" or "not enough to measure" but is there any noticeable slowdown from accessing children in this way?
Expanding the test case so show that the values that we get and set are correct I think is important.
Get is a combination of
Yes, this is measurable but how many levels down do you want to go? |
I think most people will never go beyond triple nested so if that slowdown is in the noise then I think we are good. If it somehow matters this seems like a case where we could cache the mapping from the full path to where they point to alleviate things (but I really dont think it will end up being an issue). |
Having changed It is nice to be able to check if |
Is this what you mean? It is in the commit that addresses the comments. I'm trying to get them all in a single push. |
Yes, that's what I mean. Thanks. |
I am not sure if the test makes sense in terms of operations. Let me know if I need to update it in a way that reflects the correct usage of the AxisManager class. |
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.
Thanks.
I think what's missing in the test is just a simple data field, such as a shape=(samps,) array, in child or child2. Check that accessing, and setting, that field using 'child.child2.target' works properly.
I updated the tests and added a I also timed them, using timeit and 1000 iterations and these are the results:
I consider these to be the same time. |
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.
Looks good to me, I like the test a lot.
I have one minor issue with the docs and one potential feature to add but overall I think this is good to go.
@mhasself can you take another look? |
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.
Thanks -- a few more comments.
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.
Looks good, thanks for the iterations.
Obviously we need to get CI working again but otherwise this is good to go.
Remember to squash on merge.
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.
Looks great to me!
This PR updates AxisManager
__getitem__
and__setitem__
based on the slack discussion.__setitem__
raises an ValueError when the value is not another AxisManager and uses wrap to add it to the main object. I selected wrap because it seemed more complete compared to merge.