Skip to content
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

[pre-commit.ci] pre-commit autoupdate #189

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 'v0.5.7'
rev: 'v0.6.2'
hooks:
- id: ruff
args: ["--fix"]
Expand Down
1 change: 0 additions & 1 deletion docs/notebooks/domains.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from cordex import cordex_domain\n",
"\n",
"eur11_cordex = cordex_domain(\"EUR-11\", dummy=\"topo\")"
Expand Down
1 change: 0 additions & 1 deletion notebooks/atmospheric-river.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,6 @@
"def plot_contourf(da, pole, vmin=None, vmax=None, levels=20):\n",
" %matplotlib inline\n",
" import cartopy.crs as ccrs\n",
" import cartopy.feature as cf\n",
"\n",
" # use ncar colormaps from https://github.com/hhuangwx/cmaps\n",
" # conda install -c conda-forge cmaps\n",
Expand Down
2 changes: 0 additions & 2 deletions notebooks/domains.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,6 @@
" %matplotlib inline\n",
" import cartopy.crs as ccrs\n",
" import cartopy.feature as cf\n",
" import matplotlib.patheffects as pe\n",
" import matplotlib.pyplot as plt\n",
"\n",
" plt.figure(figsize=(20, 10))\n",
Expand Down Expand Up @@ -2478,7 +2477,6 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from cordex import cordex_domain\n",
"\n",
"eur11_cordex = cordex_domain(\"EUR-11\", dummy=\"topo\")"
Expand Down
1 change: 0 additions & 1 deletion notebooks/ghg-forcing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"\n",
"def plot_species(ds):\n",
" \"\"\"plot all species and scenarios\"\"\"\n",
" import matplotlib.pyplot as plt\n",
"\n",
" fig = plt.figure(figsize=(10, 15))\n",
" axes = []\n",
Expand Down
16 changes: 15 additions & 1 deletion notebooks/physics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "7fb27b941602401d91542211134fc71a",
"metadata": {},
"source": [
"# Physics"
Expand All @@ -10,6 +11,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "acae54e37e7d407bbb7b55eff062a284",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -19,6 +21,7 @@
},
{
"cell_type": "markdown",
"id": "9a63283cbaf04dbcab1f6479b197f3a8",
"metadata": {},
"source": [
"pyremo contains a simple physics package with common algorithms that were used in a number of legacy fortran programs in and around REMO. For convenience, these algorithms are now implemented in the `pyremo.physics` package. Typical reacurring tasks are, e.g., the derivation relative (`RELHUM`) and specific humidity (`QD`) or liquid water content (`QW`) using temperature and pressure. "
Expand All @@ -27,6 +30,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "8dd0d8092fe74a7c96281538738b07e2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -36,6 +40,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "72eea5119410473aa328ad9291626812",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -45,6 +50,7 @@
{
"cell_type": "code",
"execution_count": 18,
"id": "8edb47106e1a46a883d545849b8ab81b",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -593,6 +599,7 @@
{
"cell_type": "code",
"execution_count": 62,
"id": "10185d26023b46108eb7d9f57d49d2b3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -602,6 +609,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "8763a12b2bbd4a93a75aff182afb95dc",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -611,6 +619,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "7623eae2785240b9bd12b16a66d81610",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -643,6 +652,7 @@
{
"cell_type": "code",
"execution_count": 43,
"id": "7cdc8c89c7104fffa095e18ddfef8986",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -652,6 +662,7 @@
{
"cell_type": "code",
"execution_count": 44,
"id": "b118ea5561624da68c537baed56e602f",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1200,6 +1211,7 @@
{
"cell_type": "code",
"execution_count": 45,
"id": "938c804e27f84196a10c8828c723f798",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -1209,6 +1221,7 @@
{
"cell_type": "code",
"execution_count": 47,
"id": "504fb2a444614c0babb325280ed9130a",
"metadata": {},
"outputs": [
{
Expand All @@ -1235,14 +1248,14 @@
}
],
"source": [
"import xarray as xr\n",
"\n",
"(abs(qd - ds.QD) / ds.QD).isel(lev=26).plot()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "59bbdb311c014d738909a11f9e486628",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1792,6 +1805,7 @@
{
"cell_type": "code",
"execution_count": 141,
"id": "b43b363d81ae4b689946ece5c682cd59",
"metadata": {},
"outputs": [
{
Expand Down
1 change: 0 additions & 1 deletion notebooks/prepare-test-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"metadata": {},
"outputs": [],
"source": [
"import xarray as xr\n",
"\n",
"ds = xr.open_mfdataset(files, data_vars=\"minimal\", coords=\"minimal\")"
]
Expand Down
3 changes: 1 addition & 2 deletions notebooks/preproc-dev.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@
"metadata": {},
"outputs": [],
"source": [
"from pyintorg import interface as intf\n",
"\n",
"\n",
"def horizontal_dims(da):\n",
Expand Down Expand Up @@ -1343,7 +1342,7 @@
" Makes sure that the selected tos time range is large enough for resampling.\n",
"\n",
" \"\"\"\n",
" from datetime import date, datetime, timedelta\n",
" from datetime import datetime, timedelta\n",
"\n",
" import cftime\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/preprocessing-cf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"# from dask_jobqueue import SLURMCluster\n",
"import dask\n",
"import xarray as xr\n",
"from dask.distributed import Client, progress\n",
"from dask.distributed import Client\n",
"\n",
"import pyremo as pr\n",
"\n",
Expand Down
3 changes: 1 addition & 2 deletions notebooks/production-analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import xarray as xr\n",
"\n",
"%matplotlib inline\n",
Expand Down Expand Up @@ -502,7 +501,7 @@
}
],
"source": [
"from pyremo.analysis import analysis, obs, plot"
"from pyremo.analysis import analysis, plot"
]
},
{
Expand Down
2 changes: 0 additions & 2 deletions notebooks/remo-cmor-dev-json.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"outputs": [],
"source": [
"import glob\n",
"import os\n",
"\n",
"import cordex as cx\n",
"\n",
Expand Down Expand Up @@ -2516,7 +2515,6 @@
}
],
"source": [
"import cf_xarray as cfxr\n",
"\n",
"out.cf.add_bounds(\"time\").cf.bounds"
]
Expand Down
6 changes: 0 additions & 6 deletions notebooks/remo-cmor-dev.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,14 @@
}
],
"source": [
"import datetime as dt\n",
"import glob\n",
"\n",
"# from urllib.request import urlopen\n",
"import json\n",
"import os\n",
"import sys\n",
"\n",
"# from datetime import datetime as dt\n",
"from datetime import timedelta as td\n",
"\n",
"# import cf_xarray as cfxr\n",
"import cftime as cfdt\n",
"import cmor\n",
"import cordex as cx\n",
"import numpy as np\n",
"import pandas as pd\n",
Expand Down
6 changes: 2 additions & 4 deletions notebooks/remo-dataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
}
],
"source": [
"from dask.distributed import Client, progress\n",
"from dask.distributed import Client\n",
"\n",
"client = Client()\n",
"client"
Expand Down Expand Up @@ -18668,9 +18668,7 @@
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"import xesmf as xe"
]
"source": []
},
{
"cell_type": "code",
Expand Down
13 changes: 1 addition & 12 deletions notebooks/remo-dataset2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,10 @@
"source": [
"# import PyRemo as pr\n",
"# from matplotlib import pyplot as plt\n",
"import dask\n",
"import fsspec\n",
"\n",
"# from tqdm.autonotebook import tqdm\n",
"import intake\n",
"import numpy as np\n",
"import pandas as pd\n",
"import seaborn as sns\n",
"import xarray as xr\n",
"from dask.diagnostics import progress\n",
"\n",
"import pyremo as pr\n",
"\n",
Expand Down Expand Up @@ -3218,7 +3212,6 @@
" Function to regrid data bilinearly to a coarser grid\n",
" \"\"\"\n",
"\n",
" import xesmf as xe\n",
"\n",
" return xe.Regridder(finer, coarser, mode)"
]
Expand Down Expand Up @@ -35342,7 +35335,6 @@
}
],
"source": [
"from dask.distributed import progress\n",
"\n",
"%time temps_mean_ = temps_mean.persist() # start computation\n",
"%time progress(temps_mean_)"
Expand Down Expand Up @@ -35973,7 +35965,6 @@
}
],
"source": [
"from dask.distributed import progress\n",
"\n",
"%time temps_cycle_ = temps_cycle.persist() # start computation\n",
"%time progress(temps_cycle_)"
Expand Down Expand Up @@ -40656,9 +40647,7 @@
"execution_count": 75,
"metadata": {},
"outputs": [],
"source": [
"import xesmf as xe"
]
"source": []
},
{
"cell_type": "code",
Expand Down
Loading