Skip to content

Commit 942f616

Browse files
committed
cleanup comments
1 parent 9bf653f commit 942f616

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

dandischema/datacite/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,11 @@ def to_datacite(
131131
If strict validation fails, it falls back to using construct_unvalidated_dandiset()
132132
to build the model without validation but with properly handled nested types.
133133
"""
134-
# Try to convert dict to model if needed
135134
if isinstance(meta, dict):
136135
meta = deepcopy(meta)
137136
try:
138-
# First try PublishedDandiset
139137
meta = PublishedDandiset(**meta)
140138
except ValidationError:
141-
# If that fails, use construct_unvalidated_dandiset
142139
if meta.get("version") == "draft":
143140
logger.debug("Falling back to unvalidated dandiset for draft version")
144141
else:
@@ -194,7 +191,7 @@ def to_datacite(
194191
"lang": "en",
195192
}
196193

197-
# Only include publicationYear if datePublished is available (for published Dandisets)
194+
# publicationYear is not available for draft dandisets
198195
if hasattr(meta, "datePublished") and meta.datePublished:
199196
attributes["publicationYear"] = str(meta.datePublished.year)
200197

dandischema/datacite/tests/test_datacite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def metadata_draft() -> Dict[str, Any]:
8181
"url": f"https://dandiarchive.org/dandiset/{dandi_id_noprefix}", # DLP, not version url
8282
"doi": f"10.80507/dandi.{dandi_id_noprefix}",
8383
"version": "draft",
84-
# Missing: datePublished, publishedBy, citation, etc. (triggers fallback)
84+
# Missing: datePublished, publishedBy
8585
}
8686

8787

0 commit comments

Comments
 (0)