Skip to content

Commit b2ee998

Browse files
authored
Merge pull request #1454 from nschloe/fix-new-numpy
numpy fix
2 parents 0138cc8 + 50e8b04 commit b2ee998

File tree

35 files changed

+97
-107
lines changed

35 files changed

+97
-107
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Check out repo
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1919
- name: Run pre-commit
20-
uses: pre-commit/action@v2.0.3
20+
uses: pre-commit/action@v3.0.0
2121

2222
build:
2323
needs: [lint]
2424
runs-on: ${{ matrix.os }}
2525
strategy:
2626
matrix:
2727
os: [ubuntu-latest, windows-latest, macOS-latest]
28-
python-version: ["3.7", "3.8", "3.9", "3.10"]
28+
python-version: ["3.8", "3.12"]
2929
steps:
30-
- uses: actions/setup-python@v2
30+
- uses: actions/setup-python@v5
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
- name: Checkout code
@@ -36,5 +36,5 @@ jobs:
3636
run: |
3737
pip install tox
3838
tox -- --cov meshio --cov-report xml --cov-report term
39-
- uses: codecov/codecov-action@v1
39+
- uses: codecov/codecov-action@v3
4040
if: ${{ matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' }}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
repos:
22
- repo: https://github.com/PyCQA/isort
3-
rev: 5.10.1
3+
rev: 5.13.2
44
hooks:
55
- id: isort
66

77
- repo: https://github.com/psf/black
8-
rev: 22.1.0
8+
rev: 24.1.1
99
hooks:
1010
- id: black
1111
language_version: python3
1212

1313
- repo: https://github.com/PyCQA/flake8
14-
rev: 4.0.1
14+
rev: 7.0.0
1515
hooks:
1616
- id: flake8

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])"`
1+
version := `python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])"`
22

33
default:
44
@echo "\"just publish\"?"

pyproject.toml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,46 @@
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
15
[project]
26
name = "meshio"
3-
version = "5.0.0"
7+
version = "5.3.5"
48
description = "I/O for many mesh formats"
59
readme = "README.md"
6-
requires-python = ">=3.7"
10+
requires-python = ">=3.8"
711
license = {file = "LICENSE.txt"}
8-
keywords = ["mesh", "file formats", "scientific", "engineering", "fem", "finite elements"]
12+
keywords = [
13+
"mesh",
14+
"file formats",
15+
"scientific",
16+
"engineering",
17+
"fem",
18+
"finite elements"
19+
]
920
authors = [
1021
{email = "[email protected]"},
1122
{name = "Nico Schlömer"}
1223
]
1324
classifiers = [
14-
"Development Status :: 4 - Beta",
15-
"Programming Language :: Python",
1625
"Development Status :: 5 - Production/Stable",
26+
"Programming Language :: Python",
1727
"Intended Audience :: Science/Research",
1828
"License :: OSI Approved :: MIT License",
1929
"Operating System :: OS Independent",
2030
"Programming Language :: Python",
2131
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.7",
2332
"Programming Language :: Python :: 3.8",
2433
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
"Programming Language :: Python :: 3.12",
2537
"Topic :: Scientific/Engineering",
26-
"Topic :: Utilities"
38+
"Topic :: Utilities",
2739
]
2840
dependencies = [
2941
"importlib_metadata; python_version<'3.8'",
30-
"numpy>=1.20.0"
42+
"numpy>=1.20.0",
43+
"rich",
3144
]
3245

