IHCantabria / NEOPRENE

Neyman-Scott Process Rainfall Emulator library
GNU General Public License v3.0
13 stars 5 forks source link

Problem with notebook STNSRP_test.ipynb #23

Open Hiatus12 opened 9 months ago

Hiatus12 commented 9 months ago

Hi, I'm trying to use your notebook STNSRP_test.ipynb with the data given by you and also with my data but when I reach the calibration section, this error occurs:

Exception has occurred: ValueError data type <class 'numpy.object_'> not inexact

If I try to convert the data in a float type, then this other error appears:

Exception has occurred: Exception Lenght/name/order of time series and attributes does not match

Thank you for the support. Best regards Nino

JavierDiezSierra commented 8 months ago

Many thanks @Hiatus12 for your comment!

I think I remember that @navass11 already corrected this issue in the punctual model (NSRP), right?"

@manueldeljesus

manueldeljesus commented 8 months ago

Issue #22 seems to be solved in branch issue_22. Most of the problems there were related to how we treat Pandas DataFrames, how we make assignments to them, etc.

The problem here seems to be the same, but worse, because we are using tuples to index columns in DataFrames, and that may generating part of the issues. Jupyter kernels are dying on the example notebook. I think this may be due to some change in behavior in the last Pandas versions.

I will look further into the problem and keep you posted.

manueldeljesus commented 3 months ago

Sorry for the big delay, but @navass11 should have solved the issues in the last release of the code. Please, check and let us know if it is the case or not.

Hiatus12 commented 3 months ago

Hi, thanks for the reply. I've tried the new STNSRP notebook and that's what I get. Working with my data I get the error: "None of [Int64Index([158430, 158490, 574410, 587020, 710140], dtype='int64')] are in the [columns]" relative at the row: Input_Series = Input_Series[Input_Attr.ID]

Working with your data i get the error: "TypeError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_1080\3865303354.py in ----> 1 Analysis_results = Analysis(CAL1,SIM1,hiper_params_sim)

TypeError: init() takes 3 positional arguments but 4 were given" relative at the row: Analysis_results = Analysis(CAL1,SIM1,hiper_params_sim)

I'm using Python 3.7.16 in both cases. Thanks Best regards Nino

manueldeljesus commented 3 months ago

Hi Nino:

Which OS are you using?

Also, the last update uses Python 3.11. May you please check with that version just to see if that makes part of the problem? We will include some more detailed installation instructions on the repo, but in the meantime, it would be nice to see why the tool is not working for you.

Hiatus12 commented 3 months ago

Windows 11

Hiatus12 commented 3 months ago

Using Python 3.11 I get the following error: "AttributeError: 'int' object has no attribute 'rint'

The above exception was the direct cause of the following exception:

TypeError Traceback (most recent call last) File c:\ProgramData\miniconda3\envs\NEOPRENE\Lib\site-packages\numpy_core\fromnumeric.py:57, in _wrapfunc(obj, method, *args, *kwds) 56 try: ---> 57 return bound(args, **kwds) 58 except TypeError: 59 # A TypeError occurs if the object does have such a method in its 60 # class, but its signature is not identical to that of NumPy's. This (...) 64 # Call _wrapit from within the except clause to ensure a potential 65 # exception has a traceback chain.

TypeError: loop of ufunc does not support argument 0 of type int which has no callable rint method

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last) AttributeError: 'int' object has no attribute 'rint'

The above exception was the direct cause of the following exception: ... 45 arr, = conv.as_arrays(subok=False) ---> 46 result = getattr(arr, method)(*args, **kwds) 48 return conv.wrap(result, to_scalar=False)

TypeError: loop of ufunc does not support argument 0 of type int which has no callable rint method"

relative at the row:

Input statistics calculated from several Rainfall series statistics_model_1 = Statistics(hiper_params_cal, time_series = Input_Series, attributes = Input_Attr)

Input statistics from file statistics_model_2 = Statistics(hiper_params_cal, files_folder = './statistics_SPD/')

manueldeljesus commented 3 months ago

Dear @Hiatus12

@navass11 just uploaded an environmental.yml with the packages that work in his computer under Windows. May you please clone that environment and report back?

Hiatus12 commented 3 months ago

Thanks for the support. I can ask you if you could write the operations to properly install NEOPRENE? In the README file there are only three rows dedicated to it but I think that I am missing some passages that maybe are necessary. Thanks again for the support Nino

manueldeljesus commented 3 months ago

Hmmmm, ok.

We just updated the pip version of NEOPRENE. I was assuming that you were installing on your own. Please, update the library or just follow the three lines to install it. It should now install a working version of the library.

I look forward to hearing back from you.

Hiatus12 commented 3 months ago

All right, thanks. I will let you know as soon as possible if it works. Best regards Nino

Hiatus12 commented 3 months ago

Using Python 3.11 I get the following error: "AttributeError: 'int' object has no attribute 'rint'

The above exception was the direct cause of the following exception:

TypeError Traceback (most recent call last) File c:\ProgramData\miniconda3\envs\NEOPRENE\Lib\site-packages\numpy_core\fromnumeric.py:57, in _wrapfunc(obj, method, *args, *kwds) 56 try: ---> 57 return bound(args, **kwds) 58 except TypeError: 59 # A TypeError occurs if the object does have such a method in its 60 # class, but its signature is not identical to that of NumPy's. This (...) 64 # Call _wrapit from within the except clause to ensure a potential 65 # exception has a traceback chain.

TypeError: loop of ufunc does not support argument 0 of type int which has no callable rint method

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last) AttributeError: 'int' object has no attribute 'rint'

The above exception was the direct cause of the following exception: ... 45 arr, = conv.as_arrays(subok=False) ---> 46 result = getattr(arr, method)(*args, **kwds) 48 return conv.wrap(result, to_scalar=False)

TypeError: loop of ufunc does not support argument 0 of type int which has no callable rint method"

relative at the row:

Input statistics calculated from several Rainfall series statistics_model_1 = Statistics(hiper_params_cal, time_series = Input_Series, attributes = Input_Attr)

Input statistics from file statistics_model_2 = Statistics(hiper_params_cal, files_folder = './statistics_SPD/')

Hi, I still get this error. At this point I will try to run it on Ubuntu.

manueldeljesus commented 3 months ago

May you please upload the output of the command conda list on the environment that you are using for launching NEOPRENE? Please, have a look at the Guidelines on how to upload this kind of output to make it readable.

We have the code working on Linux and Windows, in independent computers run by different people. Windows 11 is the only difference so far, and we have no access to that for the moment. Still, I fear the problem is elsewhere.

Hiatus12 commented 3 months ago

conda_list_miniconda.txt conda_list_neoprene.txt