Skip to content
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 grid_spacing and origin_coords to the fields of ImagingPlane #1892

Merged

Conversation

h-mayorquin
Copy link
Contributor

@h-mayorquin h-mayorquin commented Apr 19, 2024

Motivation

This should fix #1885

I discussed this with @rly and it seems that it was just an omission. This PR tries to address this. So far, this seems to work for grid_spacing but for some reason that escapes me it seems that origin_coords is not added to the fields.

image

from pynwb.testing.mock.ophys import mock_ImagingPlane

imaging_plane = mock_ImagingPlane(grid_spacing=[1.0, 1.0], origin_coords=[0.0, 0.0])
imaging_plane.origin_coords
list(imaging_plane.fields.keys())

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Have you checked our Contributing document?
  • Have you ensured the PR clearly describes the problem and the solution?
  • Is your contribution compliant with our coding style? This can be checked running flake8 from the source directory.
  • Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • Have you included the relevant issue number using "Fix #XXX" notation where XXX is the issue number? By including "Fix #XXX" you allow GitHub to close issue #XXX when the PR is merged.

Copy link

codecov bot commented Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.01%. Comparing base (6cfcf39) to head (242cc90).

❗ Current head 242cc90 differs from pull request most recent head a5aa114. Consider uploading reports for the commit a5aa114 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1892   +/-   ##
=======================================
  Coverage   92.01%   92.01%           
=======================================
  Files          27       27           
  Lines        2619     2619           
  Branches      685      685           
=======================================
  Hits         2410     2410           
  Misses        139      139           
  Partials       70       70           
Flag Coverage Δ
integration 72.81% <ø> (ø)
unit 83.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rly
Copy link
Contributor

rly commented Apr 25, 2024

So far, this seems to work for grid_spacing but for some reason that escapes me it seems that origin_coords is not added to the fields.

@h-mayorquin I think you were missing a comma in the __nwbfields__ list. I fixed that and I think it works now. Could you check, and if it looks good, add a changlog?

@rly rly self-assigned this Apr 25, 2024
@rly rly added the category: bug errors in the code or code behavior label Apr 25, 2024
@rly rly added this to the 2.7.0 milestone Apr 25, 2024
@h-mayorquin h-mayorquin marked this pull request as ready for review April 25, 2024 15:21
@h-mayorquin
Copy link
Contributor Author

So far, this seems to work for grid_spacing but for some reason that escapes me it seems that origin_coords is not added to the fields.

@h-mayorquin I think you were missing a comma in the __nwbfields__ list. I fixed that and I think it works now. Could you check, and if it looks good, add a changlog?

My bad, I tested your change and it is working now. Thanks.

Added the changelog.

@rly rly enabled auto-merge (squash) April 25, 2024 18:45
@rly rly mentioned this pull request Apr 25, 2024
11 tasks
@rly
Copy link
Contributor

rly commented Apr 25, 2024

Thanks for the fix @h-mayorquin !

@rly rly merged commit 376e6ab into NeurodataWithoutBorders:dev May 2, 2024
18 of 21 checks passed
@h-mayorquin h-mayorquin deleted the add_grid_spacing_to_fields branch May 2, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug errors in the code or code behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Question: why is grid_spacing not a field in ImagingPlane?
2 participants