Add concept DOI model, dates field, IsVersionOf relations, DANDI identifier#401
Open
Add concept DOI model, dates field, IsVersionOf relations, DANDI identifier#401
Conversation
Tests for Phase 0 tasks T001-T004: - T001: Optional doi field on Dandiset model for concept DOIs - T002: dates field in to_datacite() output (dateType: Issued) - T003: IsVersionOf/HasVersion concept DOI relation support - T004: DANDI identifier in alternateIdentifiers 6 tests fail (expected), 3 pass (existing behavior). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…I ID Phase 0 implementation for DataCite DOI improvements: T001: Add optional `doi` field to Dandiset model for concept DOI support, with DANDI_CONCEPT_DOI_PATTERN using dynamic Config.doi_prefix (preserves vendorization). T002: Add `dates` field to to_datacite() output mapping datePublished to DataCite dateType "Issued". This brings recommended field coverage from 4/6 to 5/6 (83%). T003: Add `concept_doi` parameter to to_datacite(). When provided, emits an IsVersionOf relatedIdentifier pointing to the concept DOI. Backward compatible (defaults to None). T004: Add DANDI identifier (e.g., DANDI:000485) to DataCite alternateIdentifiers with type "DANDI". All changes are backward compatible. Existing callers of to_datacite() continue to work without modification. 9 new tests + 1 updated existing test. 105 passed, 0 failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #401 +/- ##
==========================================
+ Coverage 97.92% 97.99% +0.07%
==========================================
Files 18 19 +1
Lines 2405 2499 +94
==========================================
+ Hits 2355 2449 +94
Misses 50 50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Remove unused PublishedDandiset import from test_doi_improvements.py - Apply black formatting to all changed files - Fixes CI lint and pre-commit checks Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The alternateIdentifierType for the DANDI identifier should come from the instance config (e.g., "DANDI", "EMBER-DANDI") rather than being hardcoded to "DANDI". This ensures multi-instance compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
@yarikoptic - you can review this and we will likely want to release this before the PRs (to archive) will be merged for doi process (coming soon). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
doifield toDandisetmodel for concept DOI support (version-independent DOI per dandiset), withDANDI_CONCEPT_DOI_PATTERNusing dynamicConfig.doi_prefixto preserve vendorizationdatesfield toto_datacite()output mappingdatePublishedto DataCitedateType: "Issued", bringing recommended field coverage from 4/6 to 5/6 (83%)concept_doiparameter toto_datacite()that emits anIsVersionOfrelatedIdentifierwhen provided (backward compatible, defaults toNone)DANDI:000485) to DataCitealternateIdentifierswith type"DANDI"All changes are backward compatible. Existing callers of
to_datacite()continue to work without modification.Related issues: dandi/dandi-archive#1319, #259, #292
Test plan
test_doi_improvements.pycovering all 4 changestest_datacite_publishexpected output for new fieldsDANDI_DOI_PREFIX=10.80507 DANDI_INSTANCE_NAME=DANDI DANDI_INSTANCE_IDENTIFIER="RRID:SCR_017571"🤖 Generated with Claude Code