Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/101.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a bug that could cause printing lightcone summary to fail when column originally contained "redshift" column that had been dropped.
2 changes: 1 addition & 1 deletion src/opencosmo/collection/lightcone/lightcone.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __repr__(self):
else:
repr_ds = self.take(10, at="start")
table_head = "First 10 rows:\n"
if self.__hide_redshift:
if self.__hide_redshift and "redshift" in self.columns:
repr_ds = repr_ds.drop("redshift")

table_repr = repr_ds.data.__repr__()
Expand Down
7 changes: 7 additions & 0 deletions test/test_diffsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@ def test_cone_search(core_path_475, core_path_487):
ds = oc.open(core_path_487, core_path_475, synth_cores=True)
region = oc.make_cone(center, radius)
ds = ds.bound(region)


def test_repr(core_path_475, core_path_487):
ds = oc.open(core_path_487, core_path_475)
ds = ds.with_redshift_range(0, 0.1)
ds = ds.select(["ra", "dec"])
assert str(ds)
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading