From 1f955bb0f5e3d556bc042a6532cecc70642b5adf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:43:40 +0000 Subject: [PATCH 1/5] [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.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - https://github.com/asottile/reorder_python_imports → https://github.com/asottile/reorder-python-imports - [github.com/asottile/reorder-python-imports: v3.9.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.9.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.3.1 → v3.15.2](https://github.com/asottile/pyupgrade/compare/v3.3.1...v3.15.2) - [github.com/psf/black: 23.3.0 → 24.3.0](https://github.com/psf/black/compare/23.3.0...24.3.0) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0280f46..1684d75 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-yaml - id: end-of-file-fixer @@ -11,20 +11,20 @@ repos: - id: debug-statements language_version: python3 - - repo: https://github.com/asottile/reorder_python_imports - rev: v3.9.0 + - repo: https://github.com/asottile/reorder-python-imports + rev: v3.12.0 hooks: - id: reorder-python-imports args: [--py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.15.2 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/psf/black - rev: "23.3.0" + rev: "24.3.0" hooks: - id: black \ No newline at end of file From 22e52193be9925924fb077aa29b0004e0512a893 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:43:54 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- magpylib_material_response/demag.py | 1 + tests/test_meshing.py | 1 + 2 files changed, 2 insertions(+) diff --git a/magpylib_material_response/demag.py b/magpylib_material_response/demag.py index c5c99ee..92e660f 100644 --- a/magpylib_material_response/demag.py +++ b/magpylib_material_response/demag.py @@ -1,4 +1,5 @@ """demag_functions""" + # + # pylint: disable=invalid-name, redefined-outer-name, protected-access import sys diff --git a/tests/test_meshing.py b/tests/test_meshing.py index 6fcd029..50d350b 100644 --- a/tests/test_meshing.py +++ b/tests/test_meshing.py @@ -1,4 +1,5 @@ """Test meshing functions""" + import magpylib as magpy import numpy as np import pytest From 5e3a8cbb80f5637843b366b5157678de2c6cda2a Mon Sep 17 00:00:00 2001 From: "Boisselet Alexandre (IFAT DC ATV SC D TE2)" Date: Thu, 4 Apr 2024 10:34:30 +0200 Subject: [PATCH 3/5] update --- .github/workflows/ci.yml | 2 +- .pre-commit-config.yaml | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21cc07d..ff1aff0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1684d75..2bec4e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,20 +11,36 @@ repos: - id: debug-statements language_version: python3 - - repo: https://github.com/asottile/reorder-python-imports - rev: v3.12.0 + - repo: https://github.com/pycqa/isort + rev: 5.13.2 hooks: - - id: reorder-python-imports - args: [--py37-plus] + - id: isort + name: isort (python) - repo: https://github.com/asottile/pyupgrade rev: v3.15.2 hooks: - id: pyupgrade - args: [--py37-plus] + args: [--py38-plus] - repo: https://github.com/psf/black rev: "24.3.0" hooks: - - id: black \ No newline at end of file + - id: black + + + # - repo: local + # hooks: + # - id: pylint + # name: pylint + # entry: pylint + # language: system + # types: [python] + # files: ^magpylib/ + # args: [ + # "-rn", # Only display messages + # "-sn", # Don't display the score + # "--rcfile=.pylintrc", # Link to your config file + # #"--load-plugins=pylint.extensions.docparams", # Load an extension + # ] From 2296d4ae15d76cbff6ae688284ef2ce1a11fe283 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 08:34:41 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- magpylib_material_response/demag.py | 3 +-- magpylib_material_response/meshing.py | 8 +++++--- setup.py | 3 +-- tests/test_meshing.py | 12 +++++++----- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/magpylib_material_response/demag.py b/magpylib_material_response/demag.py index 92e660f..b71af6b 100644 --- a/magpylib_material_response/demag.py +++ b/magpylib_material_response/demag.py @@ -8,8 +8,7 @@ import magpylib as magpy import numpy as np from loguru import logger -from magpylib._src.obj_classes.class_BaseExcitations import BaseCurrent -from magpylib._src.obj_classes.class_BaseExcitations import BaseMagnet +from magpylib._src.obj_classes.class_BaseExcitations import BaseCurrent, BaseMagnet from magpylib.magnet import Cuboid from scipy.spatial.transform import Rotation as R diff --git a/magpylib_material_response/meshing.py b/magpylib_material_response/meshing.py index d2853f7..0ba5cb0 100644 --- a/magpylib_material_response/meshing.py +++ b/magpylib_material_response/meshing.py @@ -7,9 +7,11 @@ from magpylib._src.obj_classes.class_BaseExcitations import BaseCurrent from scipy.spatial.transform import Rotation as R -from magpylib_material_response.meshing_utils import cells_from_dimension -from magpylib_material_response.meshing_utils import get_volume -from magpylib_material_response.meshing_utils import mask_inside +from magpylib_material_response.meshing_utils import ( + cells_from_dimension, + get_volume, + mask_inside, +) def _collection_from_obj_and_cells(obj, cells, **style_kwargs): diff --git a/setup.py b/setup.py index c6b8592..7e9decf 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python """The setup script.""" -from setuptools import find_packages -from setuptools import setup +from setuptools import find_packages, setup with open("magpylib_material_response/__init__.py") as handle: for line in handle: diff --git a/tests/test_meshing.py b/tests/test_meshing.py index 50d350b..b0cf8d8 100644 --- a/tests/test_meshing.py +++ b/tests/test_meshing.py @@ -4,11 +4,13 @@ import numpy as np import pytest -from magpylib_material_response.meshing import mesh_all -from magpylib_material_response.meshing import mesh_Cuboid -from magpylib_material_response.meshing import mesh_Cylinder -from magpylib_material_response.meshing import mesh_thin_CylinderSegment_with_cuboids -from magpylib_material_response.meshing import slice_Cuboid +from magpylib_material_response.meshing import ( + mesh_all, + mesh_Cuboid, + mesh_Cylinder, + mesh_thin_CylinderSegment_with_cuboids, + slice_Cuboid, +) def test_mesh_Cuboid(): From 7fbee0bb1aeb3af5ef5381a81bc3927d2b818f7f Mon Sep 17 00:00:00 2001 From: "Boisselet Alexandre (IFAT DC ATV SC D TE2)" Date: Thu, 4 Apr 2024 10:37:28 +0200 Subject: [PATCH 5/5] python >= 3.9 --- .circleci/config.yml | 2 +- .github/ISSUE_TEMPLATES/bug_report.md | 2 +- .github/workflows/ci.yml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index acb8670..b3354b3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: docs: docker: # see: https://circleci.com/docs/2.0/circleci-images/#python - - image: circleci/python:3.7-stretch + - image: circleci/python:3.9-stretch steps: # Get our data and merge with upstream - run: sudo apt-get update diff --git a/.github/ISSUE_TEMPLATES/bug_report.md b/.github/ISSUE_TEMPLATES/bug_report.md index 8518675..594df45 100644 --- a/.github/ISSUE_TEMPLATES/bug_report.md +++ b/.github/ISSUE_TEMPLATES/bug_report.md @@ -38,7 +38,7 @@ ERROR ... **Environment (please complete the following information):** -- Python Version [e.g. 3.7.1] +- Python Version [e.g. 3.9.1] - Package Version [e.g. 0.1.0] **Additional context** diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff1aff0..f8d499c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.9 uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: 3.9 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -56,10 +56,10 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python 3.9 uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: 3.9 - name: Build package run: | pip install wheel