From 8749a115b511a02f8d6e56a3f966bc16db03336d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Tue, 11 Feb 2020 14:09:18 +0100 Subject: [PATCH 1/4] add slack badge --- .github/workflows/ci.yml | 3 +-- README.md | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dc96442..0480bc4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: ci -on: [push] +on: [pull_request] jobs: lint: @@ -12,7 +12,6 @@ jobs: - uses: actions/checkout@v1 - name: Lint with flake8 run: | - pip install --upgrade pip pip install flake8 flake8 . - name: Lint with black diff --git a/README.md b/README.md index 9c6585ec..76b460a1 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1173105.svg?style=flat-square)](https://doi.org/10.5281/zenodo.1173105) [![GitHub stars](https://img.shields.io/github/stars/nschloe/pygmsh.svg?style=flat-square&logo=github&label=Stars&logoColor=white)](https://github.com/nschloe/pygmsh) [![PyPi downloads](https://img.shields.io/pypi/dm/pygmsh.svg?style=flat-square)](https://pypistats.org/packages/pygmsh) +[![Slack](https://img.shields.io/static/v1?logo=slack&label=slack&message=chat&color=4a154b&style=flat-square)](https://app.slack.com/client/TTL6Q54A3/CTLGZQFML/) [Gmsh](https://gmsh.info/) is a powerful mesh generation tool with a scripting language that is notoriously hard to write. @@ -108,7 +109,7 @@ mesh = pygmsh.generate_mesh(geom) pygmsh is [available from the Python Package Index](https://pypi.org/project/pygmsh/), so simply type ``` -pip3 install pygmsh --user +pip install pygmsh ``` to install. Also make sure to have [gmsh](http://gmsh.info/) installed. From 223db51a2ee29cb8b44a474faea4c7feb3fa4350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Tue, 11 Feb 2020 14:11:45 +0100 Subject: [PATCH 2/4] make format --- test/test_logo.py | 1 + test/test_meshio_logo.py | 1 + test/test_opencascade_ball.py | 1 + test/test_opencascade_boolean.py | 1 + test/test_opencascade_box.py | 1 + test/test_opencascade_cone.py | 1 + test/test_opencascade_cylinder.py | 1 + test/test_opencascade_ellipsoid.py | 1 + test/test_opencascade_extrude.py | 1 + test/test_opencascade_torus.py | 1 + test/test_opencascade_wedge.py | 1 + 11 files changed, 11 insertions(+) diff --git a/test/test_logo.py b/test/test_logo.py index 7b91db15..1809b584 100644 --- a/test/test_logo.py +++ b/test/test_logo.py @@ -1,4 +1,5 @@ import pytest + import pygmsh from helpers import compute_volume diff --git a/test/test_meshio_logo.py b/test/test_meshio_logo.py index 7301c27e..17bf471d 100644 --- a/test/test_meshio_logo.py +++ b/test/test_meshio_logo.py @@ -1,4 +1,5 @@ import pytest + import pygmsh from helpers import compute_volume diff --git a/test/test_opencascade_ball.py b/test/test_opencascade_ball.py index 23ee4d2c..5e5fbf92 100644 --- a/test/test_opencascade_ball.py +++ b/test/test_opencascade_ball.py @@ -1,4 +1,5 @@ from math import pi + import pytest import pygmsh diff --git a/test/test_opencascade_boolean.py b/test/test_opencascade_boolean.py index 7c0f129c..32f8b644 100644 --- a/test/test_opencascade_boolean.py +++ b/test/test_opencascade_boolean.py @@ -1,4 +1,5 @@ import pytest + import pygmsh from helpers import compute_volume diff --git a/test/test_opencascade_box.py b/test/test_opencascade_box.py index c730ca17..1e053c8f 100644 --- a/test/test_opencascade_box.py +++ b/test/test_opencascade_box.py @@ -1,4 +1,5 @@ import pytest + import pygmsh from helpers import compute_volume diff --git a/test/test_opencascade_cone.py b/test/test_opencascade_cone.py index b8608918..6ceef781 100644 --- a/test/test_opencascade_cone.py +++ b/test/test_opencascade_cone.py @@ -1,4 +1,5 @@ from math import pi + import pytest import pygmsh diff --git a/test/test_opencascade_cylinder.py b/test/test_opencascade_cylinder.py index 65c613cd..5011a874 100644 --- a/test/test_opencascade_cylinder.py +++ b/test/test_opencascade_cylinder.py @@ -1,4 +1,5 @@ from math import pi + import pytest import pygmsh diff --git a/test/test_opencascade_ellipsoid.py b/test/test_opencascade_ellipsoid.py index 76e8292e..f255386a 100644 --- a/test/test_opencascade_ellipsoid.py +++ b/test/test_opencascade_ellipsoid.py @@ -1,4 +1,5 @@ from math import pi + import pytest import pygmsh diff --git a/test/test_opencascade_extrude.py b/test/test_opencascade_extrude.py index 4d497b53..c4f28917 100644 --- a/test/test_opencascade_extrude.py +++ b/test/test_opencascade_extrude.py @@ -1,4 +1,5 @@ import pytest + import pygmsh from helpers import compute_volume diff --git a/test/test_opencascade_torus.py b/test/test_opencascade_torus.py index e155fc4a..057bf776 100644 --- a/test/test_opencascade_torus.py +++ b/test/test_opencascade_torus.py @@ -1,4 +1,5 @@ from math import pi + import pytest import pygmsh diff --git a/test/test_opencascade_wedge.py b/test/test_opencascade_wedge.py index 3b06f82c..8ff323ea 100644 --- a/test/test_opencascade_wedge.py +++ b/test/test_opencascade_wedge.py @@ -1,4 +1,5 @@ import pytest + import pygmsh from helpers import compute_volume From dce1c6f27c13fd405b1774ce5d5d6fd76ebbd198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Tue, 11 Feb 2020 14:12:51 +0100 Subject: [PATCH 3/4] require python 3.6 --- Makefile | 2 +- doc/conf.py | 12 ++--- pygmsh/__about__.py | 2 +- pygmsh/built_in/bspline.py | 4 +- pygmsh/built_in/circle_arc.py | 4 +- pygmsh/built_in/compound_line.py | 4 +- pygmsh/built_in/compound_surface.py | 4 +- pygmsh/built_in/compound_volume.py | 6 +-- pygmsh/built_in/define_constant.py | 12 ++--- pygmsh/built_in/dummy.py | 2 +- pygmsh/built_in/ellipse_arc.py | 4 +- pygmsh/built_in/geometry.py | 68 ++++++++++++++--------------- pygmsh/built_in/line.py | 7 +-- pygmsh/built_in/line_base.py | 4 +- pygmsh/built_in/line_loop.py | 6 +-- pygmsh/built_in/plane_surface.py | 4 +- pygmsh/built_in/point.py | 4 +- pygmsh/built_in/point_base.py | 4 +- pygmsh/built_in/spline.py | 4 +- pygmsh/built_in/surface.py | 9 ++-- pygmsh/built_in/surface_base.py | 4 +- pygmsh/built_in/surface_loop.py | 6 +-- pygmsh/built_in/volume.py | 4 +- pygmsh/built_in/volume_base.py | 4 +- pygmsh/helpers.py | 19 +++++--- pygmsh/opencascade/ball.py | 6 +-- pygmsh/opencascade/box.py | 6 +-- pygmsh/opencascade/cone.py | 6 +-- pygmsh/opencascade/cylinder.py | 10 ++--- pygmsh/opencascade/disk.py | 6 +-- pygmsh/opencascade/geometry.py | 16 +++---- pygmsh/opencascade/rectangle.py | 9 ++-- pygmsh/opencascade/surface_base.py | 6 +-- pygmsh/opencascade/torus.py | 6 +-- pygmsh/opencascade/volume_base.py | 6 +-- pygmsh/opencascade/wedge.py | 6 +-- setup.py | 2 +- test/test_airfoil.py | 2 +- test/test_booleans.py | 2 +- 39 files changed, 142 insertions(+), 150 deletions(-) diff --git a/Makefile b/Makefile index 41a8a7b3..17bc29cc 100644 --- a/Makefile +++ b/Makefile @@ -33,5 +33,5 @@ black: black . lint: - flake8 setup.py pygmsh/ test/*.py + flake8 . black --check . diff --git a/doc/conf.py b/doc/conf.py index 9afe9465..5c122fee 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -69,9 +69,9 @@ master_doc = "index" # General information about the project. -project = u"pygmsh" -copyright = u"2015-2019, Nico Schlömer" -author = u"Nico Schlömer" +project = "pygmsh" +copyright = "2015-2019, Nico Schlömer" +author = "Nico Schlömer" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -255,7 +255,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, "pygmsh.tex", u"pygmsh Documentation", u"Nico Schlömer", "manual") + (master_doc, "pygmsh.tex", "pygmsh Documentation", "Nico Schlömer", "manual") ] # The name of an image file (relative to this directory) to place at the top of @@ -283,7 +283,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [(master_doc, "pygmsh", u"pygmsh Documentation", [author], 1)] +man_pages = [(master_doc, "pygmsh", "pygmsh Documentation", [author], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -298,7 +298,7 @@ ( master_doc, "pygmsh", - u"pygmsh Documentation", + "pygmsh Documentation", author, "pygmsh", "Python interface for Gmsh", diff --git a/pygmsh/__about__.py b/pygmsh/__about__.py index c1636524..d52ffbda 100644 --- a/pygmsh/__about__.py +++ b/pygmsh/__about__.py @@ -1,7 +1,7 @@ __version__ = "6.0.2" __author__ = "Nico Schlömer" __author_email__ = "nico.schloemer@gmail.com" -__copyright__ = "Copyright (c) 2013-2019, {} <{}>".format(__author__, __author_email__) +__copyright__ = f"Copyright (c) 2013-2019, {__author__} <{__author_email__}>" __website__ = "https://github.com/nschloe/pygmsh" __license__ = "License :: OSI Approved :: MIT License" __status__ = "Development Status :: 5 - Production/Stable" diff --git a/pygmsh/built_in/bspline.py b/pygmsh/built_in/bspline.py index 6ba67665..c564871f 100644 --- a/pygmsh/built_in/bspline.py +++ b/pygmsh/built_in/bspline.py @@ -13,7 +13,7 @@ class Bspline(LineBase): """ def __init__(self, control_points): - super(Bspline, self).__init__() + super().__init__() for c in control_points: assert isinstance(c, Point) @@ -23,7 +23,7 @@ def __init__(self, control_points): self.code = "\n".join( [ - "{} = newl;".format(self.id), + f"{self.id} = newl;", "BSpline({}) = {{{}}};".format( self.id, ", ".join([c.id for c in self.control_points]) ), diff --git a/pygmsh/built_in/circle_arc.py b/pygmsh/built_in/circle_arc.py index 2c394533..8cc3b732 100644 --- a/pygmsh/built_in/circle_arc.py +++ b/pygmsh/built_in/circle_arc.py @@ -17,7 +17,7 @@ class CircleArc(LineBase): """ def __init__(self, start, center, end): - super(CircleArc, self).__init__() + super().__init__() assert isinstance(start, Point) assert isinstance(center, Point) @@ -29,7 +29,7 @@ def __init__(self, start, center, end): self.code = "\n".join( [ - "{} = newl;".format(self.id), + f"{self.id} = newl;", "Circle({}) = {{{}, {}, {}}};".format( self.id, start.id, center.id, end.id ), diff --git a/pygmsh/built_in/compound_line.py b/pygmsh/built_in/compound_line.py index 03460e52..b81a03c9 100644 --- a/pygmsh/built_in/compound_line.py +++ b/pygmsh/built_in/compound_line.py @@ -15,13 +15,13 @@ class CompoundLine(LineBase): """ def __init__(self, lines): - super(CompoundLine, self).__init__() + super().__init__() self.lines = lines self.code = "\n".join( [ - "{} = newl;".format(self.id), + f"{self.id} = newl;", "Compound Line({}) = {{{}}};".format( self.id, ",".join([l.id for l in self.lines]) ), diff --git a/pygmsh/built_in/compound_surface.py b/pygmsh/built_in/compound_surface.py index 194812ee..828d9ea4 100644 --- a/pygmsh/built_in/compound_surface.py +++ b/pygmsh/built_in/compound_surface.py @@ -17,14 +17,14 @@ class CompoundSurface(SurfaceBase): """ def __init__(self, surfaces): - super(CompoundSurface, self).__init__() + super().__init__() self.num_edges = sum(s.num_edges for s in surfaces) self.surfaces = surfaces self.code = "\n".join( [ - "{} = news;".format(self.id), + f"{self.id} = news;", "Compound Surface({}) = {{{}}};".format( self.id, ",".join([s.id for s in surfaces]) ), diff --git a/pygmsh/built_in/compound_volume.py b/pygmsh/built_in/compound_volume.py index 165eaf62..acc4a700 100644 --- a/pygmsh/built_in/compound_volume.py +++ b/pygmsh/built_in/compound_volume.py @@ -1,4 +1,4 @@ -class CompoundVolume(object): +class CompoundVolume: """ Creates a compound volume from several elementary volumes. When meshed, a compound volume will be reparametrized as a @@ -16,12 +16,12 @@ class CompoundVolume(object): def __init__(self, volumes): self.volumes = volumes - self.id = "cv{}".format(CompoundVolume._ID) + self.id = f"cv{CompoundVolume._ID}" CompoundVolume._ID += 1 self.code = "\n".join( [ - "{} = newv;".format(self.id), + f"{self.id} = newv;", "Compound Volume({}) = {{{}}};".format( self.id, ",".join([v.id for v in volumes]) ), diff --git a/pygmsh/built_in/define_constant.py b/pygmsh/built_in/define_constant.py index 1d1eed97..640ccc59 100644 --- a/pygmsh/built_in/define_constant.py +++ b/pygmsh/built_in/define_constant.py @@ -1,20 +1,20 @@ -class DefineConstant(object): +class DefineConstant: def __init__(self, label, value, min_value, max_value, step=None, name=None): assert min_value <= value <= max_value self.label = label if name is None: - name = "Parameters/{}".format(label) + name = f"Parameters/{label}" - defined_constant = "{}, Min {}, Max {}".format(value, min_value, max_value) + defined_constant = f"{value}, Min {min_value}, Max {max_value}" if step: - defined_constant += ", Step {}".format(step) + defined_constant += f", Step {step}" - defined_constant += ', Name "{}"'.format(name) + defined_constant += f', Name "{name}"' - self.code = "DefineConstant[ {} = {{ {} }} ];".format(label, defined_constant) + self.code = f"DefineConstant[ {label} = {{ {defined_constant} }} ];" return # Need to overload repr so that the label will be formatted into gmsh code without any quotes diff --git a/pygmsh/built_in/dummy.py b/pygmsh/built_in/dummy.py index 8e26dcf3..3800ee85 100644 --- a/pygmsh/built_in/dummy.py +++ b/pygmsh/built_in/dummy.py @@ -1,4 +1,4 @@ -class Dummy(object): +class Dummy: def __init__(self, id0): self.id = id0 return diff --git a/pygmsh/built_in/ellipse_arc.py b/pygmsh/built_in/ellipse_arc.py index f794648a..bec590d8 100644 --- a/pygmsh/built_in/ellipse_arc.py +++ b/pygmsh/built_in/ellipse_arc.py @@ -19,7 +19,7 @@ class EllipseArc(LineBase): """ def __init__(self, start, center, point_on_major_axis, end): - super(EllipseArc, self).__init__() + super().__init__() assert isinstance(start, Point) assert isinstance(center, Point) @@ -33,7 +33,7 @@ def __init__(self, start, center, point_on_major_axis, end): self.code = "\n".join( [ - "{} = newl;".format(self.id), + f"{self.id} = newl;", "Ellipse({}) = {{{}, {}, {}, {}}};".format( self.id, start.id, center.id, point_on_major_axis.id, end.id ), diff --git a/pygmsh/built_in/geometry.py b/pygmsh/built_in/geometry.py index 2e98d78f..fba01c9d 100644 --- a/pygmsh/built_in/geometry.py +++ b/pygmsh/built_in/geometry.py @@ -26,7 +26,7 @@ from .volume_base import VolumeBase -class Geometry(object): +class Geometry: def __init__(self, gmsh_major_version=None): self._EXTRUDE_ID = 0 self._BOOLEAN_ID = 0 @@ -34,9 +34,7 @@ def __init__(self, gmsh_major_version=None): self._FIELD_ID = 0 self._GMSH_MAJOR = gmsh_major_version self._TAKEN_PHYSICALGROUP_IDS = [] - self._GMSH_CODE = [ - "// This code was created by pygmsh v{}.".format(__version__) - ] + self._GMSH_CODE = [f"// This code was created by pygmsh v{__version__}."] return def _gmsh_major(self): @@ -161,13 +159,13 @@ def _new_physical_group(self, label=None): if isinstance(label, int): assert ( label not in self._TAKEN_PHYSICALGROUP_IDS - ), "Physical group label {} already taken.".format(label) + ), f"Physical group label {label} already taken." self._TAKEN_PHYSICALGROUP_IDS += [label] return str(label) assert _is_string(label) self._TAKEN_PHYSICALGROUP_IDS += [max_id + 1] - return '"{}"'.format(label) + return f'"{label}"' def add_physical(self, entities, label=None): if not isinstance(entities, list): @@ -254,7 +252,7 @@ def set_transfinite_surface(self, surface, size=None, orientation=None): self.set_transfinite_lines( [surface.line_loop.lines[1], surface.line_loop.lines[3]], size[1] ) - code = "Transfinite Surface {{{}}}".format(surface.id) + code = f"Transfinite Surface {{{surface.id}}}" if orientation is not None: code += " " + orientation self._GMSH_CODE.append(code + ";") @@ -325,11 +323,11 @@ def add_circle( if make_surface: plane_surface = self.add_plane_surface(line_loop, holes) if compound and self._gmsh_major() == 4: - self.add_raw_code("Compound Surface{{{}}};".format(plane_surface.id)) + self.add_raw_code(f"Compound Surface{{{plane_surface.id}}};") else: plane_surface = None - class Circle(object): + class Circle: def __init__( self, x0, @@ -385,19 +383,19 @@ def extrude( if _is_string(input_entity): entity = Dummy(input_entity) elif isinstance(input_entity, PointBase): - entity = Dummy("Point{{{}}}".format(input_entity.id)) + entity = Dummy(f"Point{{{input_entity.id}}}") elif isinstance(input_entity, SurfaceBase): - entity = Dummy("Surface{{{}}}".format(input_entity.id)) + entity = Dummy(f"Surface{{{input_entity.id}}}") elif hasattr(input_entity, "surface"): - entity = Dummy("Surface{{{}}}".format(input_entity.surface.id)) + entity = Dummy(f"Surface{{{input_entity.surface.id}}}") else: assert isinstance(input_entity, LineBase), "Illegal extrude entity." - entity = Dummy("Line{{{}}}".format(input_entity.id)) + entity = Dummy(f"Line{{{input_entity.id}}}") extrusion_string = "" # out[] = Extrude{0,1,0}{ Line{1}; }; - name = "ex{}".format(self._EXTRUDE_ID) + name = f"ex{self._EXTRUDE_ID}" if translation_axis is not None: if rotation_axis is not None: extrusion_string += "{}[] = Extrude{{{{{}}}, {{{}}}, {{{}}}, {}}}{{{};".format( @@ -442,8 +440,8 @@ def extrude( # > list. This list will contain the "top" of the extruded surface (in # > out[0]) as well as the newly created volume (in out[1]). # - top = "{}[0]".format(name) - extruded = "{}[1]".format(name) + top = f"{name}[0]" + extruded = f"{name}[1]" if isinstance(input_entity, LineBase): top = LineBase(top) @@ -497,11 +495,11 @@ def add_boundary_layer( nodes_list = [] self._FIELD_ID += 1 - name = "field{}".format(self._FIELD_ID) + name = f"field{self._FIELD_ID}" - self._GMSH_CODE.append("{} = newf;".format(name)) + self._GMSH_CODE.append(f"{name} = newf;") - self._GMSH_CODE.append("Field[{}] = BoundaryLayer;".format(name)) + self._GMSH_CODE.append(f"Field[{name}] = BoundaryLayer;") if edges_list: self._GMSH_CODE.append( "Field[{}].EdgesList = {{{}}};".format( @@ -519,26 +517,26 @@ def add_boundary_layer( ) ) if hfar: - self._GMSH_CODE.append("Field[{}].hfar= {!r};".format(name, hfar)) + self._GMSH_CODE.append(f"Field[{name}].hfar= {hfar!r};") if hwall_n: - self._GMSH_CODE.append("Field[{}].hwall_n= {!r};".format(name, hwall_n)) + self._GMSH_CODE.append(f"Field[{name}].hwall_n= {hwall_n!r};") if ratio: - self._GMSH_CODE.append("Field[{}].ratio= {!r};".format(name, ratio)) + self._GMSH_CODE.append(f"Field[{name}].ratio= {ratio!r};") if thickness: - self._GMSH_CODE.append("Field[{}].thickness= {!r};".format(name, thickness)) + self._GMSH_CODE.append(f"Field[{name}].thickness= {thickness!r};") if anisomax: - self._GMSH_CODE.append("Field[{}].AnisoMax= {!r};".format(name, anisomax)) + self._GMSH_CODE.append(f"Field[{name}].AnisoMax= {anisomax!r};") return name def add_background_field(self, fields, aggregation_type="Min"): self._FIELD_ID += 1 - name = "field{}".format(self._FIELD_ID) - self._GMSH_CODE.append("{} = newf;".format(name)) - self._GMSH_CODE.append("Field[{}] = {};".format(name, aggregation_type)) + name = f"field{self._FIELD_ID}" + self._GMSH_CODE.append(f"{name} = newf;") + self._GMSH_CODE.append(f"Field[{name}] = {aggregation_type};") self._GMSH_CODE.append( "Field[{}].FieldsList = {{{}}};".format(name, ", ".join(fields)) ) - self._GMSH_CODE.append("Background Field = {};".format(name)) + self._GMSH_CODE.append(f"Background Field = {name};") return name def add_comment(self, string): @@ -566,7 +564,7 @@ def add_rectangle( make_surface=make_surface, ) - class Polygon(object): + class Polygon: def __init__(self, points, lines, line_loop, surface, lcar=None): self.points = points self.lines = lines @@ -595,7 +593,7 @@ def add_polygon(self, X, lcar=None, holes=None, make_surface=True): # Create lines lines = [self.add_line(p[k], p[k + 1]) for k in range(len(p) - 1)] lines.append(self.add_line(p[-1], p[0])) - ll = self.add_line_loop((lines)) + ll = self.add_line_loop(lines) surface = self.add_plane_surface(ll, holes) if make_surface else None return self.Polygon(p, lines, ll, surface, lcar=lcar) @@ -674,7 +672,7 @@ def add_ellipsoid(self, x0, radii, lcar=None, with_volume=True, holes=None): # Create volume. volume = self.add_volume(surface_loop, holes) if with_volume else None - class Ellipsoid(object): + class Ellipsoid: dimension = 3 def __init__(self, x0, radii, surface_loop, volume, lcar=None): @@ -741,7 +739,7 @@ def add_box(self, x0, x1, y0, y1, z0, z1, lcar=None, with_volume=True, holes=Non # Create volume vol = self.add_volume(surface_loop, holes) if with_volume else None - class Box(object): + class Box: def __init__(self, x0, x1, y0, y1, z0, z1, surface_loop, volume, lcar=None): self.x0 = x0 self.x1 = x1 @@ -869,7 +867,7 @@ def _add_torus_extrude_circle( previous, rotation_axis=rot_axis, point_on_axis=point_on_rot_axis, - angle="2*Pi/{}".format(num_steps), + angle=f"2*Pi/{num_steps}", ) previous = top all_volumes.append(vol) @@ -1025,7 +1023,7 @@ def symmetry(self, input_entity, coefficients, duplicate=True): entity = "{}{{{}}};".format(d[input_entity.dimension], input_entity.id) if duplicate: - entity = "Duplicata{{{}}}".format(entity) + entity = f"Duplicata{{{entity}}}" self._GMSH_CODE.append( "Symmetry {{{}}} {{{}}}".format( @@ -1038,5 +1036,5 @@ def in_surface(self, input_entity, surface): d = {0: "Point", 1: "Line"} entity = "{}{{{}}}".format(d[input_entity.dimension], input_entity.id) - self._GMSH_CODE.append("{} In Surface{{{}}};".format(entity, surface.id)) + self._GMSH_CODE.append(f"{entity} In Surface{{{surface.id}}};") return diff --git a/pygmsh/built_in/line.py b/pygmsh/built_in/line.py index a0c419bf..b740668e 100644 --- a/pygmsh/built_in/line.py +++ b/pygmsh/built_in/line.py @@ -22,16 +22,13 @@ class Line(LineBase): dimension = 1 def __init__(self, p0, p1): - super(Line, self).__init__() + super().__init__() assert isinstance(p0, Point) assert isinstance(p1, Point) self.points = [p0, p1] self.code = "\n".join( - [ - "{} = newl;".format(self.id), - "Line({}) = {{{}, {}}};".format(self.id, p0.id, p1.id), - ] + [f"{self.id} = newl;", f"Line({self.id}) = {{{p0.id}, {p1.id}}};"] ) return diff --git a/pygmsh/built_in/line_base.py b/pygmsh/built_in/line_base.py index 3d065638..9908481f 100644 --- a/pygmsh/built_in/line_base.py +++ b/pygmsh/built_in/line_base.py @@ -1,7 +1,7 @@ import copy -class LineBase(object): +class LineBase: """ Increments the Line ID every time a new object is created that inherits from LineBase. @@ -19,7 +19,7 @@ def __init__(self, id0=None): if id0: self.id = id0 else: - self.id = "l{}".format(LineBase._ID) + self.id = f"l{LineBase._ID}" LineBase._ID += 1 return diff --git a/pygmsh/built_in/line_loop.py b/pygmsh/built_in/line_loop.py index 6fd03141..6e513d96 100644 --- a/pygmsh/built_in/line_loop.py +++ b/pygmsh/built_in/line_loop.py @@ -1,4 +1,4 @@ -class LineLoop(object): +class LineLoop: """ Increments the Line ID every time a new object is created that inherits from LineBase. @@ -24,12 +24,12 @@ class LineLoop(object): def __init__(self, lines): self.lines = lines - self.id = "ll{}".format(LineLoop._ID) + self.id = f"ll{LineLoop._ID}" LineLoop._ID += 1 self.code = "\n".join( [ - "{} = newll;".format(self.id), + f"{self.id} = newll;", "Line Loop({}) = {{{}}};".format( self.id, ", ".join([l.id for l in lines]) ), diff --git a/pygmsh/built_in/plane_surface.py b/pygmsh/built_in/plane_surface.py index 79a2d735..f24c2b1e 100644 --- a/pygmsh/built_in/plane_surface.py +++ b/pygmsh/built_in/plane_surface.py @@ -29,7 +29,7 @@ class PlaneSurface(SurfaceBase): """ def __init__(self, line_loop, holes=None): - super(PlaneSurface, self).__init__() + super().__init__() assert isinstance(line_loop, LineLoop) self.line_loop = line_loop @@ -44,7 +44,7 @@ def __init__(self, line_loop, holes=None): line_loops = [self.line_loop] + self.holes self.code = "\n".join( [ - "{} = news;".format(self.id), + f"{self.id} = news;", "Plane Surface({}) = {{{}}};".format( self.id, ",".join([ll.id for ll in line_loops]) ), diff --git a/pygmsh/built_in/point.py b/pygmsh/built_in/point.py index beb4914b..57264abe 100644 --- a/pygmsh/built_in/point.py +++ b/pygmsh/built_in/point.py @@ -13,7 +13,7 @@ class Point(PointBase): """ def __init__(self, x, lcar=None): - super(Point, self).__init__() + super().__init__() self.x = x self.lcar = lcar @@ -24,7 +24,7 @@ def __init__(self, x, lcar=None): self.code = "\n".join( [ - "{} = newp;".format(self.id), + f"{self.id} = newp;", ("Point({}) = {{" + fmt + "}};").format(self.id, *args), ] ) diff --git a/pygmsh/built_in/point_base.py b/pygmsh/built_in/point_base.py index b1939ba4..94d9007a 100644 --- a/pygmsh/built_in/point_base.py +++ b/pygmsh/built_in/point_base.py @@ -1,4 +1,4 @@ -class PointBase(object): +class PointBase: """ Increments the Point ID every time a new object is created that inherits from PointBase. @@ -16,6 +16,6 @@ def __init__(self, id0=None): if id0: self.id = id0 else: - self.id = "p{}".format(PointBase._ID) + self.id = f"p{PointBase._ID}" PointBase._ID += 1 return diff --git a/pygmsh/built_in/spline.py b/pygmsh/built_in/spline.py index a350312b..02c58314 100644 --- a/pygmsh/built_in/spline.py +++ b/pygmsh/built_in/spline.py @@ -13,7 +13,7 @@ class Spline(LineBase): """ def __init__(self, points): - super(Spline, self).__init__() + super().__init__() for c in points: assert isinstance(c, Point) @@ -23,7 +23,7 @@ def __init__(self, points): self.code = "\n".join( [ - "{} = newl;".format(self.id), + f"{self.id} = newl;", "Spline({}) = {{{}}};".format( self.id, ", ".join([c.id for c in self.points]) ), diff --git a/pygmsh/built_in/surface.py b/pygmsh/built_in/surface.py index 62dbb3f2..c5c2090c 100644 --- a/pygmsh/built_in/surface.py +++ b/pygmsh/built_in/surface.py @@ -1,7 +1,7 @@ from .line_loop import LineLoop -class Surface(object): +class Surface: """ Generates a Surface or Rules Surfaces. @@ -33,17 +33,14 @@ def __init__(self, line_loop, api_level=2): self.line_loop = line_loop - self.id = "rs{}".format(Surface._ID) + self.id = f"rs{Surface._ID}" Surface._ID += 1 # `Ruled Surface` was deprecated in Gmsh 3 in favor of `Surface`. name = "Surface" if api_level > 2 else "Ruled Surface" self.code = "\n".join( - [ - "{} = news;".format(self.id), - "{}({}) = {{{}}};".format(name, self.id, self.line_loop.id), - ] + [f"{self.id} = news;", f"{name}({self.id}) = {{{self.line_loop.id}}};"] ) self.num_edges = len(line_loop) return diff --git a/pygmsh/built_in/surface_base.py b/pygmsh/built_in/surface_base.py index ce17f484..2f6e0632 100644 --- a/pygmsh/built_in/surface_base.py +++ b/pygmsh/built_in/surface_base.py @@ -1,4 +1,4 @@ -class SurfaceBase(object): +class SurfaceBase: """ Increments the Line ID every time a new object is created that inherits from LineBase. @@ -18,7 +18,7 @@ def __init__(self, id0=None, num_edges=0): assert isinstance(id0, str) self.id = id0 else: - self.id = "s{}".format(SurfaceBase._ID) + self.id = f"s{SurfaceBase._ID}" SurfaceBase._ID += 1 self.num_edges = num_edges return diff --git a/pygmsh/built_in/surface_loop.py b/pygmsh/built_in/surface_loop.py index 87c59ca8..f0b7c266 100644 --- a/pygmsh/built_in/surface_loop.py +++ b/pygmsh/built_in/surface_loop.py @@ -1,4 +1,4 @@ -class SurfaceLoop(object): +class SurfaceLoop: """ Creates a surface loop (a shell). Increments the Line ID every time a new object is created that inherits @@ -26,12 +26,12 @@ class SurfaceLoop(object): def __init__(self, surfaces): self.surfaces = surfaces - self.id = "sl{}".format(SurfaceLoop._ID) + self.id = f"sl{SurfaceLoop._ID}" SurfaceLoop._ID += 1 self.code = "\n".join( [ - "{} = news;".format(self.id), + f"{self.id} = news;", "Surface Loop({}) = {{{}}};".format( self.id, ",".join([s.id for s in surfaces]) ), diff --git a/pygmsh/built_in/volume.py b/pygmsh/built_in/volume.py index 3c389cc8..e0a4af84 100644 --- a/pygmsh/built_in/volume.py +++ b/pygmsh/built_in/volume.py @@ -28,7 +28,7 @@ class Volume(VolumeBase): """ def __init__(self, surface_loop, holes=None): - super(Volume, self).__init__() + super().__init__() if holes is None: holes = [] @@ -40,7 +40,7 @@ def __init__(self, surface_loop, holes=None): self.code = "\n".join( [ - "{} = newv;".format(self.id), + f"{self.id} = newv;", "Volume({}) = {{{}}};".format( self.id, ", ".join([s.id for s in surface_loops]) ), diff --git a/pygmsh/built_in/volume_base.py b/pygmsh/built_in/volume_base.py index 71359cf0..341a9984 100644 --- a/pygmsh/built_in/volume_base.py +++ b/pygmsh/built_in/volume_base.py @@ -1,4 +1,4 @@ -class VolumeBase(object): +class VolumeBase: """ Increments the Line ID every time a new object is created that inherits from LineBase. @@ -16,6 +16,6 @@ def __init__(self, id0=None): if id0: self.id = id0 else: - self.id = "vol{}".format(VolumeBase._ID) + self.id = f"vol{VolumeBase._ID}" VolumeBase._ID += 1 return diff --git a/pygmsh/helpers.py b/pygmsh/helpers.py index 49a5dc6b..55bb91c3 100644 --- a/pygmsh/helpers.py +++ b/pygmsh/helpers.py @@ -111,7 +111,7 @@ def generate_mesh( # noqa: C901 gmsh_executable = gmsh_path if gmsh_path is not None else _get_gmsh_exe() args = [ - "-{}".format(dim), + f"-{dim}", geo_filename, "-format", mesh_file_type, @@ -146,10 +146,15 @@ def generate_mesh( # noqa: C901 if remove_faces: # Only keep the cells of highest topological dimension; discard faces # and such. - two_d_cells = set(["triangle", "quad"]) - three_d_cells = set( - ["tetra", "hexahedron", "wedge", "pyramid", "penta_prism", "hexa_prism"] - ) + two_d_cells = {"triangle", "quad"} + three_d_cells = { + "tetra", + "hexahedron", + "wedge", + "pyramid", + "penta_prism", + "hexa_prism", + } if any(k in mesh.cells for k in three_d_cells): keep_keys = three_d_cells.intersection(mesh.cells.keys()) elif any(k in mesh.cells for k in two_d_cells): @@ -177,11 +182,11 @@ def generate_mesh( # noqa: C901 # clean up if preserve_msh: - print("\nmsh file: {}".format(msh_filename)) + print(f"\nmsh file: {msh_filename}") else: os.remove(msh_filename) if preserve_geo: - print("\ngeo file: {}".format(geo_filename)) + print(f"\ngeo file: {geo_filename}") else: os.remove(geo_filename) diff --git a/pygmsh/opencascade/ball.py b/pygmsh/opencascade/ball.py index cef40a9b..00eb1768 100644 --- a/pygmsh/opencascade/ball.py +++ b/pygmsh/opencascade/ball.py @@ -25,7 +25,7 @@ class Ball(VolumeBase): """ def __init__(self, center, radius, x0=None, x1=None, alpha=None, char_length=None): - super(Ball, self).__init__() + super().__init__() self.center = center self.radius = radius @@ -38,10 +38,10 @@ def __init__(self, center, radius, x0=None, x1=None, alpha=None, char_length=Non args.append(x1) if alpha is not None: args.append(alpha) - args = ", ".join(["{}".format(arg) for arg in args]) + args = ", ".join([f"{arg}" for arg in args]) self.code = "\n".join( - ["{} = newv;".format(self.id), "Sphere({}) = {{{}}};".format(self.id, args)] + [f"{self.id} = newv;", f"Sphere({self.id}) = {{{args}}};"] + self.char_length_code(char_length) ) return diff --git a/pygmsh/opencascade/box.py b/pygmsh/opencascade/box.py index 401aedc1..79515123 100644 --- a/pygmsh/opencascade/box.py +++ b/pygmsh/opencascade/box.py @@ -16,7 +16,7 @@ class Box(VolumeBase): """ def __init__(self, x0, extents, char_length=None): - super(Box, self).__init__() + super().__init__() assert len(x0) == 3 assert len(extents) == 3 @@ -26,10 +26,10 @@ def __init__(self, x0, extents, char_length=None): self.char_length = char_length args = list(x0) + list(extents) - args = ", ".join(["{}".format(arg) for arg in args]) + args = ", ".join([f"{arg}" for arg in args]) self.code = "\n".join( - ["{} = newv;".format(self.id), "Box({}) = {{{}}};".format(self.id, args)] + [f"{self.id} = newv;", f"Box({self.id}) = {{{args}}};"] + self.char_length_code(char_length) ) return diff --git a/pygmsh/opencascade/cone.py b/pygmsh/opencascade/cone.py index 889112fe..85919ab1 100644 --- a/pygmsh/opencascade/cone.py +++ b/pygmsh/opencascade/cone.py @@ -18,7 +18,7 @@ class Cone(VolumeBase): """ def __init__(self, center, axis, radius0, radius1, alpha=None, char_length=None): - super(Cone, self).__init__() + super().__init__() assert len(center) == 3 assert len(axis) == 3 @@ -32,10 +32,10 @@ def __init__(self, center, axis, radius0, radius1, alpha=None, char_length=None) args = list(center) + list(axis) + [radius0] + [radius1] if alpha is not None: args.append(alpha) - args = ", ".join(["{}".format(arg) for arg in args]) + args = ", ".join([f"{arg}" for arg in args]) self.code = "\n".join( - ["{} = newv;".format(self.id), "Cone({}) = {{{}}};".format(self.id, args)] + [f"{self.id} = newv;", f"Cone({self.id}) = {{{args}}};"] + self.char_length_code(char_length) ) return diff --git a/pygmsh/opencascade/cylinder.py b/pygmsh/opencascade/cylinder.py index 972e6e07..fec8b28c 100644 --- a/pygmsh/opencascade/cylinder.py +++ b/pygmsh/opencascade/cylinder.py @@ -20,7 +20,7 @@ class Cylinder(VolumeBase): """ def __init__(self, x0, axis, radius, angle=None, char_length=None): - super(Cylinder, self).__init__() + super().__init__() assert len(x0) == 3 assert len(axis) == 3 @@ -34,17 +34,17 @@ def __init__(self, x0, axis, radius, angle=None, char_length=None): args = list(x0) + list(axis) + [radius] if angle is not None: args.append(angle) - args = ", ".join(["{}".format(arg) for arg in args]) + args = ", ".join([f"{arg}" for arg in args]) code = [ - "{} = newv;".format(self.id), - "Cylinder({}) = {{{}}};".format(self.id, args), + f"{self.id} = newv;", + f"Cylinder({self.id}) = {{{args}}};", ] if self.char_length: code.extend( [ - "pts_{}[] = PointsOf{{Volume{{{}}};}};".format(self.id, self.id), + f"pts_{self.id}[] = PointsOf{{Volume{{{self.id}}};}};", "Characteristic Length{{pts_{}[]}} = {};".format( self.id, char_length ), diff --git a/pygmsh/opencascade/disk.py b/pygmsh/opencascade/disk.py index 251b9531..141f2472 100644 --- a/pygmsh/opencascade/disk.py +++ b/pygmsh/opencascade/disk.py @@ -18,7 +18,7 @@ class Disk(SurfaceBase): """ def __init__(self, x0, radius0, radius1=None, char_length=None): - super(Disk, self).__init__() + super().__init__() assert len(x0) == 3 if radius1 is not None: @@ -33,10 +33,10 @@ def __init__(self, x0, radius0, radius1=None, char_length=None): if radius1 is not None: args.append(radius1) - args = ", ".join(["{}".format(arg) for arg in args]) + args = ", ".join([f"{arg}" for arg in args]) self.code = "\n".join( - ["{} = news;".format(self.id), "Disk({}) = {{{}}};".format(self.id, args)] + [f"{self.id} = news;", f"Disk({self.id}) = {{{args}}};"] + self.char_length_code(char_length) ) return diff --git a/pygmsh/opencascade/geometry.py b/pygmsh/opencascade/geometry.py index f35c7874..0e4fdac9 100644 --- a/pygmsh/opencascade/geometry.py +++ b/pygmsh/opencascade/geometry.py @@ -15,22 +15,22 @@ class Geometry(bl.Geometry): def __init__(self, characteristic_length_min=None, characteristic_length_max=None): - super(Geometry, self).__init__() + super().__init__() self._BOOLEAN_ID = 0 self._EXTRUDE_ID = 0 self._GMSH_CODE = [ - "// This code was created by pygmsh v{}.".format(__version__), + f"// This code was created by pygmsh v{__version__}.", 'SetFactory("OpenCASCADE");', ] if characteristic_length_min is not None: self._GMSH_CODE.append( - "Mesh.CharacteristicLengthMin = {};".format(characteristic_length_min) + f"Mesh.CharacteristicLengthMin = {characteristic_length_min};" ) if characteristic_length_max is not None: self._GMSH_CODE.append( - "Mesh.CharacteristicLengthMax = {};".format(characteristic_length_max) + f"Mesh.CharacteristicLengthMax = {characteristic_length_max};" ) return @@ -113,7 +113,7 @@ def _boolean_operation( e.dimension == dim ), "Incompatible input type '{}' for Boolean operation.".format(type(e)) - name = "bo{}".format(self._BOOLEAN_ID) + name = f"bo{self._BOOLEAN_ID}" input_delete = "Delete;" if delete_first else "" @@ -123,16 +123,14 @@ def _boolean_operation( if input_entities: formatted_input_entities = ( - ";".join(["%s{%s}" % (legal_dim_type, e.id) for e in input_entities]) - + ";" + ";".join([f"{legal_dim_type}{{{e.id}}}" for e in input_entities]) + ";" ) else: formatted_input_entities = "" if tool_entities: formatted_tool_entities = ( - ";".join(["%s{%s}" % (legal_dim_type, e.id) for e in tool_entities]) - + ";" + ";".join([f"{legal_dim_type}{{{e.id}}}" for e in tool_entities]) + ";" ) else: formatted_tool_entities = "" diff --git a/pygmsh/opencascade/rectangle.py b/pygmsh/opencascade/rectangle.py index ab07ddbe..04ef5d4e 100644 --- a/pygmsh/opencascade/rectangle.py +++ b/pygmsh/opencascade/rectangle.py @@ -18,7 +18,7 @@ class Rectangle(SurfaceBase): """ def __init__(self, x0, a, b, corner_radius=None, char_length=None): - super(Rectangle, self).__init__() + super().__init__() assert len(x0) == 3 @@ -32,13 +32,10 @@ def __init__(self, x0, a, b, corner_radius=None, char_length=None): if corner_radius is not None: args.append(corner_radius) - args = ", ".join(["{}".format(arg) for arg in args]) + args = ", ".join([f"{arg}" for arg in args]) self.code = "\n".join( - [ - "{} = news;".format(self.id), - "Rectangle({}) = {{{}}};".format(self.id, args), - ] + [f"{self.id} = news;", f"Rectangle({self.id}) = {{{args}}};"] + self.char_length_code(char_length) ) return diff --git a/pygmsh/opencascade/surface_base.py b/pygmsh/opencascade/surface_base.py index 9509c13f..188ded7f 100644 --- a/pygmsh/opencascade/surface_base.py +++ b/pygmsh/opencascade/surface_base.py @@ -11,7 +11,7 @@ class SurfaceBase(built_in.surface_base.SurfaceBase): dimension = 2 def __init__(self, is_list=False, id0=None): - super(SurfaceBase, self).__init__(id0=id0) + super().__init__(id0=id0) self.is_list = is_list if is_list: @@ -23,6 +23,6 @@ def char_length_code(self, char_length): return [] return [ - "pts_{}[] = PointsOf{{Surface{{{}}};}};".format(self.id, self.id), - "Characteristic Length{{pts_{}[]}} = {};".format(self.id, char_length), + f"pts_{self.id}[] = PointsOf{{Surface{{{self.id}}};}};", + f"Characteristic Length{{pts_{self.id}[]}} = {char_length};", ] diff --git a/pygmsh/opencascade/torus.py b/pygmsh/opencascade/torus.py index 3e191263..37288ef6 100644 --- a/pygmsh/opencascade/torus.py +++ b/pygmsh/opencascade/torus.py @@ -18,7 +18,7 @@ class Torus(VolumeBase): """ def __init__(self, center, radius0, radius1, alpha=None, char_length=None): - super(Torus, self).__init__() + super().__init__() assert len(center) == 3 @@ -31,10 +31,10 @@ def __init__(self, center, radius0, radius1, alpha=None, char_length=None): args = list(center) + [radius0] + [radius1] if alpha is not None: args.append(alpha) - args = ", ".join(["{}".format(arg) for arg in args]) + args = ", ".join([f"{arg}" for arg in args]) self.code = "\n".join( - ["{} = newv;".format(self.id), "Torus({}) = {{{}}};".format(self.id, args)] + [f"{self.id} = newv;", f"Torus({self.id}) = {{{args}}};"] + self.char_length_code(char_length) ) return diff --git a/pygmsh/opencascade/volume_base.py b/pygmsh/opencascade/volume_base.py index a05e8bb6..8cdf724d 100644 --- a/pygmsh/opencascade/volume_base.py +++ b/pygmsh/opencascade/volume_base.py @@ -11,7 +11,7 @@ class VolumeBase(built_in.volume_base.VolumeBase): dimension = 3 def __init__(self, is_list=False, id0=None): - super(VolumeBase, self).__init__(id0=id0) + super().__init__(id0=id0) self.is_list = is_list if is_list: @@ -23,6 +23,6 @@ def char_length_code(self, char_length): return [] return [ - "pts_{}[] = PointsOf{{Volume{{{}}};}};".format(self.id, self.id), - "Characteristic Length{{pts_{}[]}} = {};".format(self.id, char_length), + f"pts_{self.id}[] = PointsOf{{Volume{{{self.id}}};}};", + f"Characteristic Length{{pts_{self.id}[]}} = {char_length};", ] diff --git a/pygmsh/opencascade/wedge.py b/pygmsh/opencascade/wedge.py index 674cbc26..ef5575fa 100644 --- a/pygmsh/opencascade/wedge.py +++ b/pygmsh/opencascade/wedge.py @@ -16,7 +16,7 @@ class Wedge(VolumeBase): """ def __init__(self, x0, extents, top_extent=None, char_length=None): - super(Wedge, self).__init__() + super().__init__() self.x0 = x0 self.extents = extents @@ -26,10 +26,10 @@ def __init__(self, x0, extents, top_extent=None, char_length=None): args = list(x0) + list(extents) if top_extent is not None: args.append(top_extent) - args = ", ".join(["{}".format(arg) for arg in args]) + args = ", ".join([f"{arg}" for arg in args]) self.code = "\n".join( - ["{} = newv;".format(self.id), "Wedge({}) = {{{}}};".format(self.id, args)] + [f"{self.id} = newv;", f"Wedge({self.id}) = {{{args}}};"] + self.char_length_code(char_length) ) return diff --git a/setup.py b/setup.py index 559458b0..e8b79773 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def read(fname): license=about["__license__"], platforms="any", install_requires=["meshio >=3.0, <4.0", "numpy >= 1.9"], - python_requires=">=3", + python_requires=">=3.6", keywords=["mesh", "gmsh", "mesh generation", "mathematics"], classifiers=[ about["__status__"], diff --git a/test/test_airfoil.py b/test/test_airfoil.py index 8272ac8b..5ffbc01a 100644 --- a/test/test_airfoil.py +++ b/test/test_airfoil.py @@ -135,7 +135,7 @@ def test(): [[xmin, ymin, 0.0], [xmax, ymin, 0.0], [xmax, ymax, 0.0], [xmin, ymax, 0.0]] ) polygon = geom.add_polygon(domainCoordinates, char_length, holes=[airfoil]) - geom.add_raw_code("Recombine Surface {{{}}};".format(polygon.surface.id)) + geom.add_raw_code(f"Recombine Surface {{{polygon.surface.id}}};") ref = 10.525891646546 mesh = pygmsh.generate_mesh(geom, remove_faces=True) diff --git a/test/test_booleans.py b/test/test_booleans.py index 23b98a67..bf2c5ef8 100644 --- a/test/test_booleans.py +++ b/test/test_booleans.py @@ -147,7 +147,7 @@ def test_fragments_diff_union(): inner_cells["triangle"] = mesh.cells["triangle"][inner_mask] value = compute_volume(meshio.Mesh(mesh.points, outer_cells)) - assert np.abs((value - surf)) < 1e-2 * surf + assert np.abs(value - surf) < 1e-2 * surf return From aaf12400da03fb1ffd21cd2309d13ab68342f62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Tue, 11 Feb 2020 14:13:54 +0100 Subject: [PATCH 4/4] bump year --- LICENSE.txt | 2 +- doc/conf.py | 2 +- pygmsh/__about__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 5806654d..2341ef17 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2019 Nico Schlömer +Copyright (c) 2013-2020 Nico Schlömer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/doc/conf.py b/doc/conf.py index 5c122fee..3f16db6e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -70,7 +70,7 @@ # General information about the project. project = "pygmsh" -copyright = "2015-2019, Nico Schlömer" +copyright = "2015-2020, Nico Schlömer" author = "Nico Schlömer" # The version info for the project you're documenting, acts as replacement for diff --git a/pygmsh/__about__.py b/pygmsh/__about__.py index d52ffbda..2f0dc0f7 100644 --- a/pygmsh/__about__.py +++ b/pygmsh/__about__.py @@ -1,7 +1,7 @@ __version__ = "6.0.2" __author__ = "Nico Schlömer" __author_email__ = "nico.schloemer@gmail.com" -__copyright__ = f"Copyright (c) 2013-2019, {__author__} <{__author_email__}>" +__copyright__ = f"Copyright (c) 2013-2020, {__author__} <{__author_email__}>" __website__ = "https://github.com/nschloe/pygmsh" __license__ = "License :: OSI Approved :: MIT License" __status__ = "Development Status :: 5 - Production/Stable"