NCPP / ocgis

OpenClimateGIS is a set of geoprocessing and calculation tools for CF-compliant climate datasets.
Other
70 stars 19 forks source link

added IOError exception to support netcdf4 v 1.4.4 #436

Closed huard closed 7 years ago

huard commented 7 years ago

There is one error in the test suite but I can't tell if its related or not.

======================================================================
ERROR: test_calc (ocgis.test.test_simple.test_simple.TestSimple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dhuard/src/ocgis.git/src/ocgis/test/test_simple/test_simple.py", line 590, in test_calc
    ret = self.get_ret(kwds={'calc': calc, 'calc_grouping': group, 'aggregate': True, 'calc_raw': calc_raw})
  File "/home/dhuard/src/ocgis.git/src/ocgis/test/test_simple/test_simple.py", line 91, in get_ret
    ret = OcgInterpreter(ops).execute()
  File "/home/dhuard/src/ocgis.git/src/ocgis/api/interpreter.py", line 125, in execute
    ret = conv.write()
  File "/home/dhuard/src/ocgis.git/src/ocgis/conv/numpy_.py", line 14, in write
    for coll in self:
  File "/home/dhuard/src/ocgis.git/src/ocgis/conv/numpy_.py", line 9, in __iter__
    for coll in self.colls:
  File "/home/dhuard/src/ocgis.git/src/ocgis/api/subset.py", line 75, in __iter__
    for coll in self._iter_collections_():
  File "/home/dhuard/src/ocgis.git/src/ocgis/api/subset.py", line 139, in _iter_collections_
    coll = self.cengine.execute(coll, file_only=self.ops.file_only, tgds=tgds)
  File "/home/dhuard/src/ocgis.git/src/ocgis/calc/engine.py", line 138, in execute
    out_vc = function.execute()
  File "/home/dhuard/src/ocgis.git/src/ocgis/calc/base.py", line 154, in execute
    self._execute_()
  File "/home/dhuard/src/ocgis.git/src/ocgis/calc/base.py", line 627, in _execute_
    fill = self._get_temporal_agg_fill_(value, shp_fill=shp_fill)
  File "/home/dhuard/src/ocgis.git/src/ocgis/calc/base.py", line 433, in _get_temporal_agg_fill_
    fill[ir, it, il, :, :] = self.aggregate_spatial(cc, weights)
  File "/home/dhuard/src/ocgis.git/src/ocgis/calc/base.py", line 119, in aggregate_spatial
    ret = np.ma.average(values, weights=weights)
  File "/home/dhuard/.miniconda3/envs/OPG2/lib/python2.7/site-packages/numpy/ma/extras.py", line 536, in average
    "Axis must be specified when shapes of a and weights "
TypeError: Axis must be specified when shapes of a and weights differ.
bekozi commented 7 years ago

This has already been fixed in the next branch (https://github.com/NCPP/ocgis/blob/next/src/ocgis/api/request/driver/nc.py#L52). I'd advise developing against that branch. Nice catch though! The exception does make more sense as an IOError. Will swapping branches at this point cause you any problems? Thanks for the PR regardless.

The failure is isolated to master but the next build is passing: https://travis-ci.org/NCPP/ocgis/builds/183322096. The master should pass, so let I'll do some digging into what change in next fixed this issue...

huard commented 7 years ago

Ok, good to know, and no problem at all.

Le mar. 24 janv. 2017 16:11, Ben Koziol notifications@github.com a écrit :

This has already been fixed in the next branch ( https://github.com/NCPP/ocgis/blob/next/src/ocgis/api/request/driver/nc.py#L52). I'd advise developing against that branch. Nice catch though! The exception does make more sense as an IOError. Will swapping branches at this point cause you any problems? Thanks for the PR regardless.

The failure is isolated to master but the next build is passing: https://travis-ci.org/NCPP/ocgis/builds/183322096. The master should pass, so let I'll do some digging into what change in next fixed this issue...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NCPP/ocgis/pull/436#issuecomment-274939909, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE9Q815xOUNJxnklKxK8sJQ6djWjg1tks5rVmkJgaJpZM4LstUJ .

bekozi commented 7 years ago

Going to merge to ensure you get contribution creds...

huard commented 7 years ago

Thanks, but that won't be an issue, ever.

On Mon, Jan 30, 2017 at 12:24 PM Ben Koziol notifications@github.com wrote:

Going to merge to ensure you get contribution creds...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NCPP/ocgis/pull/436#issuecomment-276127121, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE9Q9sWmmpo9h4kpuJMrLtbniYUKPvLks5rXhy3gaJpZM4LstUJ .

bekozi commented 7 years ago

FYI, this is the commit (https://github.com/NCPP/ocgis/commit/857a0c99e5bd06758986f5ad76d32499f7bb644c) that fixed the shape issue.