-
Notifications
You must be signed in to change notification settings - Fork 31
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
Example 3 does not run with Python 3 #65
Comments
Thanks for this issue report and sorry for the delayed response. |
Hi, thanks a lot! I actually use original cmip5 data, like the file in the original example. I will try to provide that data. |
Here is the data download: Here is my script import os
import datetime
from icclim import icclim
import logging
form= '%(asctime)s | %(levelname)8s | %(module)10s | %(funcName)20s | %(message)s'
logging.basicConfig(level=logging.DEBUG, format=form)
# base period
base_dt1 = datetime.datetime(1961,1,1)
base_dt2 = datetime.datetime(1970,12,31)
# studied period
dt1 = datetime.datetime(1980,1,1)
dt2 = datetime.datetime(2000,12,31)
out_f = 'TG90p_year_MPI-ESM-LR_historical_r1i1p1_1980-2000.nc' # OUTPUT FILE: summer half-year values of TG90p
filenames = 'tas_day_MPI-ESM-LR_historical_r1i1p1_18500101-20051231.nc'
icclim.indice(indice_name='TG90p', in_files=filenames, var_name='tas', slice_mode='year', time_range=[dt1, dt2], base_period_time_range=[base_dt1, base_dt2], out_file=out_f, out_unit='%') and here is the error:
It actually works with py2.7 and icclim 4.2.11 |
Sorry for taking so long to reply. |
thanks a lot! |
Please try the latest icclim commit. It was a very complicated bug to fix... It was due to the implementation of non-standard calendar year types for the percentile calculations. The implementation was partial and it is why it was not always working. |
With version 5.0.0 of icclim, python 2 is no longer supported and the development was done with python 3.7 or newer. However, it make me think that we should really run the examples in the CI, this would make sure each new PR run them and no example is broken. As often, we can take inspiration of what xclim does. |
Example 3: indice TG90p with callback
runs it with py2.7 and icclim V4.2.11
crashes with py3.6 and icclim V4.2.13
i get:
The text was updated successfully, but these errors were encountered: