Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[bumpversion]
current_version = 0.6.1
commit = False
tag = True
message = Bump up to version {new_version}.

[bdist_wheel]
python-tag = py3

[bumpversion:file:coxeter/__init__.py]

[bumpversion:file:doc/source/conf.py]

[bumpversion:file:pyproject.toml]
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: &install
name: Install package
command: |
python -m pip install .[test] --progress-bar off --user
python -m pip install ".[tests]" --progress-bar off --user

- run: &run-tests
name: Run tests
Expand Down
24 changes: 22 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
*~
*.swp

# Packages
# OS Specific
.DS_Store

# Packaging
*.egg
*.egg-info*
dist
Expand All @@ -15,8 +18,25 @@ develop-eggs
.installed.cfg
lib
lib64

# Optimization
__pycache__
.hypothesis
*.pyc

# Unit tests
.coverage
.coverage.*
.hypothesis
.hypothesis/
.pytest_cache/

# Documentation
doc/source/bibtex.json

# Development tools
.ipynb_checkpoints
.spyderproject
.spyproject
*.sublime-workspace
.vscode
.code-workspace
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ repos:
hooks:
- id: nbqa-pyupgrade
args:
- --nbqa-mutate
- --py36-plus
- id: nbqa-isort
args:
- --nbqa-mutate
- id: nbqa-black
args:
- --nbqa-mutate
28 changes: 20 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,15 @@ To install from source, execute:

git clone https://github.com/glotzerlab/coxeter.git
cd coxeter
python setup.py install --user

To install the package, choose one of the following:

.. code:: bash

pip install . # Install with no additional dependencies
pip install .[tests] # RECOMMENDED: Install with dependencies required to run pytests
pip install .[tests,doc] # Install all dependencies required to develop for coxeter


Requirements
~~~~~~~~~~~~
Expand All @@ -94,19 +102,19 @@ Testing
The package is currently tested for Python >= 3.8 on Unix-like systems.
Continuous integrated testing is performed using CircleCI on these Python versions.

To run the packaged unit tests, execute the following line from the root of the repository:
First, install the packages required to test coxeter (if not already done):

.. code:: bash

pytest
pip install -r tests/requirements.txt

To check test coverage, make sure the coverage module is installed:
To run the packaged unit tests, execute the following line from the root of the repository:

.. code:: bash

pip install coverage
pytest

and then run the packaged unit tests with the coverage module:
To run the packaged unit tests with the coverage module:

.. code:: bash

Expand All @@ -115,13 +123,17 @@ and then run the packaged unit tests with the coverage module:
Building Documentation
----------------------

Documentation for coxeter is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`__ and compiled using `Sphinx <http://www.sphinx-doc.org/en/master/>`__.
To build the documentation, first install Sphinx:
Documentation for coxeter is written in `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ and compiled using `Sphinx <http://www.sphinx-doc.org/en/master/>`__.
To build the documentation, first install Sphinx and the other required packges:

.. code:: bash

cd doc
pip install -r requirements.txt
conda install -c conda-forge fresnel

.. warning::
The `fresnel <https://fresnel.readthedocs.io/en/v0.13.5/>`_ package on conda forge must be used. The PyPI package *fresnel* is different and will not function properly.

You can then use Sphinx to create the actual documentation in either PDF or HTML form by running the following commands in the coxeter root directory:

