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

make Image basetype a dataset #694

Merged
merged 3 commits into from
Oct 31, 2018
Merged

make Image basetype a dataset #694

merged 3 commits into from
Oct 31, 2018

Conversation

ajtritt
Copy link
Member

@ajtritt ajtritt commented Oct 30, 2018

Motivation

make Image base type a dataset

Checklist

  • Have you checked our Contributing document?
  • Have you ensured the PR description clearly describes 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 #XXX notation where XXX is the issue number ?

@ajtritt ajtritt requested a review from bendichter October 30, 2018 21:03
@bendichter
Copy link
Contributor

bendichter commented Oct 30, 2018

@ajtritt I like this if we can make it work but right now there's an error:
TypeError: incorrect type for 'neurodata_type_inc' (got 'NWBDatasetSpec', expected 'NWBGroupSpec or str')

@codecov
Copy link

codecov bot commented Oct 30, 2018

Codecov Report

Merging #694 into image will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##            image     #694      +/-   ##
==========================================
- Coverage   74.76%   74.75%   -0.02%     
==========================================
  Files          58       58              
  Lines        6812     6812              
  Branches     1399     1399              
==========================================
- Hits         5093     5092       -1     
  Misses       1325     1325              
- Partials      394      395       +1
Impacted Files Coverage Δ
src/pynwb/form/utils.py 87.05% <0%> (-0.3%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed6b631...eb95d50. Read the comment docs.

@bendichter
Copy link
Contributor

@ajtritt

Can datasets have datasets? Or should it be:

datasets:
- neurodata_type_def: GrayscaleImage
  neurodata_type_inc: Image
  doc: Grayscale image. Origin in top left.
  shape:
    - null
    - null
  dims:
    - 'y'
    - 'x'
- neurodata_type_def: RGBImage
  neurodata_type_inc: Image
  doc: Color image. Origin in top left.
  shape:
  - null
  - null
  - 3
  dims:
  - 'y'
  - 'x'
  - 'R,G,B'
- neurodata_type_def: RGBAImage
  neurodata_type_inc: Image
  doc: Color image with transparency. Origin in top left.
  shape:
  - null
  - null
  - 4
  dims:
  - 'y'
  - 'x'
  - 'R,G,B,A'

@ajtritt
Copy link
Member Author

ajtritt commented Oct 30, 2018

@bendichter yes, you are correct. I sloppily copy-pasted... I just changed it though.

@bendichter
Copy link
Contributor

@ajtritt How do you interact with these types of datasets in pynwb? I don't see any such datasets in any of the schema namespace files other than abstract types in base

@ajtritt
Copy link
Member Author

ajtritt commented Oct 31, 2018

@bendichter there is an Image base class in file.py

class Image(NWBData):

It’s not fully implemented right now, but it would just need to be implemented to support the necessary attributes on the dataset, and the necessary subclasses would need to be added.

@bendichter
Copy link
Contributor

why specify Image in nwb.base.yaml and then define the constructor in file.py? Wouldn't it make more sense to have the constructor in base.py?

@bendichter bendichter merged commit 7900f3f into image Oct 31, 2018
@ajtritt
Copy link
Member Author

ajtritt commented Oct 31, 2018

Sure, it probably makes more sense. But, there's no requirement about where specs are and where their API classes are.

@bendichter bendichter deleted the image_datasets branch November 3, 2018 00:33
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