Skip to content

Commit

Permalink
Improved get_variables utils function
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed May 28, 2024
1 parent bc4442d commit ba1d47d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/nomad_simulations/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def is_not_representative(model_system, logger: BoundLogger):

# cannot define typing with `Variables` due to circular import issue
def get_variables(
variables: Optional[List[ArchiveSection]], variable_cls: ArchiveSection
variables: List[ArchiveSection], variable_cls: ArchiveSection
) -> List[ArchiveSection]:
"""
Get the list of variables which are of type `variable_cls` and appear under `variables`.
Expand All @@ -145,8 +145,6 @@ def get_variables(
Returns:
(List[Variables]): The list of variables which are of type `variable_cls`.
"""
if variables is None:
return []
result = []
for var in variables:
if isinstance(var, variable_cls):
Expand Down

0 comments on commit ba1d47d

Please sign in to comment.