Skip to content

Commit

Permalink
fixing unit test for suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
briandrawert committed Aug 20, 2024
1 parent 252d895 commit 30267b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gillespy2/core/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def build_from_solver_results(cls, solver, live_output_options):
return results
raise ValueError("number_of_trajectories must be non-negative and non-zero")

def to_csv(self, path=".", nametag=None, stamp=None, postfix=".odf", verbose=False):
def to_csv(self, path=".", nametag=None, stamp=None, suffix=".odf", verbose=False):
"""
Outputs the Results to one or more .csv files in a new directory.
Expand Down Expand Up @@ -311,7 +311,7 @@ def to_csv(self, path=".", nametag=None, stamp=None, postfix=".odf", verbose=Fal
else:
identifier = nametag

directory = os.path.join(path, f"{identifier}-{stamp}{postfix}")
directory = os.path.join(path, f"{identifier}-{stamp}{suffix}")
if verbose:
print(f"Writing data to: {directory}")
# multiple trajectories
Expand Down
4 changes: 2 additions & 2 deletions test/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def test_to_csv_single_result_directory_exists(self):

with tempfile.TemporaryDirectory() as tempdir:
result.to_csv(stamp = test_stamp, nametag = test_nametag, path=tempdir)
test_path = tempdir+"/"+test_nametag+test_stamp
assert os.path.isdir(test_path)
test_path = tempdir+"/"+test_nametag+test_stamp+".odf"
self.assertTrue(os.path.isdir(test_path))

def test_to_csv_single_result_file_exists(self):
test_data = {'time':[0]}
Expand Down

0 comments on commit 30267b2

Please sign in to comment.