From 8f9295712e4612b782cf798c30d6bd2b6a1312aa Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Sun, 19 Feb 2023 22:26:16 +0100 Subject: [PATCH 1/8] Add `items`-arg to plot of characteristic curve job --- src/felupe/mechanics/_curve.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/felupe/mechanics/_curve.py b/src/felupe/mechanics/_curve.py index b737ed31..7ca6389c 100644 --- a/src/felupe/mechanics/_curve.py +++ b/src/felupe/mechanics/_curve.py @@ -77,6 +77,7 @@ def plot( fig=None, ax=None, linestyle=".-", + items=None, **kwargs ): @@ -90,8 +91,11 @@ def plot( if y is None: y = self.y - x = np.array(x) - y = np.array(y) + if items is None: + items = slice(None) + + x = np.array(x)[items] + y = np.array(y)[items] if gradient: y = np.gradient(y, x[:, xaxis], edge_order=2, axis=0) From 29394c44ffe880a26fe19315bc249929e734d68c Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Sun, 19 Feb 2023 22:26:26 +0100 Subject: [PATCH 2/8] update ci --- .github/workflows/coverage.yml | 12 ++++++++++-- .pre-commit-config.yaml | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 42cdf220..7018452a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: Codecov +name: ci on: push: @@ -9,7 +9,15 @@ on: - main jobs: - run: + lint: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v3 + - name: Run pre-commit + uses: pre-commit/action@v3.0.0 + + build: name: Upload coverage report to codecov.io runs-on: ubuntu-latest strategy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..96144d86 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +repos: + - repo: https://github.com/PyCQA/isort + rev: 5.10.1 + hooks: + - id: isort + + - repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black + language_version: python3 + + - repo: https://github.com/pycqa/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: 2.8.4 + hooks: + - id: prettier \ No newline at end of file From c911703cbafa6884c0548bcf2961df54b832ae95 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Sun, 19 Feb 2023 22:29:17 +0100 Subject: [PATCH 3/8] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96144d86..ff928030 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,6 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-prettier - rev: 2.8.4 + rev: v2.8.4 hooks: - id: prettier \ No newline at end of file From deef9d91a2075eb248017dbbf0ac9477f84b8c34 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Sun, 19 Feb 2023 22:30:50 +0100 Subject: [PATCH 4/8] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ff928030..070a51c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,6 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.8.4 + rev: v3.0.0-alpha.4 hooks: - id: prettier \ No newline at end of file From adf2577563d895f03e45ebf6daa7190dc400239f Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Tue, 14 Mar 2023 22:38:27 +0100 Subject: [PATCH 5/8] Revert "Update .pre-commit-config.yaml" This reverts commit a2f92cd4f0c30294dd3cd22fe74bfb8c0ec65a9b. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 070a51c1..ff928030 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,6 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.4 + rev: v2.8.4 hooks: - id: prettier \ No newline at end of file From 165e76841785280a7a65e0495acd523629f185ce Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Tue, 14 Mar 2023 22:38:49 +0100 Subject: [PATCH 6/8] Revert "Update .pre-commit-config.yaml" This reverts commit c3de7f1c143d0d6573c02e690e15dc11de389c34. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ff928030..96144d86 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,6 +16,6 @@ repos: - id: flake8 - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.8.4 + rev: 2.8.4 hooks: - id: prettier \ No newline at end of file From 93b98e88511eff3d3a8d9142b07f3031f6c67703 Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Tue, 14 Mar 2023 22:38:54 +0100 Subject: [PATCH 7/8] Revert "update ci" This reverts commit 47b33c92d43bb5c7ed4f06c3655cfd7700c8fb35. --- .github/workflows/coverage.yml | 12 ++---------- .pre-commit-config.yaml | 21 --------------------- 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 7018452a..42cdf220 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: ci +name: Codecov on: push: @@ -9,15 +9,7 @@ on: - main jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Check out repo - uses: actions/checkout@v3 - - name: Run pre-commit - uses: pre-commit/action@v3.0.0 - - build: + run: name: Upload coverage report to codecov.io runs-on: ubuntu-latest strategy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 96144d86..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,21 +0,0 @@ -repos: - - repo: https://github.com/PyCQA/isort - rev: 5.10.1 - hooks: - - id: isort - - - repo: https://github.com/psf/black - rev: 22.10.0 - hooks: - - id: black - language_version: python3 - - - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 - hooks: - - id: flake8 - - - repo: https://github.com/pre-commit/mirrors-prettier - rev: 2.8.4 - hooks: - - id: prettier \ No newline at end of file From 4d58063df69005ec06a2af1720bbc5da49d5b0fd Mon Sep 17 00:00:00 2001 From: Andreas Dutzler Date: Tue, 14 Mar 2023 22:46:00 +0100 Subject: [PATCH 8/8] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae208987..844d7d39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. The format - Add a new argument to pass a mesh for the dual regions in `FieldsMixed(mesh=None)`. - Add quadrature and grad arguments to `RegionLagrange`. - Add order attribute to `RegionLagrange`. +- Add items-argument for custom slicing of characteristic curve plots in `CharacteristicCurve.plot(items=None)`. ### Changed - Enhance Domain integration in `IntegralForm`: Ensure C-contiguous arrays as `fun`-argument.