From 3e7731a4a53b61f23a2a260db0c9844191d5f087 Mon Sep 17 00:00:00 2001 From: Kyle Oman Date: Sun, 1 Dec 2024 23:06:58 +0800 Subject: [PATCH] Access list of swiftsimio attributes correctly. --- swiftgalaxy/halo_catalogues.py | 2 +- tests/test_halo_catalogues.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/swiftgalaxy/halo_catalogues.py b/swiftgalaxy/halo_catalogues.py index dae9b18..62947b9 100644 --- a/swiftgalaxy/halo_catalogues.py +++ b/swiftgalaxy/halo_catalogues.py @@ -916,7 +916,7 @@ def __dir__(self) -> list[str]: out : list The list of catalogue attribute names. """ - return list(self._catalogue.group_metadata.field_names) + return list(self._catalogue.metadata.present_group_names) class Velociraptor(_HaloCatalogue): diff --git a/tests/test_halo_catalogues.py b/tests/test_halo_catalogues.py index b49e7e8..0a0b89e 100644 --- a/tests/test_halo_catalogues.py +++ b/tests/test_halo_catalogues.py @@ -884,7 +884,11 @@ def test_dir_for_tab_completion(self, soap): Just check a couple, don't need to be exhaustive. """ - for prop in ("exclusive_sphere_100kpc", "input_halos", "metadata"): + for prop in ( + "exclusive_sphere_100kpc", + "input_halos", + "spherical_overdensity_bn98", + ): assert prop in dir(soap)