Skip to content

Commit

Permalink
get_num_nonequivalent_atoms -> num_nonequivalent_atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
wolearyc committed Aug 31, 2024
1 parent 4a4b030 commit 77e4ca7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ramannoodle/structure/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def positions(self) -> NDArray[np.float64]:
"""
return self._positions.copy()

def get_num_nonequivalent_atoms(self) -> int:
@property
def num_nonequivalent_atoms(self) -> int:
"""Get number of nonequivalent atoms."""
assert self._symmetry_dict is not None
return len(set(self._symmetry_dict["equivalent_atoms"]))
Expand Down
2 changes: 1 addition & 1 deletion test/tests/test_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_ref_structure(
"""Test StructuralSymmetry (normal)."""
# Equivalent atoms test
ref_structure = outcar_ref_structure_fixture
assert ref_structure.get_num_nonequivalent_atoms() == known_nonequivalent_atoms
assert ref_structure.num_nonequivalent_atoms == known_nonequivalent_atoms

# Equivalent displacement test
displacement = ref_structure.positions * 0 # pylint: disable=protected-access
Expand Down

0 comments on commit 77e4ca7

Please sign in to comment.