monocongo/climate_indices

Warning Lowering Error

Opened this issue · 4 comments

I have installed the package using pip. While testing PDSI_Canadian_Stations.ipynb notebook; I encountered the following error on both the ComputeCanada Graham and UCAR Cheyenne linux clusters.

def _cafec_coefficients(potential_evapotranspiration: np.ndarray, <source elided> with warnings.catch_warnings(): ^ [1] During: lowering "enter_with $phi102.0" at /glade/work/kurkute/my_npl_clone/lib/python3.7/site-packages/climate_indices/palmer.py (512)

So that, I commented line number 512 and 513 in palmer.py and ran the code again. But after submitting the following command
[scpdsi, pdsi, phdi, pmdi, zindex = indices.scpdsi(prcp, pet, awc, start_year, start_year, end_year)] the code got hang.

I used the same trick on my MaCOS and it works fine on it. I am wondering how to run the code on Linux Clusters or do I need to perform some extra steps on it?
Thank You

Thanks @kurkutesa

Are you running the notebook in a Jupyter server running on Graham and/or Cheyenne? When I developed that notebook I was running Jupyter on a laptop running Ubuntu 18, so I'm not aware of any errors on Linux.

NOTE: For what it's worth the Palmer indices are the least robust of the indices offered in this package. In my opinion the requisite work for proper scientific validation has not been performed. I'm a scientific programmer but not a scientist, and a proper climate scientist needs to undertake an evaluation of this implementation. This was attempted while I was developing this code at NOAA, I pushed hard for it but it never made it to the top of the priority list, and so here we are.

Thanks @monocongo for such a prompt reply.
I am not using jupyter notebook on any clusters. I am just loading the python virtual env and installing the module using pip. Well, I have noticed one thing about the package on clusters is that if one installs package using pip; it does not work properly. It throws same error as mentioned in the above post. But, I took following steps to make package work (ONLY Palmer Indices) works, till scPDSI does not work and still get hang if one wants to compute scPDSI. Following are the steps:
(1) Create python virtual environment
(2) pip install climate-indices
(3) clone the original repo
(4) python setup.py install
If I follow above steps then I can make pdsi work which calculate pdsi, phdi, pmdi,zindex . I am not sure what is going on here.
Thank You

I'm not sure what's going on yet. Are you saying that you can complete all the Palmers except scPDSI, and the scPDSI is the one that makes it hang?

One thing about the above steps you've listed is that we should not need to install using setup.py if the package has been installed already using pip. I don't think that this is causing the error, but maybe something we can rule out if we use either one or the other installation methods.

Please see this issue which may be relevant.