Skip to content
Closed
Show file tree
Hide file tree
Changes from 13 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
34 changes: 7 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,23 @@ repos:
- id: check-yaml # Check YAML files for syntax errors only
args: [--unsafe, --allow-multiple-documents]
- id: check-toml
# - id: check-added-large-files
# - id: check-added-large-files
- id: debug-statements # Check for debugger imports and py37+ breakpoint()
- id: mixed-line-ending
- id: no-commit-to-branch # Prevent committing to main / master
- id: check-merge-conflict # Check for files that contain merge conflict
exclude: /README\.rst$|^docs/.*\.rst$
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args:
- -l 110
- --force-single-line-imports
- --profile black
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black
args: [--line-length=110]
- repo: https://github.com/keewis/blackdoc
rev: v0.3.8
hooks:
- id: blackdoc
additional_dependencies: [black==23.3.0]
exclude: xr_engine_profile_rst\.py
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.15.4
hooks:
- id: ruff
- id: ruff-check
exclude: '(dev/.*|.*_)\.py$'
args:
- --line-length=110
- --line-length=120
- --fix
- --exit-non-zero-on-fix
- --preview
- id: ruff-format
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.14
hooks:
Expand All @@ -53,11 +35,9 @@ repos:
hooks:
- id: pretty-format-yaml
args: [--autofix, --preserve-quotes]
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.0
hooks:
- id: sphinx-lint
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
25 changes: 9 additions & 16 deletions docs/examples/hybrid_levels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@
"from earthkit.meteo.utils.sample import get_sample\n",
"\n",
"DATA = get_sample(\"vertical_hybrid_data\")\n",
"sp = DATA.p_surf # surface pressure [Pa]\n",
"zs = DATA.z_surf # surface geopotential [m2/s2]\n",
"t = DATA.t # temperature [K]\n",
"q = DATA.q # specific humidity [kg/kg]\n",
"sp = DATA.p_surf # surface pressure [Pa]\n",
"zs = DATA.z_surf # surface geopotential [m2/s2]\n",
"t = DATA.t # temperature [K]\n",
"q = DATA.q # specific humidity [kg/kg]\n",
"\n",
"sp.shape, zs.shape, t.shape, q.shape"
]
Expand Down Expand Up @@ -329,9 +329,7 @@
}
],
"source": [
"p_full, p_half, alpha,delta = vertical.pressure_on_hybrid_levels(\n",
" A, B, sp, \n",
" output=(\"full\", \"half\",\"alpha\", \"delta\"))\n",
"p_full, p_half, alpha, delta = vertical.pressure_on_hybrid_levels(A, B, sp, output=(\"full\", \"half\", \"alpha\", \"delta\"))\n",
"\n",
"p_full.shape, p_half.shape, alpha.shape, delta.shape"
]
Expand Down Expand Up @@ -376,9 +374,7 @@
}
],
"source": [
"p_full = vertical.pressure_on_hybrid_levels(\n",
" A, B, sp, levels=[135, 136, 137],\n",
" output=(\"full\"))\n",
"p_full = vertical.pressure_on_hybrid_levels(A, B, sp, levels=[135, 136, 137], output=(\"full\"))\n",
"p_full"
]
},
Expand Down Expand Up @@ -422,9 +418,7 @@
}
],
"source": [
"p_full = vertical.pressure_on_hybrid_levels(\n",
" A, B, sp, levels=[137, 136, 135],\n",
" output=(\"full\"))\n",
"p_full = vertical.pressure_on_hybrid_levels(A, B, sp, levels=[137, 136, 135], output=(\"full\"))\n",
"p_full"
]
},
Expand Down Expand Up @@ -470,8 +464,7 @@
},
"outputs": [],
"source": [
"z_thickness= vertical.relative_geopotential_thickness_on_hybrid_levels(t, q, \n",
" A, B, sp)"
"z_thickness = vertical.relative_geopotential_thickness_on_hybrid_levels(t, q, A, B, sp)"
]
},
{
Expand Down Expand Up @@ -514,7 +507,7 @@
}
],
"source": [
"z_thickness= vertical.relative_geopotential_thickness_on_hybrid_levels(t[-3:], q[-3:], A, B, sp)\n",
"z_thickness = vertical.relative_geopotential_thickness_on_hybrid_levels(t[-3:], q[-3:], A, B, sp)\n",
"z_thickness"
]
},
Expand Down
Loading
Loading