diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8b44b2d1..54fc7d72 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/PyCQA/isort diff --git a/dandischema/digests/zarr.py b/dandischema/digests/zarr.py index ae37b148..3f0257f6 100644 --- a/dandischema/digests/zarr.py +++ b/dandischema/digests/zarr.py @@ -76,9 +76,9 @@ def add_directory_checksums(self, checksums: List[ZarrChecksum]) -> None: """Add a list of directory checksums to the listing.""" for new_checksum in checksums: try: - self.directories[ - self._index(self.directories, new_checksum) - ] = new_checksum + self.directories[self._index(self.directories, new_checksum)] = ( + new_checksum + ) except ValueError: self.directories.append(new_checksum) self.directories = sorted(self.directories) diff --git a/dandischema/models.py b/dandischema/models.py index 7633143b..0eca9674 100644 --- a/dandischema/models.py +++ b/dandischema/models.py @@ -1044,9 +1044,9 @@ class Activity(DandiBaseModel): # isPartOf: Optional["Activity"] = Field(None, json_schema_extra={"nskey": "schema"}) # hasPart: Optional["Activity"] = Field(None, json_schema_extra={"nskey": "schema"}) - wasAssociatedWith: Optional[ - List[Union[Person, Organization, Software, Agent]] - ] = Field(None, json_schema_extra={"nskey": "prov"}) + wasAssociatedWith: Optional[List[Union[Person, Organization, Software, Agent]]] = ( + Field(None, json_schema_extra={"nskey": "prov"}) + ) used: Optional[List[Equipment]] = Field( None, description="A listing of equipment used for the activity.", @@ -1381,9 +1381,11 @@ class CommonModel(DandiBaseModel): repository: Optional[AnyHttpUrl] = Field( # mypy doesn't like using a string as the default for an AnyHttpUrl # attribute, so we have to convert it to an AnyHttpUrl: - TypeAdapter(AnyHttpUrl).validate_python(DANDI_INSTANCE_URL) - if DANDI_INSTANCE_URL is not None - else None, + ( + TypeAdapter(AnyHttpUrl).validate_python(DANDI_INSTANCE_URL) + if DANDI_INSTANCE_URL is not None + else None + ), description="location of the item", json_schema_extra={"nskey": "dandi", "readOnly": True}, )