Skip to content

Commit

Permalink
Update to ZenodoDoi class, update to https
Browse files Browse the repository at this point in the history
  • Loading branch information
e-belfer committed Nov 2, 2023
1 parent 633b63d commit 4b028d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/pudl/metadata/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
)
from pudl.metadata.resources import FOREIGN_KEYS, RESOURCE_METADATA, eia861
from pudl.metadata.sources import SOURCES
from pudl.workspace.datastore import Datastore
from pudl.workspace.datastore import Datastore, ZenodoDoi
from pudl.workspace.setup import PudlPaths

logger = pudl.logging_helpers.get_logger(__name__)
Expand Down Expand Up @@ -228,8 +228,6 @@ def __repr_args__(self) -> list[tuple[str, Any]]:

HttpUrl = pydantic.AnyHttpUrl
"""Http(s) URL."""

Doi = pydantic.constr(min_length=1, strict=True, regex=r"10\.5281/zenodo\.\d{6,8}")
"""DOIs from Zenodo archives."""


Expand Down Expand Up @@ -938,7 +936,7 @@ class DataSource(Base):
contributors: list[Contributor] = []
license_raw: License
license_pudl: License
concept_doi: Doi = None
concept_doi: ZenodoDoi = None
working_partitions: dict[SnakeCase, Any] = {}
source_file_dict: dict[SnakeCase, Any] = {}
# agency: Agency # needs to be defined
Expand Down
2 changes: 1 addition & 1 deletion src/pudl/metadata/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"us-govt": {
"name": "other-pd",
"title": "U.S. Government Works",
"path": "http://www.usa.gov/publicdomain/label/1.0/",
"path": "https://www.usa.gov/publicdomain/label/1.0/",
},
}
"""License attributes."""
Expand Down
4 changes: 3 additions & 1 deletion src/pudl/workspace/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
logger = pudl.logging_helpers.get_logger(__name__)

PUDL_YML = Path.home() / ".pudl.yml"
ZenodoDoi = constr(regex=r"(10\.5072|10\.5281)/zenodo.([\d]+)")
ZenodoDoi = constr(
strict=True, min_length=16, regex=r"(10\.5072|10\.5281)/zenodo.([\d]+)"
)


class ChecksumMismatchError(ValueError):
Expand Down

0 comments on commit 4b028d2

Please sign in to comment.