Skip to content

Commit edd18b6

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2a7eaac commit edd18b6

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

dandischema/datacite/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414
from jsonschema import Draft7Validator
1515
import requests
1616

17-
from ..models import NAME_PATTERN, Organization, Person, PublishedDandiset, RoleType, Dandiset
17+
from ..models import (
18+
NAME_PATTERN,
19+
Dandiset,
20+
Organization,
21+
Person,
22+
PublishedDandiset,
23+
RoleType,
24+
)
1825

1926
DATACITE_CONTRTYPE = {
2027
"ContactPerson",
@@ -64,6 +71,7 @@
6471
}
6572
DATACITE_MAP = {el.lower(): el for el in DATACITE_IDENTYPE}
6673

74+
6775
def to_datacite(
6876
meta: Union[dict, PublishedDandiset],
6977
event: str = None,

dandischema/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@
7070
PUBLISHED_VERSION_URL_PATTERN = (
7171
rf"^{DANDI_INSTANCE_URL_PATTERN}/dandiset/{VERSION_PATTERN}$"
7272
)
73-
PUBLISHED_URL_PATTERN = rf"{PUBLISHED_VERSION_URL_PATTERN}|{PUBLISHED_DANDISET_URL_PATTERN}"
73+
PUBLISHED_URL_PATTERN = (
74+
rf"{PUBLISHED_VERSION_URL_PATTERN}|{PUBLISHED_DANDISET_URL_PATTERN}"
75+
)
7476
MD5_PATTERN = r"[0-9a-f]{32}"
7577
SHA256_PATTERN = r"[0-9a-f]{64}"
7678

@@ -1872,9 +1874,7 @@ def check_filesbytes(cls, values: AssetsSummary) -> AssetsSummary:
18721874
@classmethod
18731875
def check_url(cls, url: AnyHttpUrl) -> AnyHttpUrl:
18741876
if not re.match(PUBLISHED_URL_PATTERN, str(url)):
1875-
raise ValueError(
1876-
f'string does not match regex "{PUBLISHED_URL_PATTERN}"'
1877-
)
1877+
raise ValueError(f'string does not match regex "{PUBLISHED_URL_PATTERN}"')
18781878
return url
18791879

18801880

0 commit comments

Comments
 (0)