diff --git a/nomad/app/v1/routers/datasets.py b/nomad/app/v1/routers/datasets.py index bedecbeb716c638f5b9561b765ded6a1a11436e8..92cda30c332451ee2936f5ff6b36ec4fe9d9813c 100644 --- a/nomad/app/v1/routers/datasets.py +++ b/nomad/app/v1/routers/datasets.py @@ -512,7 +512,7 @@ async def assign_doi( if dataset.doi is not None: doi = DOI.objects(doi=dataset.doi).first() - if type(doi) == DOI and not (doi.state == 'findable'): + if type(doi) is DOI and not (doi.state == 'findable'): _delete_dataset(user=user, dataset_id=dataset_id, dataset=dataset) raise HTTPException( status_code=_existing_dataset_with_findable_state[0], diff --git a/nomad/metainfo/metainfo.py b/nomad/metainfo/metainfo.py index d49896d6ff5b9ef3541d476e07b87cd63ff5db4c..fb5ee617d4ed1afb3b8a6e6361d607a93b90b17c 100644 --- a/nomad/metainfo/metainfo.py +++ b/nomad/metainfo/metainfo.py @@ -3488,12 +3488,12 @@ class PrimitiveQuantity(Quantity): f'The value {value} for quantity {self} has no shape {self.shape}' ) - if any(v is not None and type(v) != self._type for v in value): + if any(v is not None and type(v) is not self._type for v in value): raise TypeError( f'The value {value} with type {type(value)} for quantity {self} is not of type {self.type}' ) - elif type(value) != self._type: + elif type(value) is not self._type: raise TypeError( f'The value {value} with type {type(value)} for quantity {self} is not of type {self.type}' ) diff --git a/nomad/mkdocs.py b/nomad/mkdocs.py index c344e5ca148005a4987fb15d47a447272aabf7c3..72aa201b9ffd48ed61bd50b5de5f7b57bffafd60 100644 --- a/nomad/mkdocs.py +++ b/nomad/mkdocs.py @@ -93,7 +93,7 @@ def get_field_type_info(field: ModelField) -> Tuple[str, Set[Any]]: # identification of 'Annotated' could be done with # `get_origin(a) is Annotated``, but this is the cleanest # solution with Python 3.7. - elif type(cls) == _AnnotatedAlias: + elif type(cls) is _AnnotatedAlias: skip_parent = True else: name = str(cls).split('[', 1)[0].rsplit('.')[-1] diff --git a/nomad/normalizing/optimade.py b/nomad/normalizing/optimade.py index c8f4ea6bc19c826e8a2dd4abfc675fcdeb740c9c..46e4a5bbeb5c22d0a49ab38d135d8f23a5cab70c 100644 --- a/nomad/normalizing/optimade.py +++ b/nomad/normalizing/optimade.py @@ -114,7 +114,7 @@ class OptimadeNormalizer(SystemBasedNormalizer): value = source.m_get(quantity_def) if value is None: return - if type(value) == np.ndarray and not numpy: + if type(value) is np.ndarray and not numpy: return value.tolist() if isinstance(value, list) and numpy: return np.array(value) diff --git a/nomad/normalizing/topology.py b/nomad/normalizing/topology.py index a2a7bf774c1d1cb7e7d699ab2f1c159bfce47dfd..4f223487d5875bee561d115f4b9b3657d0155546 100644 --- a/nomad/normalizing/topology.py +++ b/nomad/normalizing/topology.py @@ -635,7 +635,7 @@ class TopologyNormalizer: spg_number = symm.get_space_group_number() atom_species = conv_system.get_atomic_numbers() - if type(conv_system) == Atoms or conv_system.wyckoff_letters is None: + if type(conv_system) is Atoms or conv_system.wyckoff_letters is None: wyckoffs = symm.get_wyckoff_letters_conventional() else: wyckoffs = conv_system.wyckoff_letters diff --git a/requirements-dev.txt b/requirements-dev.txt index a941bfc5b0023aaee84ec0adde2cda956c7ea415..89ca762799cadf5d792e5e020e3c5f87d02502a3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -215,7 +215,7 @@ rfc3987==1.3.8 # via jsonschema, -r requirements.txt rope==0.21.0 # via nomad-lab (pyproject.toml) ruamel-yaml==0.18.6 # via jupyter-telemetry, oauthenticator, pymatgen, -r requirements.txt, nomad-lab (pyproject.toml) ruamel-yaml-clib==0.2.8 # via ruamel-yaml, -r requirements.txt -ruff==0.5.0 # via nomad-lab (pyproject.toml) +ruff==0.5.3 # via nomad-lab (pyproject.toml) runstats==2.0.0 # via -r requirements.txt, nomad-lab (pyproject.toml) scikit-learn==1.5.1 # via matid, -r requirements.txt, nomad-lab (pyproject.toml) scipy==1.13.1 # via ase, griddataformats, matid, mdanalysis, pymatgen, scikit-learn, -r requirements.txt, nomad-lab (pyproject.toml)