Skip to content

Commit

Permalink
Merge pull request #1454 from nschloe/fix-new-numpy
Browse files Browse the repository at this point in the history
numpy fix
  • Loading branch information
nschloe authored Jan 31, 2024
2 parents 0138cc8 + 50e8b04 commit b2ee998
Show file tree
Hide file tree
Showing 35 changed files with 97 additions and 107 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
- name: Run pre-commit
uses: pre-commit/action@v2.0.3
uses: pre-commit/action@v3.0.0

build:
needs: [lint]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.12"]
steps:
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Checkout code
Expand All @@ -36,5 +36,5 @@ jobs:
run: |
pip install tox
tox -- --cov meshio --cov-report xml --cov-report term
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.1.0
rev: 24.1.1
hooks:
- id: black
language_version: python3

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.0.0
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version := `python3 -c "from configparser import ConfigParser; p = ConfigParser(); p.read('setup.cfg'); print(p['metadata']['version'])"`
version := `python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])"`

default:
@echo "\"just publish\"?"
Expand Down
38 changes: 25 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,46 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "meshio"
version = "5.0.0"
version = "5.3.5"
description = "I/O for many mesh formats"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
license = {file = "LICENSE.txt"}
keywords = ["mesh", "file formats", "scientific", "engineering", "fem", "finite elements"]
keywords = [
"mesh",
"file formats",
"scientific",
"engineering",
"fem",
"finite elements"
]
authors = [
{email = "[email protected]"},
{name = "Nico Schlömer"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Utilities"
"Topic :: Utilities",
]
dependencies = [
"importlib_metadata; python_version<'3.8'",
"numpy>=1.20.0"
"numpy>=1.20.0",
"rich",
]

[project.optional-dependencies]
Expand All @@ -40,14 +53,13 @@ all = [
homepage = "https://github.com/nschloe/meshio"
code = "https://github.com/nschloe/meshio"
issues = "https://github.com/nschloe/meshio/issues"
funding = "https://github.com/sponsors/nschloe"

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

[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[tool.isort]
profile = "black"

# [options.data_files]
# share/paraview-5.9/plugins =
# tools/paraview-meshio-plugin.py
60 changes: 0 additions & 60 deletions setup.cfg

This file was deleted.

1 change: 1 addition & 0 deletions src/meshio/abaqus/_abaqus.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
I/O for Abaqus inp files.
"""

import pathlib
from itertools import count

Expand Down
1 change: 1 addition & 0 deletions src/meshio/ansys/_ansys.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<https://romeo.univ-reims.fr/documents/fluent/tgrid/ug/appb.pdf>
"""

import re

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/meshio/avsucd/_avsucd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
I/O for AVS-UCD format, cf.
<https://lanl.github.io/LaGriT/pages/docs/read_avs.html>.
"""

import numpy as np

from ..__about__ import __version__ as version
Expand Down
1 change: 1 addition & 0 deletions src/meshio/cgns/_cgns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
TODO link to specification?
"""

import numpy as np

from .._exceptions import ReadError
Expand Down
1 change: 1 addition & 0 deletions src/meshio/dolfin/_dolfin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
I/O for DOLFIN's XML format, cf.
<https://people.sc.fsu.edu/~jburkardt/data/dolfin_xml/dolfin_xml.html>.
"""

import os
import pathlib
import re
Expand Down
1 change: 1 addition & 0 deletions src/meshio/exodus/_exodus.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<https://src.fedoraproject.org/repo/pkgs/exodusii/922137.pdf/a45d67f4a1a8762bcf66af2ec6eb35f9/922137.pdf>,
in particular Appendix A (page 171, Implementation of EXODUS II with netCDF).
"""

import datetime
import re

Expand Down
2 changes: 2 additions & 0 deletions src/meshio/flac3d/_flac3d.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
I/O for FLAC3D format.
"""

from __future__ import annotations

import re
Expand Down Expand Up @@ -534,6 +535,7 @@ def _translate_zcells(points, cells):
normal vectors). Reorder corner points according to sign of scalar triple
products.
"""

# See <https://stackoverflow.com/a/42386330/353337>
def slicing_summing(a, b, c):
c0 = b[:, 1] * c[:, 2] - b[:, 2] * c[:, 1]
Expand Down
1 change: 1 addition & 0 deletions src/meshio/gmsh/_gmsh22.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
I/O for Gmsh's msh format, cf.
<http://gmsh.info//doc/texinfo/gmsh.html#File-formats>.
"""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/meshio/gmsh/_gmsh40.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
I/O for Gmsh's msh format (version 4.0, as used by Gmsh 4.1.5), cf.
<http://gmsh.info//doc/texinfo/gmsh.html#MSH-file-format-_0028version-4_0029>.
"""

from __future__ import annotations

from functools import partial
Expand Down
17 changes: 10 additions & 7 deletions src/meshio/gmsh/_gmsh41.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
I/O for Gmsh's msh format (version 4.1, as used by Gmsh 4.2.2+), cf.
<http://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format>.
"""

from functools import partial

import numpy as np
Expand Down Expand Up @@ -209,13 +210,15 @@ def _read_elements(
(num_ele,) = fromfile(f, c_size_t, 1)
for physical_name, cell_set in cell_sets.items():
cell_set[k] = np.arange(
num_ele
if (
physical_tags
and field_data[physical_name][1] == dim
and field_data[physical_name][0] in physical_tags[dim][tag]
)
else 0,
(
num_ele
if (
physical_tags
and field_data[physical_name][1] == dim
and field_data[physical_name][0] in physical_tags[dim][tag]
)
else 0
),
dtype=type(num_ele),
)
tpe = _gmsh_to_meshio_type[type_ele]
Expand Down
1 change: 1 addition & 0 deletions src/meshio/h5m/_h5m.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
I/O for h5m, cf.
<https://www.mcs.anl.gov/~fathom/moab-docs/html/h5mmain.html>.
"""

from datetime import datetime

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions src/meshio/mdpa/_mdpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The MDPA format is unsuitable for fast consumption, this is why:
<https://github.com/KratosMultiphysics/Kratos/issues/5365>.
"""

import numpy as np

from .._common import num_nodes_per_cell, raw_from_cell_data, warn
Expand Down
Loading

0 comments on commit b2ee998

Please sign in to comment.