Loading a SWIFT .hdf5 snapshot using latest version of yt

Has anyone recently been able to load a SWIFT snapshot using yt.load? I created a conda env using python=3. I installed the latest version of yt using: conda install -c conda-forge yt I installed h5py using: conda install h5py I also installed yt_astro_analysis (to use HaloCatalog later) using: git clone https://github.com/yt-project/yt_astro_analysis; cd yt_astro_analysis; python -m pip install -e . I attempted to create a Dataset using yt.load("SWIFT_filename.hdf5") and found the following error: Traceback (most recent call last): File "/data/regan_data/Hannah_WS/Halo_mass_function_project/2023-10_11_12/FOF_Rockstar_comparison/hc_creation.py", line 62, in <module> data_ds = yt.load(dir_name) ^^^^^^^^^^^^^^^^^ File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/yt/_maintenance/deprecation.py", line 69, in inner return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/yt/loaders.py", line 144, in load return cls(fn, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/yt/frontends/swift/data_structures.py", line 36, in __init__ super().__init__( File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/yt/frontends/sph/data_structures.py", line 34, in __init__ super().__init__( File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/yt/data_objects/static_output.py", line 2123, in __init__ super().__init__( File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/yt/data_objects/static_output.py", line 293, in __init__ self._parse_parameter_file() File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/yt/frontends/swift/data_structures.py", line 100, in _parse_parameter_file runtime_parameters = self._get_info_attributes("RuntimePars") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/yt/frontends/swift/data_structures.py", line 84, in _get_info_attributes header = dict(handle[dataset].attrs) ~~~~~~^^^^^^^^^ File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "/home/hannah/anaconda3/envs/yt-10_01_2024/lib/python3.12/site-packages/h5py/_hl/group.py", line 357, in __getitem__ oid = h5o.open(self.id, self._e(name), lapl=self._lapl) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5o.pyx", line 190, in h5py.h5o.open KeyError: "Unable to open object (object 'RuntimePars' doesn't exist)" When I examine the keys from the .hdf5 file in python, I find:
'RuntimePars' is not one of the keys listed. Strangely, I was able to load the snapshot successfully on 12/12/2023 but cannot now, nor can I load any others. This is the same error found by Romeel Davé (January 2022) in https://mail.python.org/archives/list/yt-users@python.org/message/NUKRAWV7JE... Any help with would be much appreciated, thank you! - Hannah

Yeah it doesn’t work. I use this version of yt from Doug Rennehan: https://github.com/rennehan/yt-swift Cheers, romeel

Hi all, Is yt-swift a full fork of yt, or just a plugin? It it’s a fork and there is an issue with the swift frontend in the main repo we would be happy to figure out how to fix it. If it’s a frontend plugin we should remove the existing in-repo frontend and have folks load via the plugin. Either way, it’s not good for the main repo to have buggy behavior that is fixed elsewhere but it’s not broadly known. We’d also want people using the swift frontend to benefit from other, more general bugs we find. Best, John

Hi, Yes I modified yt to properly read SWIFT HDF5 files. However, I did it in an older version of yt and in a hacky way. I could definitely clone the development version of yt and try to get it working in there. Doug Rennehan, PhD https://doug.science On Sat, Jan 27, 2024 at 10:26 AM John ZuHone <jzuhone@gmail.com> wrote:

Yeah it doesn’t work. I use this version of yt from Doug Rennehan: https://github.com/rennehan/yt-swift Cheers, romeel

Hi all, Is yt-swift a full fork of yt, or just a plugin? It it’s a fork and there is an issue with the swift frontend in the main repo we would be happy to figure out how to fix it. If it’s a frontend plugin we should remove the existing in-repo frontend and have folks load via the plugin. Either way, it’s not good for the main repo to have buggy behavior that is fixed elsewhere but it’s not broadly known. We’d also want people using the swift frontend to benefit from other, more general bugs we find. Best, John

Hi, Yes I modified yt to properly read SWIFT HDF5 files. However, I did it in an older version of yt and in a hacky way. I could definitely clone the development version of yt and try to get it working in there. Doug Rennehan, PhD https://doug.science On Sat, Jan 27, 2024 at 10:26 AM John ZuHone <jzuhone@gmail.com> wrote:
participants (5)
-
Asier Lambarri Martinez
-
Doug Rennehan
-
hannah.obrennan.2021@mumail.ie
-
John ZuHone
-
Romeel Davé