Parcels version
v4
Description
When ingesting a ux.UxDataset, the loop in FieldSet.from_ugrid_conventions that handles non-U/V/W variables (src/parcels/_core/fieldset.py:223) passes the result of _select_uxinterpolator straight into Field(...):
for varname in set(ds.data_vars) - set(fields.keys()):
fields[varname] = Field(str(varname), ds[varname], grid, _select_uxinterpolator(ds[varname]))
_select_uxinterpolator only supports four (vertical, lateral) dimension pairs (zc/zf × n_face/n_node). For any other layout (e.g. an edge-registered variable on n_edge) it returns None, and that None is used as the field's interp_method. The Field constructor then fails in assert_same_function_signature with:
TypeError: None is not a callable object
The error gives no indication of which variable or dimension caused it.
Code sample
import numpy as np
import uxarray as ux
from parcels import FieldSet
from parcels._datasets.unstructured.generic import datasets
from parcels.convert import icon_to_ugrid
ds = icon_to_ugrid(datasets["icon_square_delaunay_uniform_z_coordinate"].copy(deep=True))
# Add an edge-registered tracer -> (zc, n_edge) has no supported interpolator
ds = ds.assign(
edge_tracer=ux.UxDataArray(
data=np.ones((ds.sizes["time"], ds.sizes["zc"], ds.uxgrid.n_edge)),
dims=["time", "zc", "n_edge"],
coords={"time": ds.time, "zc": ds.zc},
uxgrid=ds.uxgrid,
)
)
FieldSet.from_ugrid_conventions(ds, mesh="flat")
INFO: Using known vertical dimension mapping: 'depth_2' (interfaces) and 'depth' (centers).
INFO: Renaming vertical dimensions: {'depth_2': 'zf', 'depth': 'zc'}
Traceback (most recent call last):
File "/tmp/repro.py", line 20, in <module>
FieldSet.from_ugrid_conventions(ds, mesh="flat") # TypeError: None is not a callable object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File ".../src/parcels/_core/fieldset.py", line 224, in from_ugrid_conventions
fields[varname] = Field(str(varname), ds[varname], grid, _select_uxinterpolator(ds[varname]))
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../src/parcels/_core/field.py", line 132, in __init__
assert_same_function_signature(interp_method, ref=ZeroInterpolator, context="Interpolation")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../src/parcels/_python.py", line 30, in assert_same_function_signature
sig = inspect.signature(f)
File ".../lib/python3.14/inspect.py", line 3323, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped, ...)
File ".../lib/python3.14/inspect.py", line 3038, in from_callable
return _signature_from_callable(obj, sigcls=cls, ...)
File ".../lib/python3.14/inspect.py", line 2436, in _signature_from_callable
raise TypeError('{!r} is not a callable object'.format(obj))
TypeError: None is not a callable object
Parcels version
v4
Description
When ingesting a
ux.UxDataset, the loop inFieldSet.from_ugrid_conventionsthat handles non-U/V/W variables (src/parcels/_core/fieldset.py:223) passes the result of_select_uxinterpolatorstraight intoField(...):_select_uxinterpolatoronly supports four (vertical, lateral) dimension pairs (zc/zf × n_face/n_node). For any other layout (e.g. an edge-registered variable onn_edge) it returnsNone, and that None is used as the field'sinterp_method. TheFieldconstructor then fails inassert_same_function_signaturewith:The error gives no indication of which variable or dimension caused it.
Code sample