Issue using parcels in analysis3

I have just tried roughly following the cookbook “https://github.com/COSIMA/cosima-recipes/blob/main/03-Mains/Particle_tracking_with_Parcels.ipynb” to use parcels in the analysis 3env and there seems to be an issue between the versions of Parcels and the Version of Zarr.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File <timed exec>:6

File /g/data/xp65/public/apps/med_conda/envs/analysis3-25.10/lib/python3.11/site-packages/parcels/particleset.py:913, in ParticleSet.ParticleFile(self, *args, **kwargs)
    911 def ParticleFile(self, *args, **kwargs):
    912     """Wrapper method to initialise a :class:`parcels.particlefile.ParticleFile` object from the ParticleSet."""
--> 913     return ParticleFile(*args, particleset=self, **kwargs)

File /g/data/xp65/public/apps/med_conda/envs/analysis3-25.10/lib/python3.11/site-packages/parcels/particlefile.py:95, in ParticleFile.__init__(self, name, particleset, outputdt, chunks, create_new_zarrfile)
     80 # Create dictionary to translate datatypes and fill_values
     81 self._fill_value_map = {
     82     np.float16: np.nan,
     83     np.float32: np.nan,
   (...)
     93     np.uint64: np.iinfo(np.uint64).max,
     94 }
---> 95 if issubclass(type(name), zarr.storage.Store):
     96     # If we already got a Zarr store, we won't need any of the naming logic below.
     97     # But we need to handle incompatibility with MPI mode for now:
     98     if MPI and MPI.COMM_WORLD.Get_size() > 1:
     99         raise ValueError("Currently, MPI mode is not compatible with directly passing a Zarr store.")

AttributeError: module 'zarr.storage' has no attribute 'Store'

Going back to env analysis3-25.05 which is mentioned at the top of the notebook fixed the error. I haven’t tried any other envs between 25.05 and the current analysis 3

We upgraded to Zarr 3 in September (Move intake-esm to our fork by charles-turner-1 · Pull Request #312 · ACCESS-NRI/ACCESS-Analysis-Conda · GitHub).

I suspect this is what’s broken parcels - there were quite a lot of breaking changes with zarr 3.0.

I’ll take a look into it - hopefully we can just upgrade parcels.

As of right now, I think anything up to 25.08 should work with parcels.

1 Like

Okay, looks like zarr 3 support is still pending in Parcels, presumably this is quite a big fix (a lot changed with the zarr 2 → 3 migration).

Do you need other packages which are only available in more recent versions of the analysis3 environment, or is sticking with an earlier environment a viable (albeit hopefully temporary) strategy for you?

Thank you for looking into it!

Changing down envs is working fine for what I wanted to do :slight_smile: