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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATES/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
34 changes: 25 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -11,20 +11,36 @@ repos:
- id: debug-statements
language_version: python3

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.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.3.1
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]


- repo: https://github.com/psf/black
rev: "23.3.0"
rev: "24.3.0"
hooks:
- id: black
- 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
# ]
4 changes: 2 additions & 2 deletions magpylib_material_response/demag.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""demag_functions"""

# +
# pylint: disable=invalid-name, redefined-outer-name, protected-access
import sys
Expand All @@ -7,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

Expand Down
8 changes: 5 additions & 3 deletions magpylib_material_response/meshing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
13 changes: 8 additions & 5 deletions tests/test_meshing.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"""Test meshing functions"""

import magpylib as magpy
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():
Expand Down