Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 20, 2025
1 parent 12db468 commit 40eaea4
Show file tree
Hide file tree
Showing 27 changed files with 142 additions and 130 deletions.
14 changes: 8 additions & 6 deletions doc/source/tutorials/notebooks/DCSC_txnn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@
}
],
"source": [
"import datetime\n",
"import sys\n",
"from pathlib import Path\n",
"\n",
"import cartopy.crs as ccrs\n",
"import cftime\n",
"import icclim\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import xarray as xr\n",
"import xclim\n",
"from xclim.core.calendar import select_time \n",
"from xclim.core.calendar import select_time\n",
"\n",
"import icclim\n",
"from icclim.frequency import FrequencyRegistry\n",
"\n",
"print(\"python: \", sys.version)\n",
Expand All @@ -68,7 +68,7 @@
"print(\"pandas: \", pd.__version__)\n",
"print(\"icclim: \", icclim.__version__)\n",
"print(\"cftime: \", cftime.__version__)\n",
"print(\"xclim: \", xclim.__version__)\n"
"print(\"xclim: \", xclim.__version__)"
]
},
{
Expand Down Expand Up @@ -664,7 +664,9 @@
],
"source": [
"historical_tas = xr.open_mfdataset(historical_files).tas\n",
"filtered_tas = select_time(historical_tas, month=FrequencyRegistry.AMJJAS.indexer[\"month\"], drop=True)\n",
"filtered_tas = select_time(\n",
" historical_tas, month=FrequencyRegistry.AMJJAS.indexer[\"month\"], drop=True\n",
")\n",
"normal = filtered_tas.mean(dim=\"time\", keep_attrs=True)\n",
"normal"
]
Expand Down Expand Up @@ -1291,7 +1293,7 @@
"source": [
"icclim.dcsc.txnd(\n",
" in_files=studied_files[0:1],\n",
" normal = normal,\n",
" normal=normal,\n",
" var_name=\"tas\",\n",
" slice_mode=FrequencyRegistry.AMJJAS,\n",
" out_file=out_f,\n",
Expand Down
4 changes: 2 additions & 2 deletions doc/source/tutorials/notebooks/averaged_tas_anomaly.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@
"import sys\n",
"from pathlib import Path\n",
"\n",
"import icclim\n",
"\n",
"# provides cftime axis in matplotlib\n",
"import numpy as np\n",
"import pandas as pd\n",
"import xarray as xr\n",
"\n",
"import icclim\n",
"\n",
"print(\"python: \", sys.version)\n",
"print(\"numpy: \", np.__version__)\n",
"print(\"xarray: \", xr.__version__)\n",
Expand Down
6 changes: 3 additions & 3 deletions doc/source/tutorials/notebooks/cold_spell_duration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,6 @@
"# CDS API\n",
"import cdsapi\n",
"\n",
"# icclim package for calculating climate indices\n",
"import icclim\n",
"\n",
"# Libraries for plotting and visualising data\n",
"import matplotlib.pyplot as plt\n",
"\n",
Expand All @@ -346,6 +343,9 @@
"import urllib3\n",
"import xarray as xr\n",
"\n",
"# icclim package for calculating climate indices\n",
"import icclim\n",
"\n",
"# To add specific units spelling\n",
"\n",
"urllib3.disable_warnings()\n",
Expand Down
3 changes: 2 additions & 1 deletion doc/source/tutorials/notebooks/custom_freezing_tas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@
"\n",
"import cartopy.crs as ccrs\n",
"import cftime\n",
"import icclim\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import xarray as xr\n",
"\n",
"import icclim\n",
"\n",
"print(\"python: \", sys.version)\n",
"print(\"numpy: \", np.__version__)\n",
"print(\"xarray: \", xr.__version__)\n",
Expand Down
3 changes: 2 additions & 1 deletion doc/source/tutorials/notebooks/deltaT_deltaP_anomaly.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,13 @@
"from pathlib import Path\n",
"\n",
"import cftime\n",
"import icclim\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import xarray as xr\n",
"\n",
"import icclim\n",
"\n",
"print(\"python: \", sys.version)\n",
"print(\"numpy: \", np.__version__)\n",
"print(\"xarray: \", xr.__version__)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@
"\n",
"import cartopy.crs as ccrs\n",
"import cftime\n",
"import icclim\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import xarray as xr\n",
"\n",
"import icclim\n",
"\n",
"print(\"python: \", sys.version)\n",
"print(\"numpy: \", np.__version__)\n",
"print(\"xarray: \", xr.__version__)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@
"import cartopy.crs as ccrs\n",
"import cftime\n",
"import dask\n",
"import icclim\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import xarray as xr\n",
"\n",
"import icclim\n",
"\n",
"print(\"python: \", sys.version)\n",
"print(\"numpy: \", np.__version__)\n",
"print(\"pandas: \", pd.__version__)\n",
Expand Down
2 changes: 1 addition & 1 deletion src/icclim/_core/generic/threshold/percentile.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def compute(
self.value,
op,
self.is_doy_per_threshold,
kwargs.get("freq", None),
kwargs.get("freq"),
kwargs.get("bootstrap", False),
)
msg = (
Expand Down
50 changes: 25 additions & 25 deletions src/icclim/_generated/_dcsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,38 @@
from icclim.logger import Verbosity

__all__ = [
"tav",
"txav",
"trav",
"tx10",
"tx90",
"tn10",
"tn90",
"tnfd",
"txfd",
"sd",
"tx35",
"tr",
"txnd",
"tnht",
"tnnd",
"tncwd",
"txhwd",
"hdd",
"cdd",
"ff98",
"ffav",
"hdd",
"pav",
"pfl90",
"pint",
"rr",
"rr1mm",
"pn20mm",
"pq90",
"pq99",
"pxcdd",
"pxcwd",
"r99",
"pfl90",
"pq90",
"pq99",
"ffav",
"ff98",
"rr",
"rr1mm",
"sd",
"tav",
"tn10",
"tn90",
"tncwd",
"tnfd",
"tnht",
"tnnd",
"tr",
"trav",
"tx10",
"tx35",
"tx90",
"txav",
"txfd",
"txhwd",
"txnd",
]


Expand Down
88 changes: 44 additions & 44 deletions src/icclim/_generated/_ecad.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,70 +28,70 @@
from icclim.logger import Verbosity

__all__ = [
"tg",
"tn",
"tx",
"cd",
"cdd",
"cfd",
"csdi",
"csu",
"cw",
"cwd",
"ddeast",
"ddnorth",
"ddsouth",
"ddwest",
"dtr",
"etr",
"vdtr",
"su",
"tr",
"wsdi",
"tg90p",
"tn90p",
"tx90p",
"txx",
"tnx",
"csu",
"gd4",
"fd",
"cfd",
"fg",
"fg6bft",
"fgcalm",
"fxx",
"gd4",
"gsl",
"hd17",
"id",
"tg10p",
"tn10p",
"tx10p",
"txn",
"tnn",
"csdi",
"cdd",
"pp",
"prcptot",
"rr1",
"sdii",
"cwd",
"rr",
"r10mm",
"r20mm",
"rx1day",
"rx5day",
"r75p",
"r75ptot",
"r95p",
"r95ptot",
"r99p",
"r99ptot",
"rh",
"rr",
"rr1",
"rx1day",
"rx5day",
"sd",
"sd1",
"sd5cm",
"sd50cm",
"cd",
"cw",
"wd",
"ww",
"fxx",
"fg6bft",
"fgcalm",
"fg",
"ddnorth",
"ddeast",
"ddsouth",
"ddwest",
"gsl",
"spi6",
"sdii",
"spi3",
"pp",
"spi6",
"ss",
"rh",
"su",
"tg",
"tg10p",
"tg90p",
"tn",
"tn10p",
"tn90p",
"tnn",
"tnx",
"tr",
"tx",
"tx10p",
"tx90p",
"txn",
"txx",
"vdtr",
"wd",
"wsdi",
"ww",
]


Expand Down
30 changes: 15 additions & 15 deletions src/icclim/_generated/_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@
from icclim.logger import Verbosity

__all__ = [
"average",
"count_occurrences",
"max_consecutive_occurrence",
"sum_of_spell_lengths",
"excess",
"custom_index",
"deficit",
"difference_of_extremes",
"difference_of_means",
"excess",
"fraction_of_total",
"maximum",
"minimum",
"average",
"sum",
"standard_deviation",
"max_of_rolling_sum",
"min_of_rolling_sum",
"max_consecutive_occurrence",
"max_of_rolling_average",
"min_of_rolling_average",
"mean_of_difference",
"difference_of_extremes",
"max_of_rolling_sum",
"maximum",
"mean_of_absolute_one_time_step_difference",
"difference_of_means",
"mean_of_difference",
"min_of_rolling_average",
"min_of_rolling_sum",
"minimum",
"percentile",
"custom_index",
"standard_deviation",
"sum",
"sum_of_spell_lengths",
]


Expand Down
3 changes: 1 addition & 2 deletions src/icclim/generic/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def __init__(self) -> None:
CountOccurrences = GenericIndicator(
"count_occurrences",
count_occurrences,
definition="Count occurrences when threshold(s) are met"
" (e.g. SU, Tx90p, RR1).",
definition="Count occurrences when threshold(s) are met (e.g. SU, Tx90p, RR1).",
)
MaxConsecutiveOccurrence = GenericIndicator(
"max_consecutive_occurrence",
Expand Down
2 changes: 1 addition & 1 deletion src/icclim/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def _build_config(
rolling_window_width=rolling_window_width,
sampling_method=sampling_method,
)
msg = "You must fill either index_name or user_index" "to compute a climate index."
msg = "You must fill either index_name or user_indexto compute a climate index."
raise InvalidIcclimArgumentError(msg)


Expand Down
Loading

0 comments on commit 40eaea4

Please sign in to comment.