Skip to content

Commit

Permalink
Merge pull request #303 from nschloe/slack-badge
Browse files Browse the repository at this point in the history
add slack badge
  • Loading branch information
nschloe authored Feb 11, 2020
2 parents d6eebb4 + aaf1240 commit e5216ff
Show file tree
Hide file tree
Showing 53 changed files with 157 additions and 154 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ci

on: [push]
on: [pull_request]

jobs:
lint:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ black:
black .

lint:
flake8 setup.py pygmsh/ test/*.py
flake8 .
black --check .
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
12 changes: 6 additions & 6 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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-2020, 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -298,7 +298,7 @@
(
master_doc,
"pygmsh",
u"pygmsh Documentation",
"pygmsh Documentation",
author,
"pygmsh",
"Python interface for Gmsh",
Expand Down
2 changes: 1 addition & 1 deletion pygmsh/__about__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__version__ = "6.0.2"
__author__ = "Nico Schlömer"
__author_email__ = "[email protected]"
__copyright__ = "Copyright (c) 2013-2019, {} <{}>".format(__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"
4 changes: 2 additions & 2 deletions pygmsh/built_in/bspline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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])
),
Expand Down
4 changes: 2 additions & 2 deletions pygmsh/built_in/circle_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
),
Expand Down
4 changes: 2 additions & 2 deletions pygmsh/built_in/compound_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
),
Expand Down
4 changes: 2 additions & 2 deletions pygmsh/built_in/compound_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
),
Expand Down
6 changes: 3 additions & 3 deletions pygmsh/built_in/compound_volume.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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])
),
Expand Down
12 changes: 6 additions & 6 deletions pygmsh/built_in/define_constant.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pygmsh/built_in/dummy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Dummy(object):
class Dummy:
def __init__(self, id0):
self.id = id0
return
4 changes: 2 additions & 2 deletions pygmsh/built_in/ellipse_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
),
Expand Down
Loading

0 comments on commit e5216ff

Please sign in to comment.