From b24e786a07cd3dac32e33c2134e9b03efa2c1e6b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:18:46 +0000 Subject: [PATCH 1/3] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/psf/black: 24.4.2 → 24.10.0](https://github.com/psf/black/compare/24.4.2...24.10.0) - [github.com/astral-sh/ruff-pre-commit: v0.5.4 → v0.7.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.4...v0.7.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 27b6e2eb..abff3fbd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v4.6.0" + rev: "v5.0.0" hooks: - id: check-added-large-files - id: check-case-conflict @@ -27,13 +27,13 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: "24.4.2" + rev: "24.10.0" hooks: - id: black args: [--line-length=79] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.4 + rev: v0.7.1 hooks: - id: ruff args: [ From a5462455e4bc45d36796cefb76bfe5115ce45502 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:19:03 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/ipynb/notebook_showcase_k3d.ipynb | 3 ++- gustaf/show.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/ipynb/notebook_showcase_k3d.ipynb b/examples/ipynb/notebook_showcase_k3d.ipynb index 49650c67..2c676561 100644 --- a/examples/ipynb/notebook_showcase_k3d.ipynb +++ b/examples/ipynb/notebook_showcase_k3d.ipynb @@ -15,9 +15,10 @@ "metadata": {}, "outputs": [], "source": [ - "import gustaf as gus\n", "import vedo\n", "\n", + "import gustaf as gus\n", + "\n", "vedo.settings.default_backend = \"k3d\"" ] }, diff --git a/gustaf/show.py b/gustaf/show.py index 89a54fe9..16378ca1 100644 --- a/gustaf/show.py +++ b/gustaf/show.py @@ -72,15 +72,15 @@ def show(*args, **kwargs): N = len(args) offs = kwargs.get("offscreen", False) interact = kwargs.get("interactive", True) - plt = kwargs.get("vedoplot", None) + plt = kwargs.get("vedoplot") skip_clear = kwargs.get("skip_clear", False) - close = kwargs.get("close", None) + close = kwargs.get("close") size = kwargs.get("size", "auto") - cam = kwargs.get("cam", None) + cam = kwargs.get("cam") title = kwargs.get("title", "gustaf") background = kwargs.get("background", "white") return_show_list = kwargs.get("return_showable_list", False) - axes = kwargs.get("axes", None) + axes = kwargs.get("axes") def clear_vedo_plotter(plotter, num_renderers, skip_cl=skip_clear): """enough said.""" From 2dff12da976eee89bef136b268c17dd0192d7f45 Mon Sep 17 00:00:00 2001 From: "clemens.fricke" Date: Wed, 30 Oct 2024 11:04:02 +0100 Subject: [PATCH 3/3] Fix: wrong order of variables for export function in examples --- examples/export_meshio.py | 8 ++++---- examples/ipynb/notebook_showcase_k3d.ipynb | 4 +++- examples/mixd_to_nutils.py | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/export_meshio.py b/examples/export_meshio.py index 2e81b39d..7cbc241c 100644 --- a/examples/export_meshio.py +++ b/examples/export_meshio.py @@ -44,14 +44,14 @@ # Export with subgroup triangles gus.io.meshio.export( - tet, export_path / "export_meshio_subgroups.vtu", submeshes=[fac] + export_path / "export_meshio_subgroups.vtu", tet, submeshes=[fac] ) # The mesh still has to conform the needed format, e.g. stl will discard # tetrahedra gus.io.meshio.export( - tet, export_path / "export_meshio_subgroups.stl", submeshes=[fac] + export_path / "export_meshio_subgroups.stl", tet, submeshes=[fac] ) # Export only tetrahedra - gus.io.meshio.export(tet, export_path / "export_meshio.vtu") - gus.io.meshio.export(tet.to_faces(), export_path / "export_meshio.stl") + gus.io.meshio.export(export_path / "export_meshio.vtu", tet) + gus.io.meshio.export(export_path / "export_meshio.stl", tet.to_faces()) diff --git a/examples/ipynb/notebook_showcase_k3d.ipynb b/examples/ipynb/notebook_showcase_k3d.ipynb index 2c676561..e8139009 100644 --- a/examples/ipynb/notebook_showcase_k3d.ipynb +++ b/examples/ipynb/notebook_showcase_k3d.ipynb @@ -157,7 +157,9 @@ ")\n", "torus.control_points += [3, 0, 3]\n", "\n", - "empty_torus = splinepy.helpme.create.circle(1).create.revolved([0, 1, 0], [3, 0, 0], 360)\n" + "empty_torus = splinepy.helpme.create.circle(1).create.revolved(\n", + " [0, 1, 0], [3, 0, 0], 360\n", + ")\n" ] }, { diff --git a/examples/mixd_to_nutils.py b/examples/mixd_to_nutils.py index aea366bc..05c168db 100644 --- a/examples/mixd_to_nutils.py +++ b/examples/mixd_to_nutils.py @@ -8,8 +8,8 @@ def main(): mesh = create_mesh() # Export it as .mixd-file and .npz-file - gus.io.mixd.export(mesh, "export/export_mixd.xns") - gus.io.nutils.export(mesh, "export/export_npz.npz") + gus.io.mixd.export("export/export_mixd.xns", mesh) + gus.io.nutils.export("export/export_npz.npz", mesh) # Load the mixd-file and the .npz-file mesh_mixd = gus.io.mixd.load(