diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74056e63..145fbad3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ ci: repos: - repo: https://github.com/psf/black - rev: "24.4.2" + rev: "24.8.0" hooks: - id: black-jupyter @@ -51,13 +51,13 @@ repos: args: [--prose-wrap=always] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.0" + rev: "v0.5.6" hooks: - id: ruff args: ["--fix", "--show-fixes"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: "v1.10.1" + rev: "v1.11.1" hooks: - id: mypy files: src diff --git a/src/caustics/models/utils.py b/src/caustics/models/utils.py index 27060b75..6626e691 100644 --- a/src/caustics/models/utils.py +++ b/src/caustics/models/utils.py @@ -150,7 +150,7 @@ def _init_kwargs_field_check(cls, v, info: ValidationInfo): field_name = info.field_name field = cls.model_fields[field_name] anno_args = typing.get_args(field.annotation) - if len(anno_args) == 2 and anno_args[1] == type(None): + if len(anno_args) == 2 and anno_args[1] is type(None): # This means that the anno is optional expected_type = next( filter(lambda x: x is not None, typing.get_args(field.annotation))