[FLASH-USERS] Loading FLASH2.5 files problem with yt

Casanova, Jordi jcasanova at regis.edu
Wed Aug 14 20:49:58 EDT 2024


Hi John,

Thank you for your response. I don’t need particle data in these files, so I am guessing that ignoring them might be a good solution. Do you have any guess on how to do that?

Best regards,
Jordi

From: John Zuhone <jzuhone at gmail.com>
Date: Wednesday, 14 August 2024, 18:26
To: Casanova, Jordi <jcasanova at regis.edu>
Cc: flash-users at flash.rochester.edu <flash-users at flash.rochester.edu>
Subject: Re: [FLASH-USERS] Loading FLASH2.5 files problem with yt
Another option is that if you do not care at all about the particle data in this or other files we could find a way to ignore them.


On Aug 14, 2024, at 1:23 PM, John Zuhone <jzuhone at gmail.com> wrote:

Hi Jordi,

The problem here is that the particle structure in the HDF5 file for versions of FLASH less than 3 is very different than versions >= 3.

The structure in FLASH3 and later is much simpler, it’s a simple 2D real array of number of particles x number of particle attributes. But in FLASH2 it’s a compound data structure. We never got around to supporting that in yt.

You could file an issue on the yt Github page with this error message and with the description I gave here so we don’t forget, not sure when we’d get a chance to address it. If we did address it, we’d need a copy of the file so that we could formulate the fix and test it.

Alternatively, we could reconstruct a FLASH3-like particle structure for you, but if you have a lot of files this may not be ideal.

Best,

John ZuHone


On Aug 14, 2024, at 1:17 PM, Casanova, Jordi <jcasanova at regis.edu> wrote:


Hello flash users!

I am using yt to analyze simulations performed with the latest version of FLASH4.7, and everything works fine. However, I would like to check out some old files performed with FLASH2.5. I am not able to load these FLASH2.5 files with yt. Below I am attaching the traceback with the error. Does anyone know what the problem might be? Thank you!


yt : [INFO     ] 2024-08-14 11:03:29,105 Particle file found: test_hdf5_chk_2396


    ---------------------------------------------------------------------------

    TypeError                                 Traceback (most recent call last)

    Cell In[1], line 2
          1 import yt
    ----> 2 ds=yt.load("/Users/novita/Desktop/test_hdf5_chk_2396")


    File ~/Library/Python/3.12/lib/python/site-packages/yt/_maintenance/deprecation.py:69<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdeprecation.py%3a69&c=E,1,-Z3illELaXQsiVLZDYTF6eFoa3B-L9NyvEP8nHMDhZ_5LeErt7dMUq9e2zUmdKjuFaj0XI7WmY7cum3HZw0F9B3jpOvcFwmwJSP2umH01R45GnyD&typo=1&ancr_add=1>, in future_positional_only.<locals>.outer.<locals>.inner(*args, **kwargs)
         60     value = kwargs[name]
         61     issue_deprecation_warning(
         62         f"Using the {name!r} argument as keyword (on position {no}) "
         63         "is deprecated. "
       (...)
         67         **depr_kwargs,
         68     )
    ---> 69 return func(*args, **kwargs)


    File ~/Library/Python/3.12/lib/python/site-packages/yt/loaders.py:144<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2floaders.py%3a144&c=E,1,rZ00vrsk9zhqLaP5AYsakqkhNPYNof6PazciT12owMNo--I47XXBAm2UCEyyFjdZpViLuBxMwvjozDQybzKGr4YphL_BpasuaBYbk6BsvxZExZdkjprm&typo=1&ancr_add=1>, in load(fn, hint, *args, **kwargs)
        136     if missing := cls._missing_load_requirements():
        137         warnings.warn(
        138             f"This dataset appears to be of type {cls.__name__}, "
        139             "but the following requirements are currently missing: "
       (...)
        142             stacklevel=3,
        143         )
    --> 144     return cls(fn, *args, **kwargs)
        146 if len(candidates) > 1:
        147     raise YTAmbiguousDataType(_input_fn, candidates)


    File ~/Library/Python/3.12/lib/python/site-packages/yt/frontends/flash/data_structures.py:206<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fdata_structures.py%3a206&c=E,1,D00Ro1fV0bYQ58DvnC8nKGC5-TLDWU_dzuGsAdsbJAhs5Vy-nwNh9k9AUebww8i1GZH-Z4jsQOkIYTMHZ_9c7CecxeUxVewsU57nlx_bUI0c0o74wwWOpT95GfhI&typo=1&ancr_add=1>, in FLASHDataset.__init__(self, filename, dataset_type, storage_filename, particle_filename, units_override, unit_system, default_species_fields)
        204 # Check if the particle file has the same time
        205 if self._particle_handle != self._handle:
    --> 206     part_time = self._particle_handle.handle.get("real scalars")[0][1]
        207     plot_time = self._handle.handle.get("real scalars")[0][1]
        208     if not np.isclose(part_time, plot_time):


    TypeError: 'NoneType' object is not subscriptable
_______________________________________________
flash-users mailing list
flash-users at flash.rochester.edu<mailto:flash-users at flash.rochester.edu>

For list info, including unsubscribe:
https://flash.rochester.edu/mailman/listinfo/flash-users<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fflash.rochester.edu%2fmailman%2flistinfo%2fflash-users&c=E,1,rbGHlX8bR5Y7pi6Xrll_DCv0m7IOMhT7lslE_mSXoehtS7C2PV6VWnAbK1ToFzJGSDq8ml6o2Rt9GRSsrTlfF_5dcX9B4Tlm7y86W9ET&typo=1>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20240815/01efa123/attachment-0001.htm>


More information about the flash-users mailing list