You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if fixing this issue is actually possible.
I attempted to use the update_metadata script to remove an invalid global attribute from some netCDF files. Specifically, some files had a blank string for global: history, which results in all sorts of weird errors.
I wasn't able to remove the invalid attribute with update metadata, and got this traceback:
2018-12-20 16:17:39 INFO: Processing file: /storage/data/climate/downscale/BCCAQ2/bccaqv2_with_metadata/tasmin_day_BCCAQv2+ANUSPLIN300_BNU-ESM_historical+rcp45_r1i1p1_19500101-21001231.nc
2018-12-20 16:17:39 INFO: Global attributes:
Traceback (most recent call last):
File "climate-explorer-data-prep/scripts/update_metadata", line 31, in <module>
main(args)
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/dp/update_metadata.py", line 247, in main
process_updates(dataset, updates)
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/dp/update_metadata.py", line 227, in process_updates
apply_attribute_updates(dataset, target, update)
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/dp/update_metadata.py", line 202, in apply_attribute_updates
apply_attribute_updates(dataset, target, element)
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/dp/update_metadata.py", line 196, in apply_attribute_updates
modify_attribute(dataset, target, *attr_updates)
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/dp/update_metadata.py", line 181, in modify_attribute
return delete_attribute(target, name)
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/dp/update_metadata.py", line 145, in delete_attribute
if hasattr(target, name):
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/nchelpers/decorators.py", line 26, in wrapper
res = func(*args, **kwargs)
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/nchelpers/__init__.py", line 353, in __getattribute__
is_indirected, indirected_property = _indirection_info(value)
File "/local_temp/lzeman/climate-explorer-data-prep/venv/lib64/python3.4/site-packages/nchelpers/__init__.py", line 148, in _indirection_info
if isinstance(value, six.string_types) and value[0] == '@':
IndexError: string index out of range
As a workaround, I first set the attribute to a valid string with update_metadata. Then I ran update_metadata a second time to delete the attribute.
Not a very high priority, since there is a workaround.
The text was updated successfully, but these errors were encountered:
I'm not sure if fixing this issue is actually possible.
I attempted to use the update_metadata script to remove an invalid global attribute from some netCDF files. Specifically, some files had a blank string for
global: history
, which results in all sorts of weird errors.I wasn't able to remove the invalid attribute with update metadata, and got this traceback:
As a workaround, I first set the attribute to a valid string with update_metadata. Then I ran update_metadata a second time to delete the attribute.
Not a very high priority, since there is a workaround.
The text was updated successfully, but these errors were encountered: