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

cleaning up biosample and participant #312

Merged
merged 10 commits into from
Dec 18, 2020
Merged

cleaning up biosample and participant #312

merged 10 commits into from
Dec 18, 2020

Conversation

satra
Copy link
Member

@satra satra commented Dec 10, 2020

this is a draft PR to try and clean up the asset model. i haven't updated tests yet. putting the model changes here up for discussion.

nskey="dandi",
)

wasDerivedFrom: Optional[List["BioSample"]] = Field(None, nskey="prov")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this recursive formulation should allow us to have cell ids, slice ids, and tissue ids.



class Participant(DandiBaseModel):
"""Description about the sample that was studied"""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

separating out participant details

Comment on lines +655 to +657
wasAttributedTo: List[Participant] = Field(
None, description="Participant(s) to which this file belongs to", nskey="prov"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a given asset may have multiple participants potentially. how we deal with this in the name is something we will have to figure out.

@satra satra changed the title [WIP] cleaning up biosample and participant cleaning up biosample and participant Dec 11, 2020
@codecov
Copy link

codecov bot commented Dec 11, 2020

Codecov Report

Merging #312 (eb5a7cd) into master (d21b154) will increase coverage by 0.09%.
The diff coverage is 93.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #312      +/-   ##
==========================================
+ Coverage   70.33%   70.42%   +0.09%     
==========================================
  Files          55       55              
  Lines        5077     5096      +19     
==========================================
+ Hits         3571     3589      +18     
- Misses       1506     1507       +1     
Flag Coverage Δ
unittests 70.42% <93.54%> (+0.09%) ⬆️

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

Impacted Files Coverage Δ
dandi/tests/test_metadata.py 100.00% <ø> (ø)
dandi/tests/test_validate.py 100.00% <ø> (ø)
dandi/metadata.py 74.76% <87.50%> (+0.58%) ⬆️
dandi/models.py 82.35% <100.00%> (+0.53%) ⬆️

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 d21b154...eb5a7cd. Read the comment docs.

@yarikoptic
Copy link
Member

now master should be 3.9 testing friendly , so the only issues are of the lint

lint errors
Run tox -e lint
lint create: /home/runner/work/dandi-cli/dandi-cli/.tox/lint
lint installdeps: flake8
lint installed: flake8==3.8.4,importlib-metadata==3.3.0,mccabe==0.6.1,pycodestyle==2.6.0,pyflakes==2.2.0,typing-extensions==3.7.4.3,zipp==3.4.0
lint run-test-pre: PYTHONHASHSEED='1970909900'
lint run-test: commands[0] | flake8 --config=setup.cfg dandi setup.py
dandi/tests/test_metadata.py:592:101: E501 line too long (132 > 100 characters)
dandi/tests/test_metadata.py:638:101: E501 line too long (109 > 100 characters)
dandi/tests/test_metadata.py:673:101: E501 line too long (221 > 100 characters)
dandi/tests/test_metadata.py:741:101: E501 line too long (109 > 100 characters)
dandi/tests/test_metadata.py:766:101: E501 line too long (109 > 100 characters)
dandi/tests/test_metadata.py:787:101: E501 line too long (106 > 100 characters)
dandi/tests/test_metadata.py:808:101: E501 line too long (106 > 100 characters)
dandi/tests/test_metadata.py:834:101: E501 line too long (131 > 100 characters)
dandi/tests/test_metadata.py:870:101: E501 line too long (221 > 100 characters)
dandi/tests/test_metadata.py:880:101: E501 line too long (133 > 100 characters)
dandi/tests/test_metadata.py:901:101: E501 line too long (119 > 100 characters)
dandi/tests/test_metadata.py:942:101: E501 line too long (119 > 100 characters)
dandi/tests/test_metadata.py:963:101: E501 line too long (109 > 100 characters)
dandi/tests/test_metadata.py:1002:101: E501 line too long (109 > 100 characters)
dandi/tests/test_metadata.py:1012:101: E501 line too long (106 > 100 characters)
dandi/tests/test_metadata.py:1022:101: E501 line too long (133 > 100 characters)
dandi/tests/test_metadata.py:1032:101: E501 line too long (127 > 100 characters)
dandi/tests/test_metadata.py:1042:101: E501 line too long (155 > 100 characters)
dandi/tests/test_metadata.py:1097:101: E501 line too long (102 > 100 characters)
dandi/tests/test_metadata.py:1127:101: E501 line too long (1147 > 100 characters)
dandi/tests/test_metadata.py:1149:101: E501 line too long (124 > 100 characters)
ERROR: InvocationError for command /home/runner/work/dandi-cli/dandi-cli/.tox/lint/bin/flake8 --config=setup.cfg dandi setup.py (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   lint: commands failed
Error: Process completed with exit code 1.

aren't you using pre-commit?!

* upstream/master:
  Add comment explaining why Python 3.9 on Windows testing is disabled
  Downgrade hdf5 on macOS to 1.8
  Install hdf5 for Python 3.9 tests
@satra
Copy link
Member Author

satra commented Dec 15, 2020

pre-commit isn't catching these linting things. do remember pre-commit uses black which is opinionated.

@yarikoptic
Copy link
Member

hm, I just remember it splitting long lines for me and staying largely inline with what we have setup for linters... odd

@yarikoptic
Copy link
Member

Dear @jwodder , could you please finalize this PR (if I got it right -- only linting is remaining) so we could merge it (@satra I believe is already holidaying officially so we should not pester him to not ruin that important nowadays activity).

@jwodder
Copy link
Member

jwodder commented Dec 16, 2020

@yarikoptic Delinted.

* upstream/master:
  Split up download methods
  Simplify code
  Download method for new API
  Update pagination
  Fix more API calls
  Include dandiset ID and version ID in `file_name`
  Correct the calls to the validation endpoints
  Wait for Django API Docker container to be ready
  Test of new upload method
  upload() method for new API
  Set API URL for Docker Compose to point to API container
  Basic updates for new API
  Fix tests
  Ensure log path is always printed, even on error
  Record sys.argv and os.getcwd() as logfile-specific log messages
  Tee all logs to user log directory
@satra
Copy link
Member Author

satra commented Dec 18, 2020

@yarikoptic - the tests that fail here are the same tests that fail on master and unrelated to this PR.

@yarikoptic
Copy link
Member

hm, something changed in API server I guess -- #283 which had dealt with new code for API was all green when merged 2 days ago. so indeed let's just proceed with merge and #322 is now dedicated to test failure

@yarikoptic yarikoptic merged commit e7af24a into master Dec 18, 2020
@yarikoptic yarikoptic deleted the enh/subject branch December 18, 2020 19:59
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.

3 participants