-
Notifications
You must be signed in to change notification settings - Fork 85
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 optional parameters to OpticalSeries constructor #2023
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2023 +/- ##
==========================================
- Coverage 91.73% 91.32% -0.41%
==========================================
Files 27 27
Lines 2722 2722
Branches 710 710
==========================================
- Hits 2497 2486 -11
- Misses 149 159 +10
- Partials 76 77 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
format="external", | ||
timestamps=[1.0, 2.0], | ||
) | ||
self.assertIsNone(ts.distance) |
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.
Can you add a roundtrip test to make sure read/write is ok?
self.assertIsNone(ts.field_of_view) | ||
self.assertIsNone(ts.orientation) | ||
|
||
def test_roundtrip_optional_fields(self): |
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.
Can you move this test to tests/integration/hdf5/test_image.py
with the other roundtrip image tests?
This test is currently failing in Windows due to a file access issue. The NWBH5IOMixin
could also be used to simplify the file setup for read/write testing.
fix #1616
Motivation
The
OpticalSeries
class in PyNWB currently requires the fields 'distance', 'orientation', and 'field_of_view' in its constructor, but according to the NWB schema these fields should be optional. This PR fixes this discrepancy by making these fields optional in the code to match the schema specification.How to test the behavior?
Checklist
[x] Did you update CHANGELOG.md with your changes?
[x] Have you checked our Contributing document?
[x] Have you ensured the PR clearly describes the problem and the solution?
[x] Is your contribution compliant with our coding style? This can be checked running ruff check . && codespell from the source directory.
[x] Have you checked to ensure that there aren't other open Pull Requests for the same change?
[x] Have you included the relevant issue number using "Fix #1616" notation where XXX is the issue number? By including "Fix #1616" you allow GitHub to close issue #1616 when the PR is merged.