sahg / PyTOPKAPI

The official PyTOPKAPI repository
http://sahg.github.io/PyTOPKAPI
Other
23 stars 17 forks source link

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

Open betrieb opened 6 years ago

betrieb commented 6 years ago

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.