Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying again #14

Closed
AndyHoggANU opened this issue Aug 9, 2019 · 2 comments
Closed

Trying again #14

AndyHoggANU opened this issue Aug 9, 2019 · 2 comments

Comments

@AndyHoggANU
Copy link
Collaborator

Hi @aidanheerdegen - I am belatedly getting back to this data publishing pipeline.
First attempt revealed some errors like this:

Deleting following variables with a time dimension from ocean_grid.nc: ['time', 'drag_coeff']
Traceback (most recent call last):
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/bin/splitvar", line 10, in <module>
    sys.exit(main_argv())
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/splitvar/cli.py", line 116, in main_argv
    main_parse_args(sys.argv[1:])
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/splitvar/cli.py", line 110, in main_parse_args
    return main(parse_args(args))
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/splitvar/cli.py", line 204, in main
    ds = xarray.decode_cf(ds)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/xarray/conventions.py", line 479, in decode_cf
    decode_coords, drop_variables=drop_variables, use_cftime=use_cftime)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/xarray/conventions.py", line 401, in decode_cf_variables
    stack_char_dim=stack_char_dim, use_cftime=use_cftime)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/xarray/conventions.py", line 306, in decode_cf_variable
    var = coder.decode(var, name=name)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/xarray/coding/times.py", line 419, in decode
    self.use_cftime)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/xarray/coding/times.py", line 90, in _decode_cf_datetime_dtype
    last_item(values) or [0]])
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.07/lib/python3.6/site-packages/xarray/core/formatting.py", line 99, in last_item
    return np.ravel(array[indexer]).tolist()
AttributeError: 'Array' object has no attribute 'tolist'

I am testing out whether this is due to the 19.07 update and will report back.

@AndyHoggANU
Copy link
Collaborator Author

Just to confirm - this is fixed by reverting back to 19.04, but it would be good if the unstable branch could be updated so that it works there too.

@aidanheerdegen
Copy link
Owner

This is a bug in xarray

pydata/xarray#3215

Work-around is to set this environment variable:

NUMPY_EXPERIMENTAL_ARRAY_FUNCTION=0

I have submitted a PR with a code fix pydata/xarray#3220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants