Reading-eScience-Centre / pycovjson

Create CovJSON files from common scientific data formats
BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

Beginning attempt to address ISSUE-20, unable to access 'axis'. #21

Closed lewismc closed 7 years ago

lewismc commented 8 years ago

This issue is a beginning attempt at addressing #20 . I must admit, having never used xarray for reading the netCDF datasets I am unable to obtain a dataset coordinate axis! Hence I am currently running in to the following issue

warning: Debugger speedups using cython not found. Run '"/Users/lmcgibbn/miniconda3/bin/python3.5" "/Users/lmcgibbn/.p2/pool/plugins/org.python.pydev_5.2.0.201608171824/pysrc/setup_cython.py" build_ext --inplace' to build.
pydev debugger: starting (pid: 10708)
Error occured: Variable 'None' has no axis attribute
Error in axes_dict
Traceback (most recent call last):
  File "/Users/lmcgibbn/.p2/pool/plugins/org.python.pydev_5.2.0.201608171824/pysrc/pydevd.py", line 1531, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Users/lmcgibbn/.p2/pool/plugins/org.python.pydev_5.2.0.201608171824/pysrc/pydevd.py", line 938, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Users/lmcgibbn/.p2/pool/plugins/org.python.pydev_5.2.0.201608171824/pysrc/_pydev_imps/_pydev_execfile.py", line 25, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/usr/local/pycovjson/pycovjson/cli/convert.py", line 69, in <module>
    main()
  File "/usr/local/pycovjson/pycovjson/cli/convert.py", line 66, in main
    tiled=tiled, tile_shape=tile_shape).write()
  File "/Users/lmcgibbn/miniconda3/lib/python3.5/site-packages/pycovjson-0.3.8-py3.5.egg/pycovjson/write.py", line 51, in write
    coverage = self._construct_coverage()
  File "/Users/lmcgibbn/miniconda3/lib/python3.5/site-packages/pycovjson-0.3.8-py3.5.egg/pycovjson/write.py", line 64, in _construct_coverage
    coverage = Coverage(self._construct_domain(), self._construct_range(
  File "/Users/lmcgibbn/miniconda3/lib/python3.5/site-packages/pycovjson-0.3.8-py3.5.egg/pycovjson/write.py", line 123, in _construct_range
    axis_names = list(map(str.lower, list(self.Reader.get_axis(variable))))
TypeError: 'NoneType' object is not iterable
lewismc commented 8 years ago

The above can be replicated using the file I posted at #20

lewismc commented 7 years ago

I have moved on from this issue now so I am going close off for the time being.