From de12d9ff032672e1ed14084f349ed84a712644d5 Mon Sep 17 00:00:00 2001 From: ndaelman Date: Tue, 12 Nov 2024 12:49:49 +0100 Subject: [PATCH] Apply ruff --- .../schema_packages/physical_property.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/nomad_simulations/schema_packages/physical_property.py b/src/nomad_simulations/schema_packages/physical_property.py index 029467dd..c1f8968a 100644 --- a/src/nomad_simulations/schema_packages/physical_property.py +++ b/src/nomad_simulations/schema_packages/physical_property.py @@ -186,9 +186,11 @@ def variables_shape(self) -> list[int]: (list): The shape of the variables over which the physical property varies. """ if self.variables: - return [v.get_n_points(logger) for v in self.variables] # ! TODO: support any variable shape, not just vectors + return [ + v.get_n_points(logger) for v in self.variables + ] # ! TODO: support any variable shape, not just vectors return [] - + @property def rank(self) -> list[int]: """ @@ -199,7 +201,7 @@ def rank(self) -> list[int]: Returns: (list): The rank of the physical property. """ - if (base_value := self.m_def.all_quantities.get('_base_value')): + if base_value := self.m_def.all_quantities.get('_base_value'): if isinstance(base_value.shape, list): return base_value.shape else: @@ -272,7 +274,9 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: else: value = None except AttributeError: - raise AttributeError('The `value` or `_base_value` is not defined at the _quantity_ level.') + raise AttributeError( + 'The `value` or `_base_value` is not defined at the _quantity_ level.' + ) self.m_def.quantities.append( Quantity(