Skip to content
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
20 changes: 0 additions & 20 deletions .flake8

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository )
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Log into the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: token
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push the Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build twine
- name: Build and Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload --skip-existing dist/*
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.9, "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -36,11 +36,11 @@ jobs:
# run: |
# make doctest
- name: Stash coverage
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage.xml
name: coverage-${{ matrix.python-version }}.xml
path: coverage.xml
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
Expand Down
37 changes: 9 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,22 @@ ci:
autoupdate_schedule: monthly

repos:
- repo: https://github.com/psf/black
rev: 24.10.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
hooks:
- id: black
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
rev: v0.4.6
hooks:
- id: blackdoc
files: '\.py$'
exclude: pyvista/plotting/charts.py

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [
"flake8-black==0.3.6",
"flake8-isort==6.0.0",
# "flake8-quotes==3.3.2",
]

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
args: [
Expand All @@ -53,7 +40,7 @@ repos:
exclude: ^pyvista/ext/

- repo: https://github.com/DanielNoord/pydocstringformatter
rev: v0.7.3
rev: v0.7.5
hooks:
- id: pydocstringformatter
args: [
Expand All @@ -62,14 +49,8 @@ repos:
"--no-capitalize-first-letter",
]

- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py38-plus, --keep-runtime-typing]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: debug-statements
Expand Down
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

5 changes: 3 additions & 2 deletions examples/cartographic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"source": [
"import geovista as gv\n",
"import pyvista as pv\n",
"from pvxarray.vtk_source import PyVistaXarraySource\n",
"import xarray as xr"
"import xarray as xr\n",
"\n",
"from pvxarray.vtk_source import PyVistaXarraySource"
]
},
{
Expand Down
9 changes: 2 additions & 7 deletions examples/data-cube.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
},
"outputs": [],
"source": [
"from siphon.catalog import TDSCatalog\n",
"import xarray as xr\n",
"import pyvista as pv\n",
"import pvxarray\n",
"import numpy as np\n",
"import ipywidgets as widgets\n",
"import matplotlib.pyplot as plt\n",
"from siphon.catalog import TDSCatalog\n",
"\n",
"pv.set_plot_theme(\"document\")\n",
"pv.set_jupyter_backend(\"server\") # critical for large data"
Expand Down Expand Up @@ -91,7 +86,7 @@
},
"outputs": [],
"source": [
"dt = da[dict(time=0)]"
"dt = da[{\"time\": 0}]"
]
},
{
Expand Down
9 changes: 4 additions & 5 deletions examples/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
"metadata": {},
"outputs": [],
"source": [
"import pvxarray\n",
"import xarray as xr\n",
"import numpy as np\n",
"import pyvista as pv"
"import pyvista as pv\n",
"import xarray as xr"
]
},
{
Expand Down Expand Up @@ -54,7 +53,7 @@
"outputs": [],
"source": [
"ds = xr.tutorial.load_dataset(\"air_temperature\")\n",
"da = ds.air[dict(time=0)] # Select DataArray for a timestep\n",
"da = ds.air[{\"time\": 0}] # Select DataArray for a timestep\n",
"\n",
"# Plot in 3D\n",
"da.pyvista.plot(x=\"lon\", y=\"lat\", cpos=\"xy\")"
Expand Down Expand Up @@ -129,7 +128,7 @@
"da = da.rio.reproject(\"EPSG:3857\")\n",
"\n",
"# Grab the mesh object for use with PyVista\n",
"mesh = da[dict(band=0)].pyvista.mesh(x=\"x\", y=\"y\")\n",
"mesh = da[{\"band\": 0}].pyvista.mesh(x=\"x\", y=\"y\")\n",
"\n",
"# plot in 3D\n",
"mesh.warp_by_scalar().plot(jupyter_backend=\"server\")"
Expand Down
22 changes: 12 additions & 10 deletions examples/level_of_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,20 @@ def update_time_index(time_index=0, **kwargs):
style="max-width: 150px",
)

with layout.content:
with vuetify.VContainer(
with (
layout.content,
vuetify.VContainer(
fluid=True,
classes="pa-0 fill-height",
):
view = vtk.VtkRemoteView(
plotter.ren_win,
ref="view",
interactive_ratio=1,
)
ctrl.view_update = view.update
ctrl.view_reset_camera = view.reset_camera
),
):
view = vtk.VtkRemoteView(
plotter.ren_win,
ref="view",
interactive_ratio=1,
)
ctrl.view_update = view.update
ctrl.view_reset_camera = view.reset_camera

# Uncomment following line to hide footer
# layout.footer.hide()
Expand Down
22 changes: 12 additions & 10 deletions examples/level_of_detail_geovista.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,20 @@ def update_view_basemap(view_basemap=True, **kwargs):
classes="ma-2",
)

with layout.content:
with vuetify.VContainer(
with (
layout.content,
vuetify.VContainer(
fluid=True,
classes="pa-0 fill-height",
):
view = trame_vtk.VtkRemoteView(
plotter.ren_win,
ref="view",
interactive_ratio=1,
)
ctrl.view_update = view.update
ctrl.view_reset_camera = view.reset_camera
),
):
view = trame_vtk.VtkRemoteView(
plotter.ren_win,
ref="view",
interactive_ratio=1,
)
ctrl.view_update = view.update
ctrl.view_reset_camera = view.reset_camera

# Uncomment following line to hide footer
# layout.footer.hide()
Expand Down
4 changes: 0 additions & 4 deletions examples/lightning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"import numpy as np\n",
"import pandas as pd\n",
"import pyvista as pv\n",
"import pvxarray\n",
"import xarray as xr\n",
"\n",
"pv.set_plot_theme(\"document\")\n",
Expand Down Expand Up @@ -175,9 +174,6 @@
"source": [
"import ipywidgets as widgets\n",
"import pyvista as pv\n",
"from tqdm import tqdm\n",
"\n",
"from pvxarray.vtk_source import PyVistaXarraySource\n",
"\n",
"\n",
"def time_controls(plotter: pv.BasePlotter, continuous_update=False, step=1):\n",
Expand Down
14 changes: 6 additions & 8 deletions examples/radar.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
},
"outputs": [],
"source": [
"from open_radar_data import DATASETS\n",
"import pyvista as pv\n",
"import xarray as xr\n",
"import xradar as xd\n",
"import pyvista as pv\n",
"import pvxarray # Import to register accessor\n",
"from open_radar_data import DATASETS\n",
"\n",
"pv.set_plot_theme(\"document\")\n",
"pv.set_jupyter_backend(\"server\")"
Expand Down Expand Up @@ -85,10 +84,9 @@
},
"outputs": [],
"source": [
"ds_list = []\n",
"for key in list(radar.children):\n",
" if \"sweep\" in key:\n",
" ds_list.append(radar[key].ds.drop_duplicates(dim=\"azimuth\"))\n",
"ds_list = [\n",
" radar[key].ds.drop_duplicates(dim=\"azimuth\") for key in list(radar.children) if \"sweep\" in key\n",
"]\n",
"ds = xr.concat(ds_list, dim=\"sweep\")\n",
"ds"
]
Expand Down Expand Up @@ -181,4 +179,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
Loading