Expand Down
18 changes: 12 additions & 6 deletions coxeter/families/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def make_vertices(cls, n):
PlatonicFamily = TabulatedGSDShapeFamily.from_json_file(
os.path.join(_DATA_FOLDER, "platonic.json"),
classname="PlatonicFamily",
docstring="""The family of Platonic solids.
docstring="""The family of Platonic solids (5 total).

The following parameters are required by this class:

Expand All @@ -88,6 +88,7 @@ def make_vertices(cls, n):
os.path.join(_DATA_FOLDER, "archimedean.json"),
classname="ArchimedeanFamily",
docstring="""The family of Archimedean solids (13 total).

The following parameters are required by this class:
- name: The name of the ArchimedeanFamily solid. Options are "Cuboctahedron", \
"Icosidodecahedron", "Truncated Tetrahedron", "Truncated Octahedron", \
Expand All @@ -101,8 +102,9 @@ def make_vertices(cls, n):
CatalanFamily = TabulatedGSDShapeFamily.from_json_file(
os.path.join(_DATA_FOLDER, "catalan.json"),
classname="CatalanFamily",
docstring="""The family of Catalan solids, also known as Archimedean duals
docstring="""The family of Catalan solids, also known as Archimedean duals \
(13 total).

The following parameters are required by this class:
- name: The name of the CatalanFamily solid. Options are "Deltoidal \
Hexecontahedron", "Deltoidal Icositetrahedron", "Disdyakis \
Expand All @@ -117,10 +119,12 @@ def make_vertices(cls, n):
JohnsonFamily = TabulatedGSDShapeFamily.from_json_file(
os.path.join(_DATA_FOLDER, "johnson.json"),
classname="JohnsonFamily",
docstring="""The family of Johnson solids (92 total).
docstring="""The family of Johnson solids, as enumerated in \
:cite:`Johnson1966` (92 total).

The following parameters are required by this class:
- name: The name of the JohnsonFamily solid. A full list is available in \
10.1126/science.1220869: :cite:`Damasceno2012`. In general, shape names \
:cite:`Johnson1966`. In general, shape names \
should have the first character of each word capitalized, with spaces \
between words (e.g. "Elongated Triangular Cupola"). Pyramids and \
dipyramids are named from their base polygon (e.g. "Square Pyramid" \
Expand All @@ -133,7 +137,8 @@ def make_vertices(cls, n):
os.path.join(_DATA_FOLDER, "pyramid_dipyramid.json"),
classname="PyramidDipyramidFamily",
docstring="""The family of regular equilateral pyramids and dipyramids (6 total).
The following parameters are required by this class:

The following parameters are required by this class:
- name: The name of the pyramid or dipyramid. Options are "Triangular Pyramid", \
"Square Pyramid", "Pentagonal Pyramid", "Triangular Dipyramid", \
"Square Dipyramid", and "Pentagonal Dipyramid".
Expand All @@ -144,7 +149,8 @@ def make_vertices(cls, n):
os.path.join(_DATA_FOLDER, "prism_antiprism.json"),
classname="PrismAntiprismFamily",
docstring="""The family of n-gonal prisms and antiprisms with n∈[3,10] (16 total).
The following parameters are required by this class:

The following parameters are required by this class:
- name: The name of the prism or antiprism. Options for prisms are \
"Triangular Prism", "Square Prism", "Pentagonal Prism", "Hexagonal Prism", \
"Heptagonal Prism", "Octagonal Prism", "Nonagonal Prism", and \
Expand Down
7 changes: 4 additions & 3 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
numpy
rowan>=1.2
scipy
jupyter
sphinx<=5.3.0
sphinxcontrib-bibtex>=2.0.0
autodocsumm
sphinx_rtd_theme
nbsphinx
fresnel
autodocsumm
jupyter
matplotlib
11 changes: 11 additions & 0 deletions doc/source/coxeter.bib
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ @article{Chen2014
doi = {10.1103/PhysRevX.4.011024},
}

@article{Johnson1966,
title={Convex Polyhedra with Regular Faces},
author={Johnson, Norman W.},
journal={Canadian Journal of Mathematics},
volume={18},
pages={169–200},
year={1966},
publisher={Cambridge University Press},
doi={10.4153/cjm-1966-021-8},
}

@article{Damasceno2012,
author = {Damasceno, Pablo F. and Engel, Michael and Glotzer, Sharon C.},
title = {Crystalline Assemblies and Densest Packings of a Family of Truncated Tetrahedra and the Role of Directional Entropic Forces},
Expand Down
1 change: 1 addition & 0 deletions doc/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ To provide a reasonable balance between a high level of backwards compatibility
To avoid having commits fail in case you forget to run this, you can set up a git pre-commit hook using `pre-commit`_:

.. code-block:: bash

pre-commit install


Expand Down
55 changes: 55 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
[build-system]
requires = ["setuptools","wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "coxeter"
version = "0.6.1"
requires-python = ">=3.8"
description = "Tools for creating and manipulating shapes."
readme = "README.rst"
license = { file = "LICENSE" }
authors = [
{name = "Vyas Ramasubramani", email = "vramasub@umich.edu"},
{name = "Bradley Dice", email = "bdice@umich.edu"},
{name = "Jen Bradley", email = "jenbrad@umich.edu"},
]
dependencies = ["numpy>=1.19.0","rowan>=1.2.0","scipy>1.0.0"]
keywords = ["geometry"]
dynamic = ["optional-dependencies"]

[tool.setuptools]
# Build the contents of coxeter rather than the JOSS paper
packages=["coxeter"]

[tool.setuptools.dynamic]
optional-dependencies = {tests = { file = ["tests/requirements.txt"] }, doc = { file = ["doc/requirements.txt"] }}

[tool.pytest.ini_options]
# Additional command line options for pytest
addopts = "--doctest-modules -p coxeter.__doctest_fixtures"
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"
# Add percentage progress bar to the pytest console output
console_output_style = "progress"
# Specify the tests folder to speed up collection.
testpaths = ["tests"]

[tool.isort]
skip_glob = "*/extern/*"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88
known_third_party = ["hypothesis","pytest"]
known_first_party = ["conftest","coxeter","utils"]

[tool.black]
exclude = '''
(
Expand All @@ -6,3 +52,12 @@ exclude = '''
)/
)
'''

[tool.pydocstyle]
add-ignore =[
"D105", # Magic methods don't require documentation.
"D107", # __init__ should be documented in class constructors.
"D401", # This doesn't play nice with property docstrings of the form `type: ...`
"D402", # This doesn't play nice with property docstrings of the form `type: ...`
"D403" # This doesn't play nice with property docstrings of the form `type: ...`
]
37 changes: 0 additions & 37 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
[bumpversion]
current_version = 0.6.1
commit = True
tag = True
message = Bump up to version {new_version}.

[bdist_wheel]
python-tag = py3

[bumpversion:file:coxeter/__init__.py]

[bumpversion:file:doc/source/conf.py]

[bumpversion:file:setup.py]

[flake8]
# For compatibility with black.
max-line-length = 88
Expand All @@ -25,25 +10,3 @@ ignore =
W503
rst-roles =
attr,class,func,meth,mod,obj,ref,term,cite

[isort]
skip_glob = */extern/*
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
line_length = 88
known_third_party = hypothesis,pytest
known_first_party = conftest,coxeter,utils

[pydocstyle]
add-ignore =
D105, # Magic methods don't require documentation.
D107, # __init__ should be documented in class constructors.
D401, # This doesn't play nice with property docstrings of the form `type: ...`
D402, # This doesn't play nice with property docstrings of the form `type: ...`
D403 # This doesn't play nice with property docstrings of the form `type: ...`

[tool:pytest]
addopts = --doctest-modules -p coxeter.__doctest_fixtures
doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS
Loading