diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c1b807c..9d501226 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.2 + rev: v0.6.4 hooks: - id: ruff name: ruff check @@ -24,7 +24,7 @@ repos: name: ruff format alias: format - repo: https://github.com/RobertCraigie/pyright-python - rev: v1.1.377 + rev: v1.1.379 hooks: - id: pyright additional_dependencies: [cython, httpretty, numpy, pytest] diff --git a/cryosparc/dataset.py b/cryosparc/dataset.py index d2486a24..35df24aa 100644 --- a/cryosparc/dataset.py +++ b/cryosparc/dataset.py @@ -820,7 +820,7 @@ def __init__( Data, Mapping[str, "ArrayLike"], List[Tuple[str, "ArrayLike"]], - Literal[None], + None, ] = 0, row_class=Row, ): @@ -1084,7 +1084,7 @@ def add_fields(self, fields: Sequence[str], dtypes: Union[str, Sequence["DTypeLi def add_fields( self, fields: Union[Sequence[str], Sequence[Field]], - dtypes: Union[str, Sequence["DTypeLike"], Literal[None]] = None, + dtypes: Union[str, Sequence["DTypeLike"], None] = None, ) -> "Dataset[R]": """ Adds the given fields to the dataset. If a field with the same name diff --git a/cryosparc/job.py b/cryosparc/job.py index 14ccf40d..4ed24ede 100644 --- a/cryosparc/job.py +++ b/cryosparc/job.py @@ -496,8 +496,8 @@ def log_plot( figure: Union[str, PurePath, IO[bytes], Any], text: str, formats: Iterable[ImageFormat] = ["png", "pdf"], - raw_data: Union[str, bytes, Literal[None]] = None, - raw_data_file: Union[str, PurePath, IO[bytes], Literal[None]] = None, + raw_data: Union[str, bytes, None] = None, + raw_data_file: Union[str, PurePath, IO[bytes], None] = None, raw_data_format: Optional[TextFormat] = None, flags: List[str] = ["plots"], savefig_kw: dict = dict(bbox_inches="tight", pad_inches=0), @@ -767,8 +767,8 @@ def upload_plot( figure: Union[str, PurePath, IO[bytes], Any], name: Optional[str] = None, formats: Iterable[ImageFormat] = ["png", "pdf"], - raw_data: Union[str, bytes, Literal[None]] = None, - raw_data_file: Union[str, PurePath, IO[bytes], Literal[None]] = None, + raw_data: Union[str, bytes, None] = None, + raw_data_file: Union[str, PurePath, IO[bytes], None] = None, raw_data_format: Optional[TextFormat] = None, savefig_kw: dict = dict(bbox_inches="tight", pad_inches=0), ) -> List[EventLogAsset]: @@ -965,7 +965,7 @@ def subprocess( args: Union[str, list], mute: bool = False, checkpoint: bool = False, - checkpoint_line_pattern: Union[str, Pattern[str], Literal[None]] = None, + checkpoint_line_pattern: Union[str, Pattern[str], None] = None, **kwargs, ): """ @@ -1255,21 +1255,20 @@ def add_input( def add_output( self, type: Datatype, - name: Optional[str] = ..., - slots: List[SlotSpec] = ..., - passthrough: Optional[str] = ..., - title: Optional[str] = None, - alloc: Literal[None] = None, + name: Optional[str], + slots: List[SlotSpec], + passthrough: Optional[str], + title: Optional[str], ) -> str: ... @overload def add_output( self, type: Datatype, - name: Optional[str] = ..., - slots: List[SlotSpec] = ..., - passthrough: Optional[str] = ..., - title: Optional[str] = None, - alloc: Union[int, Dataset] = ..., + name: Optional[str], + slots: List[SlotSpec], + passthrough: Optional[str], + title: Optional[str], + alloc: Union[int, Dataset], ) -> Dataset: ... def add_output( self, @@ -1278,7 +1277,7 @@ def add_output( slots: List[SlotSpec] = [], passthrough: Optional[str] = None, title: Optional[str] = None, - alloc: Union[int, Dataset, Literal[None]] = None, + alloc: Union[int, Dataset, None] = None, ) -> Union[str, Dataset]: """ Add an output slot to the current job. Optionally returns the diff --git a/cryosparc/util.py b/cryosparc/util.py index eb2ee6b2..cf46df91 100644 --- a/cryosparc/util.py +++ b/cryosparc/util.py @@ -320,7 +320,7 @@ def random_integers( rng: "n.random.Generator", low: int, high: Optional[int] = None, - size: Union[int, Shape, Literal[None]] = None, + size: Union[int, Shape, None] = None, dtype: Type[INT] = n.uint64, ) -> "NDArray[INT]": """