Skip to content

Python 3.13 incompatibility: del arg_values['frame'] #343

@jklymak

Description

@jklymak

With Python 3.13.2 and xmitgcm 0.5.2

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[3], line 3
      1 td = '../results/StraightSlopeExpStrat002Dye/input/'
      2 td = '../results/StraightSlopeUpsidedownStrat001/input/'
----> 3 with xm.open_mdsdataset(td, iters='all', endian='<', prefix='dissipation') as ds:
      4     display(ds)
      5     ds=ds.isel(j=0, j_g=0).isel(time=-4)

File ~/Dropbox/CanyonMix/.pixi/envs/default/lib/python3.13/site-packages/xmitgcm/mds_store.py:166, in open_mdsdataset(data_dir, grid_dir, iters, prefix, read_grid, delta_t, ref_date, calendar, levels, geometry, grid_vars_to_coords, swap_dims, endian, chunks, ignore_unknown_vars, default_dtype, nx, ny, nz, llc_method, extra_metadata, extra_variables)
    164 frame = inspect.currentframe()
    165 _, _, _, arg_values = inspect.getargvalues(frame)
--> 166 del arg_values['frame']
    167 function_name = inspect.getframeinfo(frame)[2]
    169 # auto-detect whether to swap dims

ValueError: cannot remove local variables from FrameLocalsProxy

Doesn't occur for Python 3.12. Looks like python removed del for whatever arg_values is.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions