Skip to content

Commit

Permalink
core: Added get_length method to labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Somerandomguy10111 committed May 28, 2024
1 parent cad70b3 commit 96bddf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions xrdpattern/core/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ def primary_wavelength(self) -> float:
def secondary_wavelength(self) -> float:
return self.artifacts.secondary_wavelength

@classmethod
def get_length(cls):
empty = cls.make_empty()
return len(empty.list_repr)


@dataclass
class Artifacts:
Expand Down
8 changes: 0 additions & 8 deletions xrdpattern/core/structure/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ def in_unit_interval(val : float) -> bool:
in_unit_interval = False
return in_unit_interval

@staticmethod
def shift_into_unit(x : float):
if x >= 0:
n = int(x)
else:
n = int(x-1)
return x - n

@classmethod
def make_void(cls) -> AtomicSite:
return cls(x=torch.nan, y=torch.nan, z=torch.nan, occupancy=0, species=Void())
Expand Down

0 comments on commit 96bddf9

Please sign in to comment.