3346
[project.optional-dependencies]
@@ -40,14 +53,13 @@ all = [
4053
homepage = "https://github.com/nschloe/meshio"
4154
code = "https://github.com/nschloe/meshio"
4255
issues = "https://github.com/nschloe/meshio/issues"
43-
funding = "https://github.com/sponsors/nschloe"
4456

4557
[project.entry-points.console_scripts]
4658
meshio = "meshio._cli:main"
4759

48-
[build-system]
49-
requires = ["setuptools>=42", "wheel"]
50-
build-backend = "setuptools.build_meta"
51-
5260
[tool.isort]
5361
profile = "black"
62+
63+
# [options.data_files]
64+
# share/paraview-5.9/plugins =
65+
# tools/paraview-meshio-plugin.py

setup.cfg

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/meshio/abaqus/_abaqus.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
I/O for Abaqus inp files.
33
"""
4+
45
import pathlib
56
from itertools import count
67

src/meshio/ansys/_ansys.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
<https://romeo.univ-reims.fr/documents/fluent/tgrid/ug/appb.pdf>
55
"""
6+
67
import re
78

89
import numpy as np

src/meshio/avsucd/_avsucd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
I/O for AVS-UCD format, cf.
33
<https://lanl.github.io/LaGriT/pages/docs/read_avs.html>.
44
"""
5+
56
import numpy as np
67

78
from ..__about__ import __version__ as version

src/meshio/cgns/_cgns.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
TODO link to specification?
55
"""
6+
67
import numpy as np
78

89
from .._exceptions import ReadError

src/meshio/dolfin/_dolfin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
I/O for DOLFIN's XML format, cf.
33
<https://people.sc.fsu.edu/~jburkardt/data/dolfin_xml/dolfin_xml.html>.
44
"""
5+
56
import os
67
import pathlib
78
import re

src/meshio/exodus/_exodus.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<https://src.fedoraproject.org/repo/pkgs/exodusii/922137.pdf/a45d67f4a1a8762bcf66af2ec6eb35f9/922137.pdf>,
66
in particular Appendix A (page 171, Implementation of EXODUS II with netCDF).
77
"""
8+
89
import datetime
910
import re
1011

src/meshio/flac3d/_flac3d.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
I/O for FLAC3D format.
33
"""
4+
45
from __future__ import annotations
56

67
import re
@@ -534,6 +535,7 @@ def _translate_zcells(points, cells):
534535
normal vectors). Reorder corner points according to sign of scalar triple
535536
products.
536537
"""
538+
537539
# See <https://stackoverflow.com/a/42386330/353337>
538540
def slicing_summing(a, b, c):
539541
c0 = b[:, 1] * c[:, 2] - b[:, 2] * c[:, 1]

src/meshio/gmsh/_gmsh22.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
I/O for Gmsh's msh format, cf.
33
<http://gmsh.info//doc/texinfo/gmsh.html#File-formats>.
44
"""
5+
56
from __future__ import annotations
67

78
import numpy as np

src/meshio/gmsh/_gmsh40.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
I/O for Gmsh's msh format (version 4.0, as used by Gmsh 4.1.5), cf.
33
<http://gmsh.info//doc/texinfo/gmsh.html#MSH-file-format-_0028version-4_0029>.
44
"""
5+
56
from __future__ import annotations
67

78
from functools import partial

src/meshio/gmsh/_gmsh41.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
I/O for Gmsh's msh format (version 4.1, as used by Gmsh 4.2.2+), cf.
33
<http://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format>.
44
"""
5+
56
from functools import partial
67

78
import numpy as np
@@ -209,13 +210,15 @@ def _read_elements(
209210
(num_ele,) = fromfile(f, c_size_t, 1)
210211
for physical_name, cell_set in cell_sets.items():
211212
cell_set[k] = np.arange(
212-
num_ele
213-
if (
214-
physical_tags
215-
and field_data[physical_name][1] == dim
216-
and field_data[physical_name][0] in physical_tags[dim][tag]
217-
)
218-
else 0,
213+
(
214+
num_ele
215+
if (
216+
physical_tags
217+
and field_data[physical_name][1] == dim
218+
and field_data[physical_name][0] in physical_tags[dim][tag]
219+
)
220+
else 0
221+
),
219222
dtype=type(num_ele),
220223
)
221224
tpe = _gmsh_to_meshio_type[type_ele]

src/meshio/h5m/_h5m.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
I/O for h5m, cf.
33
<https://www.mcs.anl.gov/~fathom/moab-docs/html/h5mmain.html>.
44
"""
5+
56
from datetime import datetime
67

78
import numpy as np

src/meshio/mdpa/_mdpa.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
The MDPA format is unsuitable for fast consumption, this is why:
66
<https://github.com/KratosMultiphysics/Kratos/issues/5365>.
77
"""
8+
89
import numpy as np
910

1011
from .._common import num_nodes_per_cell, raw_from_cell_data, warn

0 commit comments

Comments
 (0)