Skip to content

Commit 1974e8a

Browse files
committed
add a preprocessor that casts everything to str
1 parent a9cebee commit 1974e8a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cf_xarray/units.py

+5
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ def repl(m):
7777
],
7878
force_ndarray_like=True,
7979
)
80+
# ----- end block copied from metpy
81+
82+
# need to insert to make sure this is the first preprocessor
83+
units.preprocessors.insert(0, str)
8084

85+
# -----
8186
units.define("percent = 0.01 = %")
8287

8388
# Define commonly encountered units (both CF and non-CF) not defined by pint

0 commit comments

Comments
 (0)