Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SequenceInterval init refactor #175

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/aligned_textgrid/sequences/tiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,19 @@ def __init__(
else:
self.entry_list = tier
self.name = entry_class.__name__
self.__set_classes(entry_class)
self.__build_sequence_list()
self.__set_precedence()

def __set_classes(
self,
entry_class
):
self.entry_class = entry_class
self.superset_class = self.entry_class.superset_class
self.subset_class = self.entry_class.subset_class

def __build_sequence_list(self):
entry_order = np.argsort([x.start for x in self.entry_list])
self.entry_list = [self.entry_list[idx] for idx in entry_order]
self.sequence_list = []
Expand All @@ -61,7 +71,6 @@ def __init__(
this_seq.set_superset_class(self.superset_class)
this_seq.set_subset_class(self.subset_class)
self.sequence_list += [this_seq]
self.__set_precedence()

def __set_precedence(self):
for idx,seq in enumerate(self.sequence_list):
Expand Down
Loading