Skip to content

Commit

Permalink
Apply ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaelman committed Nov 12, 2024
1 parent 8e80cf4 commit de12d9f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/nomad_simulations/schema_packages/physical_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
"""
Expand All @@ -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:
Expand Down Expand Up @@ -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(
Expand Down

1 comment on commit de12d9f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/nomad_simulations
   __init__.py4250%3–4
   _version.py11282%5–6
src/nomad_simulations/schema_packages
   __init__.py15287%39–41
   atoms_state.py1902189%13–15, 201–204, 228, 283–284, 352–353, 355, 537, 549–550, 611–615, 630–634, 641
   basis_set.py2402888%8–9, 122–133, 172–185, 208, 391–395, 417–418, 462–465, 584, 615, 617
   general.py89891%4–7, 121, 185, 295–296, 306
   model_method.py2697871%10–12, 171–174, 177–184, 276–277, 297, 318–339, 355–381, 384–401, 587, 780, 791, 833–840, 878, 897, 977, 1034, 1109, 1223
   model_system.py3483789%45–51, 235, 254, 258, 261, 264, 290, 376–377, 454–455, 472–473, 686–689, 736–743, 917–918, 1140–1144, 1150–1151, 1159–1160, 1165, 1188
   numerical_settings.py2596176%12–14, 217, 219–220, 223–226, 230–231, 238–241, 250–253, 257–260, 262–265, 270–273, 279–282, 469–496, 571, 606–609, 633, 636, 681, 683–686, 690, 694, 741, 745–766, 821–822, 889
   outputs.py1201092%9–10, 252–255, 295–298, 323, 325, 362, 381
   physical_property.py981585%20–22, 208, 246–249, 261, 273, 276–277, 313–315
   variables.py861286%8–10, 98, 121, 145, 167, 189, 211, 233, 256, 276
src/nomad_simulations/schema_packages/properties
   band_gap.py501080%8–10, 131–143
   band_structure.py1225852%9–11, 143–158, 177–198, 231–264, 273–285, 291–307, 320–321, 324, 371–372, 377
   energies.py41978%7–9, 36, 57, 79, 100, 116, 131
   fermi_surface.py16475%7–9, 41
   forces.py22673%7–9, 36, 56, 79
   greens_function.py993565%7–9, 174–179, 201–202, 205, 227–228, 231, 253–254, 257, 355, 357–359, 369, 371–379, 384–398
   hopping_matrix.py27581%7–9, 57, 92
   permittivity.py47883%7–9, 97–105
   spectral_profile.py25915142%9–11, 49, 56–59, 94–97, 102, 198–299, 355–367, 392–395, 415, 420–423, 427–462, 465–501, 523, 568–571, 587–588, 593–599
   thermodynamics.py732467%7–9, 35, 56, 72, 81, 90, 101, 110, 137, 147, 157, 170–171, 174, 190, 218–219, 222, 238, 259–260, 263
src/nomad_simulations/schema_packages/utils
   utils.py791680%8–11, 65–74, 83–84, 89, 92, 169–170
TOTAL257560277% 

Tests Skipped Failures Errors Time
402 0 💤 72 ❌ 0 🔥 9.066s ⏱️

Please sign in to comment.