-
Notifications
You must be signed in to change notification settings - Fork 25
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
adding to_datacite method #596
Conversation
…datacite approved list); adding Sponsors to fundingReferences; adding automatic fix for relatedIdentifiers types
Datacite tmp
Codecov Report
@@ Coverage Diff @@
## master #596 +/- ##
==========================================
+ Coverage 84.08% 84.40% +0.31%
==========================================
Files 59 59
Lines 5644 5790 +146
==========================================
+ Hits 4746 4887 +141
- Misses 898 903 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@satra - I'm testing metadata that I took from dandisets 04 and 08. I could modify dataset 27 and add to the test, but can also keep adding various metadata to test_dantimeta_datacite |
for the moment you can use a local test, but we should also add a test which downloads from the API, augments it with the missing pieces (because draft metadata may not have doi, url, etc.,.) and then runs through your datacite test using the test server. |
dandi/tests/test_models.py
Outdated
|
||
# checking if i'm able to get the url | ||
rg = requests.get( | ||
url=f"https://api.test.datacite.org/dois/{doi.replace('/','%2F')}/activities" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why activities and not compare to the posted metadata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also we shouldn't have to do the doi.replace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, the replacement is not needed. But the form with "activities" I took from datacite examples and it doesn't work without
Please merge master or rebase -- "Test populate_dandiset_yaml.py / test (push) " should be gone now. |
didn't look through all details (we should put con/tinuous to work here, filed #639) but those failing which are saw are of the
nature |
the biggest problem is that |
that would be a good function to right. this function should iterate over all assets in a dandiset to create a summary of unique values for those fields. however, this is also what yarik was going to add to the asset. for example approach/technique are not being populated at the asset level right now. we can relax some of the components to optional, but i think species, approach, technique should really be there. |
i'm a bit confused since it looks like a combination of information that should be provided by the author and info that could be calculated automatically... |
all of that info is calculated from asset metadata, hence the name. the authors would provide this when creating nwb files (and they generally do). we have to do a bit more magic for bids datasets, so those would likely not be publishable till we have figured out some pieces. |
ok, so for testing, I guess it's ok for me to use some random entry |
yes |
for now, I just saved meta from 000004 and 00008 in |
not sure what to do with |
well, if you look at that fail run fail you will see
so this PR modifies schema by adding |
@yarikoptic - the doi was already there in the model, and should also be non-optional. this mutates it by removing a default value, which i think has an impact on whether or not it got exported to JSON schema. so this was a bug in the schema generation which this PR fixes. |
technically this should not cause any issues in api/ui since we have had discussions about doi, but pinging @dchiquito. would be fine with me to mutate. |
ok, left minor comments but could be handled post-merge/migration to dedicated |
7ea408e
to
2ae1c02
Compare
Ok, @dchiquito gave blessing in slack, I fixed lint issue I introduced, let's proceed. Anything remaining should be done against |
this is a continuation of #516 (I had issues with using the secrets, so testing this from the dandi branch)
Adding a new method
to_dandicite
that creates a datacite dictionary from the metadata object