Skip to content

Commit 5f0291b

Browse files
authored
Merge pull request #61 from nschloe/modernize
Modernize
2 parents 9583d2b + ea314aa commit 5f0291b

File tree

13 files changed

+50
-114
lines changed

13 files changed

+50
-114
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: ci
22

3-
on: [push]
3+
on: [pull_request]
44

55
jobs:
66
lint:

.travis.yml

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016-2019 Nico Schlömer
3+
Copyright (c) 2016-2020 Nico Schlömer
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ tag:
88
@echo "Tagging v$(VERSION)..."
99
git tag v$(VERSION)
1010
git push --tags
11+
curl -H "Authorization: token `cat $(HOME)/.github-access-token`" -d '{"tag_name": "$(VERSION)"}' https://api.github.com/repos/nschloe/pygalmesh/releases
1112

1213
upload: setup.py
1314
# Make sure we're on the master branch

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
[![CircleCI](https://img.shields.io/circleci/project/github/nschloe/pygalmesh/master.svg?style=flat-square)](https://circleci.com/gh/nschloe/pygalmesh/tree/master)
77
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
88
[![PyPi Version](https://img.shields.io/pypi/v/pygalmesh.svg?style=flat-square)](https://pypi.org/project/pygalmesh)
9+
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pygalmesh.svg?style=flat-square)](https://pypi.org/pypi/pygalmesh/)
910
[![Debian CI](https://badges.debian.net/badges/debian/testing/python3-pygalmesh/version.svg?style=flat-square)](https://tracker.debian.org/pkg/python3-pygalmesh)
1011
[![GitHub stars](https://img.shields.io/github/stars/nschloe/pygalmesh.svg?style=flat-square&label=Stars&logo=github)](https://github.com/nschloe/pygalmesh)
1112
[![PyPi downloads](https://img.shields.io/pypi/dm/pygalmesh.svg?style=flat-square)](https://pypistats.org/packages/pygalmesh)
13+
[![Slack](https://img.shields.io/static/v1?logo=slack&label=chat&message=on%20slack&color=4a154b&style=flat-square)](https://app.slack.com/client/TTL6Q54A3/CTLHRPYLF)
1214

1315
pygalmesh is a Python frontend to [CGAL](https://www.cgal.org/)'s [3D mesh generation
1416
capabilities](https://doc.cgal.org/latest/Mesh_3/index.html).
@@ -201,8 +203,7 @@ e.g.,
201203
import pygalmesh
202204
class Heart(pygalmesh.DomainBase):
203205
def __init__(self):
204-
super(Heart, self).__init__()
205-
return
206+
super().__init__()
206207

207208
def eval(self, x):
208209
return (x[0]**2 + 9.0/4.0 * x[1]**2 + x[2]**2 - 1)**3 \
@@ -272,8 +273,7 @@ import pygalmesh
272273

273274
class Schwarz(pygalmesh.DomainBase):
274275
def __init__(self):
275-
super(Schwarz, self).__init__()
276-
return
276+
super().__init__()
277277

278278
def eval(self, x):
279279
x2 = numpy.cos(x[0] * 2 * numpy.pi)
@@ -353,11 +353,11 @@ sudo apt install libcgal-dev libeigen3-dev
353353
After that, pygalmesh can be [installed from the Python Package
354354
Index](https://pypi.org/project/pygalmesh/), so with
355355
```
356-
pip3 install -U pygalmesh
356+
pip install -U pygalmesh
357357
```
358358
you can install/upgrade.
359359

360-
[meshio](https://github.com/nschloe/meshio) (`pip3 install meshio`)
360+
[meshio](https://github.com/nschloe/meshio) (`pip install meshio`)
361361
can be helpful in processing the meshes.
362362

363363
#### Manual installation

pygalmesh/__about__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
__author__ = "Nico Schlömer"
22
__author_email__ = "nico.schloemer@gmail.com"
3-
__copyright__ = "Copyright (C) 2016-2019 {} <{}>".format(__author__, __author_email__)
3+
__copyright__ = "Copyright (C) 2016-2020 {} <{}>".format(__author__, __author_email__)
44
__license__ = "License :: OSI Approved :: MIT License"
5-
__version__ = "0.5.0"
5+
__version__ = "0.5.1"
66
__maintainer__ = "Nico Schlömer"
77
__status__ = "Development Status :: 4 - Beta"
88
__url__ = "https://github.com/nschloe/pygalmesh"

pygalmesh/cli.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def volume_from_surface(argv=None):
4343
verbose=not args.quiet,
4444
)
4545
meshio.write(args.outfile, mesh)
46-
return
4746

4847

4948
def _get_volume_from_surface_parser():
@@ -157,7 +156,6 @@ def inr(argv=None):
157156
verbose=not args.quiet,
158157
)
159158
meshio.write(args.outfile, mesh)
160-
return
161159

162160

163161
def _get_inr_parser():

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
exec(handle.read(), about)
1111

1212

13-
class get_pybind_include(object):
13+
class get_pybind_include:
1414
"""Helper class to determine the pybind11 include path. The purpose of this class is
1515
to postpone importing pybind11 until it is actually installed, so that the
1616
``get_include()`` method can be invoked.
@@ -63,7 +63,7 @@ def read(fname):
6363
author=about["__author__"],
6464
author_email=about["__author_email__"],
6565
setup_requires=["pybind11 >= 2.2"],
66-
install_requires=["meshio", "numpy", "pybind11 >= 2.2"],
66+
install_requires=["meshio >= 4.0.0, < 5.0.0", "numpy", "pybind11 >= 2.2"],
6767
python_requires=">=3",
6868
description="Python frontend to CGAL's 3D mesh generation capabilities",
6969
long_description=read("README.md"),
@@ -73,8 +73,10 @@ def read(fname):
7373
about["__status__"],
7474
about["__license__"],
7575
"Operating System :: OS Independent",
76-
"Programming Language :: Python",
77-
"Programming Language :: Python :: 3",
76+
"Programming Language :: Python :: 3.5",
77+
"Programming Language :: Python :: 3.6",
78+
"Programming Language :: Python :: 3.7",
79+
"Programming Language :: Python :: 3.8",
7880
"Topic :: Scientific/Engineering",
7981
"Topic :: Scientific/Engineering :: Mathematics",
8082
"Topic :: Scientific/Engineering :: Physics",

test/test_inr.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def test_inr():
1919
assert abs(max(mesh.points[:, 2]) - ref[4]) < tol * ref[4]
2020
assert abs(min(mesh.points[:, 2]) - ref[5]) < tol * ref[5]
2121

22-
vol = sum(helpers.compute_volumes(mesh.points, mesh.cells["tetra"]))
22+
vol = sum(helpers.compute_volumes(mesh.points, mesh.get_cells_type("tetra")))
2323
ref = 2.725335e06
24-
assert abs(vol - ref) < ref * 1.0e-3
25-
return
24+
# Debian needs 2.0e-2 here.
25+
# <https://github.com/nschloe/pygalmesh/issues/60>
26+
assert abs(vol - ref) < ref * 2.0e-2

test/test_periodic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
def test_schwarz():
77
class Schwarz(pygalmesh.DomainBase):
88
def __init__(self):
9-
super(Schwarz, self).__init__()
10-
return
9+
super().__init__()
1110

1211
def eval(self, x):
1312
x2 = numpy.cos(x[0] * 2 * numpy.pi)

0 commit comments

Comments
 (0)