Skip to content

Commit

Permalink
docstring note; test tweak for code cov
Browse files Browse the repository at this point in the history
  • Loading branch information
dougbrn committed Jan 9, 2024
1 parent 7bd3260 commit 54a1392
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/tape/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,13 @@ def save_ensemble(self, path=".", dirname="ensemble", additional_frames=True, **
Returns
----------
None
Note
----
If the object frame is empty, which is often the case when an Ensemble
is constructed using only source files/dictionaries, then an object
subdirectory will not be created. `Ensemble.from_ensemble` will know
how to work with the directory in both cases.
"""

self._lazy_sync_tables("all")
Expand Down
4 changes: 2 additions & 2 deletions tests/tape_tests/test_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def test_read_source_dict(dask_client):
assert 8002 in obj_table.index


@pytest.mark.parametrize("add_frames", [True, False, ["max"], "42", ["max", "min"]])
@pytest.mark.parametrize("add_frames", [True, False, ["max"], 42, ["max", "min"]])
@pytest.mark.parametrize("obj_nocols", [True, False])
def test_save_and_load_ensemble(dask_client, tmp_path, add_frames, obj_nocols):
# Setup a temporary directory for files
Expand Down Expand Up @@ -521,7 +521,7 @@ def test_save_and_load_ensemble(dask_client, tmp_path, add_frames, obj_nocols):
ens.batch(np.max, "flux", label="max")

# Save the Ensemble
if add_frames == "42" or add_frames == ["max", "min"]:
if add_frames == 42 or add_frames == ["max", "min"]:
with pytest.raises(ValueError):
ens.save_ensemble(save_path, dirname="ensemble", additional_frames=add_frames)
return
Expand Down

0 comments on commit 54a1392

Please sign in to comment.