emma_kth
emma_kth

Reputation: 25

Error reading CHD package as a flopy.utils.util_list.MfList

I am trying to load in a CHD package for a usg model and I am getting an error stating I am passing a float instead of an int, when I use the to_array method. Does anyone know how to solve this? Here is my code:

'''

mu = flopy.modflow.Modflow.load(os.path.join(model_ws,'%s.nam'%(model_name)), 
version=version, exe_name =exe_name,
                            check=False, verbose='True',forgive=True)

chd = mu.get_package('chd')
help(chd)

mu.chd.stress_period_data.to_array()                    

Here is the error I am getting: mu.chd.stress_period_data.to_array()
Traceback (most recent call last):

File "<ipython-input-124-80adf406c094>", line 1, in <module>
mu.chd.stress_period_data.to_array()

File "C:\Users\emma\AppData\Local\Continuum\anaconda3\lib\site- 
packages\flopy\utils\util_list.py", line 1066, in to_array
arr = np.zeros((self._model.nlay * self._model.ncpl,))

TypeError: 'float' object cannot be interpreted as an integer

''' Any advice would be much appreciated :)

Cheers, Emma

Upvotes: 0

Views: 67

Answers (0)

Related Questions