-
Notifications
You must be signed in to change notification settings - Fork 2
More fib plus pav updates #293
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
Conversation
Note: this is related to this issue. |
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.
All changes confirmed. Major modality specific functions tested. Bash argparse example usage tested.
Once Saskia et al. give a green light to the (tentative) design of stimulus_epoch
, goo to be merged! (or merge now and later patch-fix)
The original code was mainly designed to be used for CLI/argparse via command-line. I foresee a need to use it as a standalone python function. So, this refactoring introduced the create_unified_session_metadata() while keeping the main() function at the bottom so it can be used for both usecases.
restoring help args for CLI
…dates_patch_kh suggestion for the example code to make it a python function
…euralDynamics/aind-metadata-mapper into more_fib_plus_pav_updates
Comment from Saskia: remove active_mouse_platform and anesthesia as passable params. They are not relevant here. |
@hagikent, I reviewed the session.json that is produced by this code with @saskiad yesterday afternoon. She had a few questions/suggestions. Here's a subset of those that I could use some help from you in answering:
|
|
For software, I'm going to use the permalink for the version of the code after the most recent commit, which would be https://github.com/AllenNeuralDynamics/PavlovianCond_Bonsai/tree/dafd7dfe0f347f781e91466b3d16b83cf32f8b6d |
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.
Went over output with Doug which looks good. Haven't examine code rigorously.
|
||
def test_read_csv_safely_error_conditions(self): | ||
"""Test CSV reading with error conditions.""" | ||
with tempfile.TemporaryDirectory() as tmpdir: |
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 tend to discourage the use of writing to the user's file system during unit tests. For reading small files, we've been putting pre-made files into the test resources directory. For writes, we usually mock the write operation.
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.
Fixed in 5dbce34!
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.
- If possible, please update the unit tests to mock the write operations
- Also, in the future, please create a ticket with the proposed changes/issues before large modifications
Thanks @jtyoung84!
Fixed.
Will do. Requesting re-review. |
Summary of updates:
src/aind_metadata_mapper/pavlovian_behavior/example_create_session.py
src/aind_metadata_mapper/pavlovian_behavior/example_create_session.py
with an example CLI command.src/aind_metadata_mapper/utils/merge_sessions.py
to deal with conflicting reward units. If one session file hasreward_consumed_total = null
, ignore the associated units.stimulus_epochs
field insrc/aind_metadata_mapper/pavlovian_behavior/example_create_session.py
scripts/example_create_fiber_and_pav_sessions.py
to use the default params specified insrc/aind_metadata_mapper/pavlovian_behavior/example_create_session.py
andsrc/aind_metadata_mapper/fib/example_create_session.py