Skip to content

Add concept DOI model, dates field, IsVersionOf relations, DANDI identifier#401

Open
satra wants to merge 5 commits intomasterfrom
enh/datacite-doi-improvements
Open

Add concept DOI model, dates field, IsVersionOf relations, DANDI identifier#401
satra wants to merge 5 commits intomasterfrom
enh/datacite-doi-improvements

Conversation

@satra
Copy link
Copy Markdown
Member

@satra satra commented Apr 27, 2026

Summary

  • Add optional doi field to Dandiset model for concept DOI support (version-independent DOI per dandiset), with DANDI_CONCEPT_DOI_PATTERN using dynamic Config.doi_prefix to preserve vendorization
  • Add dates field to to_datacite() output mapping datePublished to DataCite dateType: "Issued", bringing recommended field coverage from 4/6 to 5/6 (83%)
  • Add concept_doi parameter to to_datacite() that emits an IsVersionOf relatedIdentifier when provided (backward compatible, defaults to None)
  • 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.

Related issues: dandi/dandi-archive#1319, #259, #292

Test plan

  • 9 new TDD tests in test_doi_improvements.py covering all 4 changes
  • Updated test_datacite_publish expected output for new fields
  • 105 total tests passing (including 79 model tests), 0 failures
  • Verified no regressions with DANDI_DOI_PREFIX=10.80507 DANDI_INSTANCE_NAME=DANDI DANDI_INSTANCE_IDENTIFIER="RRID:SCR_017571"

🤖 Generated with Claude Code

satra and others added 3 commits April 27, 2026 18:45
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>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.99%. Comparing base (40df0ac) to head (6202e8d).

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              
Flag Coverage Δ
unittests 97.99% <100.00%> (+0.07%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

satra and others added 2 commits April 27, 2026 19:15
- 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>
@satra satra requested a review from yarikoptic April 28, 2026 14:07
@satra
Copy link
Copy Markdown
Member Author

satra commented Apr 28, 2026

@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).

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.

1 participant