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 Nov 25, 2024
1 parent cfbda66 commit 6fa5d7e
Show file tree
Hide file tree
Showing 25 changed files with 138 additions and 125 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
1 change: 1 addition & 0 deletions tests/test_cf_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pandas as pd
import pytest
import xarray as xr

from icclim._core.model.cf_calendar import CfCalendarRegistry
from icclim.exception import InvalidIcclimArgumentError

Expand Down
1 change: 0 additions & 1 deletion tests/test_dcsc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from icclim.dcsc import txnd

from tests.testing_utils import stub_tas


Expand Down
Loading

0 comments on commit 6fa5d7e

Please sign in to comment.