Skip to content

Commit

Permalink
Dodgy implementation of all_axis_match
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrake-merani committed Dec 20, 2024
1 parent c4b451f commit 69971c8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sasdata/trend.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,16 @@ class Trend:
def __getitem__(self, item) -> SasData:
raise NotImplementedError()

# TODO: Assumes there are at least 2 items in data. Is this reasonable to assume? Should there be error handling for
# situations where this may not be the case?
def all_axis_match(self, axis: str) -> bool:
raise NotImplementedError()
reference_data = self.data[0]
for datum in self.data[1::]:
contents = datum._data_contents
axis_datum = [content for content in contents if content.name == axis][0]
if axis_datum != datum:
return False
return True

# TODO: Not sure if this should return a new trend, or just mutate the existing trend
# TODO: May be some details on the method as well.
Expand Down

0 comments on commit 69971c8

Please sign in to comment.