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

Fix Ophys Table Popup #721

Merged
merged 16 commits into from
Apr 3, 2024
Merged

Conversation

garrettmflynn
Copy link
Member

@garrettmflynn garrettmflynn commented Apr 3, 2024

This PR fixes the Ophys table popup observed in #715

Submitting this without a test at the moment in case we'd like to get it through before today's user test. Otherwise will circle back to this when I've approached the other bugs observed today.

@garrettmflynn garrettmflynn self-assigned this Apr 3, 2024
@CodyCBakerPhD
Copy link
Collaborator

Do you think any other popups would have been affected or is it pretty specific?

@garrettmflynn
Copy link
Member Author

This is the only case where we're using the nested input (rendered as a table here) at the moment, so it's fairly localized.

@CodyCBakerPhD
Copy link
Collaborator

New error on this PR (this works fine on main minus ability to alter the optical channel stuff)

Uncaught (in promise) Error: Request to convert failed: 'name' is a required property

Failed validating 'required' in schema['properties']['Ophys']['properties']['TwoPhotonSeries']:
    {'additionalProperties': False,
     'properties': {'bits_per_pixel': {'description': 'DEPRECATED: Number '
                                                      'of bits per image '
                                                      'pixel',
                                       'type': 'number'},
                    'comments': {'default': 'no comments',
                                 'description': 'Human-readable comments '
                                                'about this TimeSeries '
                                                'dataset',
                                 'type': 'string'},
                    'control': {'description': 'Numerical labels that '
                                               'apply to each element in '
                                               'data',
                                'type': 'array'},
                    'control_description': {'description': 'Description of '
                                                           'each control '
                                                           'value',
                                            'type': 'array'},
                    'conversion': {'default': 1.0,
                                   'description': 'Scalar to multiply each '
                                                  'element in data to '
                                                  'convert it to the '
                                                  'specified unit',
                                   'type': 'number'},
                    'description': {'default': 'no description',
                                    'description': 'Description of this '
                                                   'TimeSeries dataset',
                                    'type': 'string'},
                    'device': {'description': 'Device used to capture the '
                                              'images/video.',
                               'target': 'pynwb.device.Device',
                               'type': 'string'},
                    'dimension': {'description': 'Number of pixels on x, '
                                                 'y, (and z) axes.',
                                  'type': 'array'},
                    'field_of_view': {'description': 'Width, height and '
                                                     'depth of image, or '
                                                     'imaged area '
                                                     '(meters).',
                                      'type': 'array'},
                    'format': {'description': 'Format of image. Three '
                                              'types - 1) Image format; '
                                              'tiff, png, jpg, etc. 2) '
                                              'external 3) raw.',
                               'type': 'string'},
                    'imaging_plane': {'description': 'Imaging plane '
                                                     'class/pointer.',
                                      'target': 'pynwb.ophys.ImagingPlane',
                                      'type': 'string'},
                    'name': {'description': 'The name of this TimeSeries '
                                            'dataset',
                             'pattern': '^[^/]*$',
                             'type': 'string'},
                    'offset': {'default': 0.0,
                               'description': 'Scalar to add to each '
                                              'element in the data scaled '
                                              "by 'conversion' to finish "
                                              'converting it to the '
                                              'specified unit.',
                               'type': 'number'},
                    'pmt_gain': {'description': 'Photomultiplier gain.',
                                 'type': 'number'},
                    'rate': {'description': 'Sampling rate in Hz',
                             'type': 'number'},
                    'resolution': {'default': -1.0,
                                   'description': 'The smallest meaningful '
                                                  'difference (in '
                                                  'specified unit) between '
                                                  'values in data',
                                   'type': 'number'},
                    'scan_line_rate': {'description': 'Lines imaged per '
                                                      'second. This is '
                                                      'also stored in '
                                                      '/general/optophysiology '
                                                      'but is kept here as '
                                                      'it is useful '
                                                      'information for '
                                                      'analysis, and so '
                                                      'good to be stored '
                                                      'w/ the actual data.',
                                       'type': 'number'},
                    'starting_frame': {'description': 'Each entry is a '
                                                      'frame number that '
                                                      'corresponds to the '
                                                      'first frame of each '
                                                      'file listed in '
                                                      'external_file '
                                                      'within the full '
                                                      'ImageSeries.',
                                       'type': 'array'},
                    'starting_time': {'description': 'The timestamp of the '
                                                     'first sample',
                                      'type': 'number'},
                    'unit': {'description': 'The unit of measurement of '
                                            'the image data, e.g., values '
                                            'between 0 and 255. Required '
                                            'when data is specified. If '
                                            'unit (and data) are not '
                                            'specified, then unit will be '
                                            'set to "unknown".',
                             'type': 'string'}},
     'required': ['name', 'imaging_plane'],
     'tag': 'pynwb.ophys.TwoPhotonSeries',
     'type': 'array'}

On instance['Ophys']['TwoPhotonSeries']:
    {'comments': 'no comments',
     'conversion': 1.0,
     'description': 'no description',
     'resolution': -1.0}
    at run (utils.js:90:33)
    at async GuidedMetadataPage.runConversions (Page.js:205:28)
    at async GuidedMetadataPage.convert (Page.js:125:27)
    at async GuidedFooter.onNext [as __onNext] (GuidedMetadata.js:184:13)

@CodyCBakerPhD CodyCBakerPhD enabled auto-merge April 3, 2024 19:51
@CodyCBakerPhD CodyCBakerPhD disabled auto-merge April 3, 2024 19:51
@CodyCBakerPhD CodyCBakerPhD enabled auto-merge April 3, 2024 20:15
@CodyCBakerPhD CodyCBakerPhD merged commit 381f48e into main Apr 3, 2024
14 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the fix-ophys-table-popup-and-validation branch April 3, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants