Skip to content

Commit

Permalink
feat: add set_tag method to Template
Browse files Browse the repository at this point in the history
  • Loading branch information
msto committed Oct 17, 2023
1 parent d2d50c4 commit cd3e79b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions fgpyo/sam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,21 @@ def all_recs(self) -> Iterator[AlignedSegment]:
for rec in recs:
yield rec

def set_tag(
self,
tag: str,
value: Union[str, int, float],
) -> None:
"""Add a tag to all records associated with the template.
Args:
tag: The name of the tag.
value: The value of the tag.
"""

for rec in self.all_recs():
rec.set_tag(tag, value)


class TemplateIterator(Iterator[Template]):
"""
Expand Down

0 comments on commit cd3e79b

Please sign in to comment.