Skip to content

Commit

Permalink
Merge branch 'release/3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wolph committed Nov 25, 2024
2 parents fd1b497 + 2b6fcf2 commit 0f250e5
Show file tree
Hide file tree
Showing 31 changed files with 1,166 additions and 900 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11', '3.12']
numpy-version: ['numpy1', 'numpy2']

steps:
- uses: actions/checkout@v3
Expand All @@ -23,5 +24,14 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: python version
env:
TOXENV: "py${{ matrix.python }}-${{ matrix.numpy-version }}"
run: |
TOXENV=${{ env.TOXENV }}
TOXENV=${TOXENV//.} # replace all dots
echo TOXENV=${TOXENV} >> $GITHUB_ENV # update GitHub ENV vars
- name: print env
run: echo ${{ env.TOXENV }}
- name: Test with tox
run: tox
33 changes: 33 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,39 @@ Extending Mesh objects
# Show the plot to the screen
pyplot.show()
Creating a single triangle
----------------------------------

.. code-block:: python
import numpy
from stl import mesh
# A unit triangle
tri_vectors = [[0,0,0],[0,1,0],[0,0,1]]
# Create the vector data. It’s a numpy structured array with N entries, where N is the number of triangles (here N=1), and each entry is in the format ('normals','vectors','attr')
data = numpy.array([(
0, # Set 'normals' to zero, and the mesh class will automatically calculate them at initialization
tri_vectors, # 'vectors'
0 # 'attr'
)], dtype = mesh.Mesh.dtype) # The structure defined by the mesh class (N x ('normals','vectors','attr'))
# Create the mesh object from the structured array
tri_mesh = mesh.Mesh(data)
# Optionally make a plot for fun
# Load the plot tools
from matplotlib import pyplot
from mpl_toolkits import mplot3d
# Create a new plot
figure = pyplot.figure()
axes = figure.add_subplot(projection='3d')
# Add mesh to plot
axes.add_collection3d(mplot3d.art3d.Poly3DCollection(tri_mesh.vectors)) # Just need the 'vectors' attribute for display
Creating Mesh objects from a list of vertices and faces
------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ install:
build: false # Not a C# project, build stuff at the test step instead.

before_test:
- py -m pip install tox numpy cython wheel
- py -m pip install tox numpy cython wheel setuptools

test_script:
- "py -m tox -e %TOXENV%"
Expand Down
149 changes: 76 additions & 73 deletions docs/_theme/flask_theme_support.py
Original file line number Diff line number Diff line change
@@ -1,86 +1,89 @@
# flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
from pygments.token import (
Comment,
Error,
Generic,
Keyword,
Literal,
Name,
Number,
Operator,
Other,
Punctuation,
String,
Whitespace,
)


class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = ""
background_color = '#f8f8f8'
default_style = ''

styles = {
# No corresponding class for the following:
# Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#000000", # class 'x'

Comment: "italic #8f5902", # class: 'c'
Comment.Preproc: "noitalic", # class: 'cp'

Keyword: "bold #004461", # class: 'k'
Keyword.Constant: "bold #004461", # class: 'kc'
Keyword.Declaration: "bold #004461", # class: 'kd'
Keyword.Namespace: "bold #004461", # class: 'kn'
Keyword.Pseudo: "bold #004461", # class: 'kp'
Keyword.Reserved: "bold #004461", # class: 'kr'
Keyword.Type: "bold #004461", # class: 'kt'

Operator: "#582800", # class: 'o'
Operator.Word: "bold #004461", # class: 'ow' - like keywords

Punctuation: "bold #000000", # class: 'p'

Whitespace: 'underline #f8f8f8', # class: 'w'
Error: '#a40000 border:#ef2929', # class: 'err'
Other: '#000000', # class 'x'
Comment: 'italic #8f5902', # class: 'c'
Comment.Preproc: 'noitalic', # class: 'cp'
Keyword: 'bold #004461', # class: 'k'
Keyword.Constant: 'bold #004461', # class: 'kc'
Keyword.Declaration: 'bold #004461', # class: 'kd'
Keyword.Namespace: 'bold #004461', # class: 'kn'
Keyword.Pseudo: 'bold #004461', # class: 'kp'
Keyword.Reserved: 'bold #004461', # class: 'kr'
Keyword.Type: 'bold #004461', # class: 'kt'
Operator: '#582800', # class: 'o'
Operator.Word: 'bold #004461', # class: 'ow' - like keywords
Punctuation: 'bold #000000', # class: 'p'
# because special names such as Name.Class, Name.Function, etc.
# are not recognized as such later in the parsing, we choose them
# to look the same as ordinary variables.
Name: "#000000", # class: 'n'
Name.Attribute: "#c4a000", # class: 'na' - to be revised
Name.Builtin: "#004461", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#000000", # class: 'nc' - to be revised
Name.Constant: "#000000", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "bold #cc0000", # class: 'ne'
Name.Function: "#000000", # class: 'nf'
Name.Property: "#000000", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#000000", # class: 'nn' - to be revised
Name.Other: "#000000", # class: 'nx'
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
Name.Variable: "#000000", # class: 'nv' - to be revised
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised

Number: "#990000", # class: 'm'

Literal: "#000000", # class: 'l'
Literal.Date: "#000000", # class: 'ld'

String: "#4e9a06", # class: 's'
String.Backtick: "#4e9a06", # class: 'sb'
String.Char: "#4e9a06", # class: 'sc'
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
String.Double: "#4e9a06", # class: 's2'
String.Escape: "#4e9a06", # class: 'se'
String.Heredoc: "#4e9a06", # class: 'sh'
String.Interpol: "#4e9a06", # class: 'si'
String.Other: "#4e9a06", # class: 'sx'
String.Regex: "#4e9a06", # class: 'sr'
String.Single: "#4e9a06", # class: 's1'
String.Symbol: "#4e9a06", # class: 'ss'

Generic: "#000000", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #000000", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "bold #000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #000000", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
Name: '#000000', # class: 'n'
Name.Attribute: '#c4a000', # class: 'na' - to be revised
Name.Builtin: '#004461', # class: 'nb'
Name.Builtin.Pseudo: '#3465a4', # class: 'bp'
Name.Class: '#000000', # class: 'nc' - to be revised
Name.Constant: '#000000', # class: 'no' - to be revised
Name.Decorator: '#888', # class: 'nd' - to be revised
Name.Entity: '#ce5c00', # class: 'ni'
Name.Exception: 'bold #cc0000', # class: 'ne'
Name.Function: '#000000', # class: 'nf'
Name.Property: '#000000', # class: 'py'
Name.Label: '#f57900', # class: 'nl'
Name.Namespace: '#000000', # class: 'nn' - to be revised
Name.Other: '#000000', # class: 'nx'
Name.Tag: 'bold #004461', # class: 'nt' - like a keyword
Name.Variable: '#000000', # class: 'nv' - to be revised
Name.Variable.Class: '#000000', # class: 'vc' - to be revised
Name.Variable.Global: '#000000', # class: 'vg' - to be revised
Name.Variable.Instance: '#000000', # class: 'vi' - to be revised
Number: '#990000', # class: 'm'
Literal: '#000000', # class: 'l'
Literal.Date: '#000000', # class: 'ld'
String: '#4e9a06', # class: 's'
String.Backtick: '#4e9a06', # class: 'sb'
String.Char: '#4e9a06', # class: 'sc'
String.Doc: 'italic #8f5902', # class: 'sd' - like a comment
String.Double: '#4e9a06', # class: 's2'
String.Escape: '#4e9a06', # class: 'se'
String.Heredoc: '#4e9a06', # class: 'sh'
String.Interpol: '#4e9a06', # class: 'si'
String.Other: '#4e9a06', # class: 'sx'
String.Regex: '#4e9a06', # class: 'sr'
String.Single: '#4e9a06', # class: 's1'
String.Symbol: '#4e9a06', # class: 'ss'
Generic: '#000000', # class: 'g'
Generic.Deleted: '#a40000', # class: 'gd'
Generic.Emph: 'italic #000000', # class: 'ge'
Generic.Error: '#ef2929', # class: 'gr'
Generic.Heading: 'bold #000080', # class: 'gh'
Generic.Inserted: '#00A000', # class: 'gi'
Generic.Output: '#888', # class: 'go'
Generic.Prompt: '#745334', # class: 'gp'
Generic.Strong: 'bold #000000', # class: 'gs'
Generic.Subheading: 'bold #800080', # class: 'gu'
Generic.Traceback: 'bold #a40000', # class: 'gt'
}
Loading

0 comments on commit 0f250e5

Please sign in to comment.