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

Numpy 1.14.2 causes error in extract_ssi function of pytopkapi\results_analysis\sim_result_tools.py #11

Open
betrieb opened this issue Mar 23, 2018 · 0 comments

Comments

@betrieb
Copy link

betrieb commented Mar 23, 2018

Hi,
I have updated numpy to the latest version (1.14.2). Not sure what my version before was. This triggered an error in the extract_ssi function of the pytopkapi\results_analysis\sim_result_tools.py module in line 244. I'm pretty sure that this was caused due to some changes made to the numpy.ma.core module.
I have rolled back to numpy version 1.13.3 and the error did not occur.

From what I understand the mask as created in line 134:
soil_depth = ma.masked_values(soil_depth, 0.0)
needs to be changed to have the same shape as the data.

Here the traceback of the error msg:
Traceback (most recent call last):
File "", line 1, in
File "c:\python27\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "c:\python27\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File ".../run.py", line 37, in
split_month=10, topkapi_ini='TOPKAPI.ini')
File "c:\python27\lib\site-packages\pytopkapi\results_analysis\sim_result_tools.py", line 3000, in WWBU_post_processing_DL
ar_SSI_s = np.average(extract_ssi(topkapi_ini),axis=1)
File "c:\python27\lib\site-packages\pytopkapi\results_analysis\sim_result_tools.py", line 244, in extract_ssi
sv = ma.array(soil_vol, mask=soil_depth.mask)
File "c:\python27\lib\site-packages\numpy\ma\core.py", line 6358, in array
ndmin=ndmin, shrink=shrink, order=order)
File "c:\python27\lib\site-packages\numpy\ma\core.py", line 2868, in new
raise MaskError(msg % (nd, nm))
numpy.ma.core.MaskError: Mask and data not compatible: data size is 242778, mask size is 2823.

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

1 participant