Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
apply review comments

Co-authored-by: Jacob Wilkins <[email protected]>
  • Loading branch information
harveydevereux and oerc0122 authored Nov 4, 2024
1 parent dc017d5 commit 24ffd26
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions janus_core/processing/observables.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ def _set_components(self, components: list[str]):
ValueError
If any component is invalid.
"""
for component in components:
for component in self.allowed_components.keys() - components.keys():
if component not in self.allowed_components:
component_names = list(self._components.keys())
raise ValueError(
f"'{component}' invalid, must be '{', '.join(component_names)}'"
)
Expand Down Expand Up @@ -267,10 +266,7 @@ def __init__(

Observable.__init__(self, len(components))

if atoms_slice:
self.atoms_slice = atoms_slice
else:
self.atoms_slice = slice(0, None, 1)
self.atoms_slice = atoms_slice if atoms_slice else slice(0, None, 1)

def __call__(self, atoms: Atoms) -> list[float]:
"""
Expand Down

0 comments on commit 24ffd26

Please sign in to comment.