diff --git a/src/tape/ensemble.py b/src/tape/ensemble.py index 6d286f66..d1d23f36 100644 --- a/src/tape/ensemble.py +++ b/src/tape/ensemble.py @@ -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") diff --git a/tests/tape_tests/test_ensemble.py b/tests/tape_tests/test_ensemble.py index 7f7407b9..592eada4 100644 --- a/tests/tape_tests/test_ensemble.py +++ b/tests/tape_tests/test_ensemble.py @@ -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 @@ -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