modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
517 stars 313 forks source link

loading model causing issues with numpy 1.15.0 #373

Closed rosskush closed 6 years ago

rosskush commented 6 years ago

Hello everyone,

I updated some packages last week that forced me to update to the newest numpy version (1.15.0)

I am now having issues with the load function in the base flopy clase.

The following code:

import flopy
import numpy as np
import sys

print(sys.modules[np.__package__].__version__)

mf = flopy.modflow.Modflow.load('test_1.nam',version='mf2k')

returns this error

1.15.0
Traceback (most recent call last):
  File "loading_flopy.py", line 7, in <module>
    mf = flopy.modflow.Modflow.load('test_1.nam',version='mf2k')
  File "H:\Miniconda3\lib\site-packages\flopy\modflow\mf.py", line 803, in load
    ml.check(f='{}.chk'.format(ml.name), verbose=ml.verbose, level=0)
  File "H:\Miniconda3\lib\site-packages\flopy\mbase.py", line 1128, in check
    level=level - 1)
  File "H:\Miniconda3\lib\site-packages\flopy\pakbase.py", line 325, in check
    self.parent.dis.steady):  # only check storage if model is transient
  File "H:\Miniconda3\lib\site-packages\numpy\core\fromnumeric.py", line 2089, in all
    return _wrapreduction(a, np.logical_and, 'all', axis, None, out, keepdims=keepdims)
  File "H:\Miniconda3\lib\site-packages\numpy\core\fromnumeric.py", line 81, in _wrapreduction
    return reduction(axis=axis, out=out, **passkwargs)
TypeError: all() got an unexpected keyword argument 'axis'
briochh commented 6 years ago

Looks like you are getting this issue: https://github.com/modflowpy/flopy/issues/370 . Not sure if our solution is the right fix or covers up an issue deeper down, but should get you back on the road for now.

jtwhite79 commented 6 years ago

You also just pass check=False to the load method

rosskush commented 6 years ago

Awesome thanks guys, check=False worked before the latest commit, but now everything seems to be working smoothly!