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

BF: dandiset metadata record structure/assumptions #242

Merged
merged 9 commits into from
Sep 21, 2020

Conversation

yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Sep 15, 2020

In #233 (post 0.6.4 release, current master) I have tried to unify metadata records, but did that incorrectly for dandisets. I forgot that those would also be used during upload which caused fiasco in uploading sample 000029 (web ui is also not tolerant to bad metadata)

As part of this PR I also

yarikoptic and others added 7 commits September 15, 2020 15:34
With RFings in master we can screw it up, and also web ui is fragile
to wrong metadata records atm and there is no validation yet.  Since
we already have a header saying that all changes would be lost, I think the
best course of action is just to not upload it at all!
Also harmonized returned value to always return the metadata record,
otherwise how would Python user know what was registered?
@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #242 into master will increase coverage by 0.32%.
The diff coverage is 90.38%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #242      +/-   ##
==========================================
+ Coverage   81.79%   82.11%   +0.32%     
==========================================
  Files          52       52              
  Lines        4262     4462     +200     
==========================================
+ Hits         3486     3664     +178     
- Misses        776      798      +22     
Flag Coverage Δ
#unittests 82.11% <90.38%> (+0.32%) ⬆️

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

Impacted Files Coverage Δ
dandi/cli/cmd_register.py 75.00% <0.00%> (+5.76%) ⬆️
dandi/girder.py 85.60% <ø> (+3.37%) ⬆️
dandi/download.py 81.45% <75.00%> (-0.19%) ⬇️
dandi/register.py 74.07% <75.00%> (+3.70%) ⬆️
dandi/dandiset.py 88.88% <92.85%> (-3.27%) ⬇️
dandi/tests/test_register.py 100.00% <100.00%> (ø)
dandi/tests/test_upload.py 100.00% <100.00%> (ø)
dandi/upload.py 71.13% <100.00%> (-2.96%) ⬇️
dandi/validate.py 85.71% <0.00%> (-11.43%) ⬇️
... and 3 more

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 9e29cdf...bf5abcf. Read the comment docs.

ds = Dandiset(dandiset_path, allow_empty=True)
ds.update_metadata(dandiset)
return None
else:
Copy link
Member

Choose a reason for hiding this comment

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

I feel like the function should at least warn if no dandiset path is provided or detected.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough. I have returned .info message in 7aa6877 but in a location in the code above. Since here we could get within an existing dandiset but which already has an identifier which we refuse above to modify (and thus do not set dandiset_path), so it would not be a matter of "not provided or detected", so this location would be suboptimal.

@jwodder
Copy link
Member

jwodder commented Sep 17, 2020

The help text for the register command's --dandiset-path option says "If not specified, content for the file will be printed to the screen," but this PR seems to eliminate that behavior. Is that intentional?

@yarikoptic
Copy link
Member Author

oh, not intentional. Thanks for catching that! could you please adjust code to just print registered dandiset id and adjust help string accordingly?

@jwodder
Copy link
Member

jwodder commented Sep 18, 2020

Do you mean print the ID always or only when --dandiset-path is not specified?

@yarikoptic
Copy link
Member Author

I think it is ok to print it always (unless fails to register)

@jwodder
Copy link
Member

jwodder commented Sep 21, 2020

@yarikoptic Commit added.

@yarikoptic
Copy link
Member Author

Thanks, let's proceed

@yarikoptic yarikoptic merged commit 2af6eeb into master Sep 21, 2020
@yarikoptic yarikoptic deleted the bf-dandiset-meta-assumptions branch September 21, 2020 14:14
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.

"integration" test for upload to use main archive dandiset metadata record
2 participants