Skip to content

Commit

Permalink
fixed up py3.9 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Aug 1, 2024
1 parent 53592ab commit 6c69233
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions frametree/xnat/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def save_dataset_definition(
----------
dataset_id: str
The ID/path of the dataset within the store
definition: dict[str, Any]
definition: ty.Dict[str, Any]
A dictionary containing the dct Dataset to be saved. The
dictionary is in a format ready to be dumped to file as JSON or
YAML.
Expand All @@ -187,7 +187,9 @@ def save_dataset_definition(
json.dump(definition, f, indent=" ")
xresource.upload(str(definition_file), name + ".json", overwrite=True)

def load_dataset_definition(self, dataset_id: str, name: str) -> dict[str, ty.Any]:
def load_dataset_definition(
self, dataset_id: str, name: str
) -> ty.Dict[str, ty.Any]:
"""Load definition of a dataset saved within the store
Parameters
Expand All @@ -200,7 +202,7 @@ def load_dataset_definition(self, dataset_id: str, name: str) -> dict[str, ty.An
Returns
-------
definition: dict[str, Any]
definition: ty.Dict[str, Any]
A dct Dataset object that was saved in the data store
"""
with self.connection:
Expand Down Expand Up @@ -265,7 +267,7 @@ def put_provenance(self, provenance: ty.Dict[str, ty.Any], entry: DataEntry):
----------
entry: DataEntry
The item to store the provenance data for
provenance: dict[str, Any]
provenance: ty.Dict[str, Any]
The provenance data to store
"""
xresource, _, cache_path = self._provenance_location(
Expand All @@ -285,7 +287,7 @@ def get_provenance(self, entry: DataEntry) -> ty.Dict[str, ty.Any]:
Returns
-------
provenance: dict[str, Any] or None
provenance: ty.Dict[str, Any] or None
The provenance data stored in the repository for the data item.
None if no provenance data has been stored
"""
Expand Down Expand Up @@ -527,7 +529,7 @@ def get_checksums(self, uri: str):
}
return checksums

def calculate_checksums(self, fileset: FileSet) -> dict[str, str]:
def calculate_checksums(self, fileset: FileSet) -> ty.Dict[str, str]:
"""
Downloads the checksum digests associated with the files in the file-set.
These are saved with the downloaded files in the cache and used to
Expand Down
4 changes: 2 additions & 2 deletions frametree/xnat/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def install_and_launch_xnat_cs_command(
----------
cmd_name : str
The name to install the command as
command_json : dict[str, Any]
command_json : ty.Dict[str, Any]
JSON that defines the XNAT command in the container service (see `generate_xnat_command`)
project_id : str
ID of the project to enable the command for
session_id : str
ID of the session to launch the command on
inputs : dict[str, str]
inputs : ty.Dict[str, str]
Inputs passed to the pipeline at launch (i.e. typically through text fields in the CS launch UI)
xlogin : xnat.XNATSession
XnatPy connection to the XNAT server
Expand Down

0 comments on commit 6c69233

Please sign in to comment.