Skip to content

Commit

Permalink
Convert floats and ints to match the nc.Variable datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
pnuu committed Dec 14, 2023
1 parent 7b56afa commit d0993fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions satpy/tests/reader_tests/test_seadas_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,12 @@ def _add_variable_to_netcdf_file(nc, var_name, var_info):
fill_value=var_info.get("fill_value"))
v[:] = var_info["data"]
for attr_key, attr_val in var_info["attrs"].items():
if isinstance(attr_val, (int, float)):
attr_val = v.dtype.type(attr_val)
setattr(v, attr_key, attr_val)



class TestSEADAS:
"""Test the SEADAS L2 file reader."""

Expand Down

0 comments on commit d0993fd

Please sign in to comment.