Skip to content

Commit

Permalink
fix tests by making other outputs respect reset
Browse files Browse the repository at this point in the history
  • Loading branch information
joezuntz committed Dec 4, 2024
1 parent 52186b5 commit 695a9fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cosmosis/output/astropy_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ def _write_final(self, key, value, comment):
def _write_comment(self, comment):
self.table.meta["comments"] = self.table.meta.get("comments", []) + [comment]

def reset_to_chain_start(self):
self.table.remove_rows(slice(None))

Check warning on line 35 in cosmosis/output/astropy_output.py

View check run for this annotation

Codecov / codecov/patch

cosmosis/output/astropy_output.py#L35

Added line #L35 was not covered by tests

3 changes: 3 additions & 0 deletions cosmosis/output/in_memory_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@ def from_options(cls, options, resume=False):
@classmethod
def load_from_options(cls, options):
raise ValueError("No output was saved from this run")

def reset_to_chain_start(self):
self.rows = []


0 comments on commit 695a9fb

Please sign in to comment.