Commit c31de806 authored by dboe's avatar dboe
Browse files

invaded by dough and allowed method setter by string

parent 8a85dff8
[run]
omit =
# omit the following files. E.g. uncomment the next line
# tfields/plotting/*.py
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# pyc files:
*.pyc
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask instance folder
instance/
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
venv/
ENV/
# Spyder project settings
.spyderproject
# vim files
*.sw*
# folder
tmp/
.idea
docs/source/
### Git ###
*.orig
### Linux ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
=======
Credits
=======
This package was created with Cookiecutter_ and the `dboe/dough`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`dboe/dough`: https://gitlab.com/dboe/dough
Development Lead
----------------
* Daniel Böckenhoff <dboe@ipp.mpg.de>
Contributors
------------
None yet. Why not be the first?
.. highlight:: shell
============
Contributing
============
Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions
----------------------
Report Bugs
~~~~~~~~~~~
Report bugs at https://gitlab.mpcdf.mpg.de/dboe/tfields/issues.
If you are reporting a bug, please include:
* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.
Fix Bugs
~~~~~~~~
Look through the repository issues for bugs. Anything tagged with "bug" and "help
wanted" is open to whoever wants to implement it.
Implement Features
~~~~~~~~~~~~~~~~~~
Look through the remote issues for features. Anything tagged with "enhancement"
and "help wanted" is open to whoever wants to implement it.
Write Documentation
~~~~~~~~~~~~~~~~~~~
tfields could always use more documentation, whether as part of the
official tfields docs, in docstrings, or even on the web in blog posts,
articles, and such.
Submit Feedback
~~~~~~~~~~~~~~~
The best way to send feedback is to file an issue at https://gitlab.mpcdf.mpg.de/dboe/tfields/issues.
If you are proposing a feature:
* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)
Get Started!
------------
Ready to contribute? Here's how to set up `tfields` for local development.
1. Fork the `tfields` repo.
2. Clone your fork locally::
$ git clone git@gitlab.mpcdf.mpg.de:your_name_here/tfields.git
3. Set up your fork for local development::
$ cd tfields/
$ python setup.py develop
4. Create a branch for local development::
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
5. When you're done making changes, check that your changes pass flake8 and the
tests::
$ make test
6. Commit your changes and push your branch to origin::
$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
7. Submit a pull request through the repository website.
Pull Request Guidelines
-----------------------
Before you submit a pull request, check that it meets these guidelines:
1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
https://travis-ci.com/dboe/tfields/pull_requests
and make sure that the tests pass for all supported Python versions.
Tips
----
To run a subset of tests, you have the following options::
$ pytest tests/test_package.py
$ pytest tests/test_package.py::Test_tfields::test_version_type
$ pytest --doctest-modules docs/usage.rst
$ pytest --doctest-modules tfields/core.py -k "MyClass.funciton_with_doctest"
Use the '--trace' option to directly jump into a pdb debugger on fails
Deploying
---------
A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst if you have one).
Then run::
$ bump2version patch # possible: major / minor / patch
$ git push
$ git push --tags
or without bump2version just do
$ make publish
Travis will then deploy to PyPI if tests pass.
MIT License
Copyright (c) 2020, Daniel Böckenhoff
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
CURRENT_PATH := $(shell pwd)
MODULE := $(shell basename "$(CURRENT_PATH)")
VERSION := $(shell python -c "import sys; import $(MODULE); sys.stdout.write($(MODULE).__version__)")
SOURCES := $(shell find $(MODULE) -name '*.py')
DOCUMENTATION := $(shell find $(MODULE) -name '*.rst')
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXSOURCEDIR = ./docs
SPHINXBUILDDIR = docs/_build
test: FORCE
flake8 tfields tests
py.test --doctest-modules --ignore=make --ignore=docs
coverage:
# coverage run $(MODULE) test
py.test --doctest-modules --ignore=make --ignore=docs --cov=$(MODULE) || true
# coverage report
coverage html
python -m webbrowser htmlcov/index.html
clean:
coverage erase
rm -rf htmlcov
rm -rf docs/_build
rm -rf docs/source
build:
@while [ -z "$$CONTINUE" ]; do \
read -r -p "Have you changed the __version__ attribute in tfields/__init__.py??? If yes, type Y or y to continue. Type anything else to exit. [y/N]: " CONTINUE; \
done ; \
[ $$CONTINUE = "y" ] || [ $$CONTINUE = "Y" ] || (echo "Exiting."; exit 1;)
@echo "... publishing ..."
@echo "New Version: $(VERSION)"
git tag -a v$(VERSION) -m "Version $(VERSION) tag" # tag version
git push origin v$(VERSION) # explicitly push tag to the shared server
rm -f dist/* # could become unnecessary, if you find a way to specify 'twine upload dist/transcoding-$(VERSION).tag.gz' in last step
python setup.py sdist # building package
publish_test: build
twine upload --repository-url https://test.pypi.org/legacy/ dist/* # publish to test.pypi.org
publish: build
twine upload dist/* # publish package
untag:
# remove last tag. mostly, because publishing failed
git tag -d v$(VERSION)
git push origin :refs/tags/v$(VERSION)
docs: Makefile $(SOURCES) $(DOCUMENTATION)
# link apidoc to source
sphinx-apidoc -o docs/source/ $(MODULE)
# build html documentation with sphinx
# @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0)
sphinx-build -M html docs docs/_build
# open the html slides
python -m webbrowser docs/_build/html/index.html
FORCE: ;
=======
tfields
=======
.. image:: https://img.shields.io/pypi/v/tfields.svg
:target: https://pypi.python.org/pypi/tfields
.. image:: https://img.shields.io/travis/dboe/tfields.svg
:target: https://travis-ci.com/dboe/tfields
.. image:: https://readthedocs.org/projects/tfields/badge/?version=latest
:target: https://tfields.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/dboe/tfields/shield.svg
:target: https://pyup.io/repos/github/dboe/tfields/
:alt: Updates
Tensors, tensor fields, graphs, mesh manipulation, CAD and more on the basis of numpy.ndarrays. All objects keep track of their coordinate system. Symbolic math operations work for object manipulation.
* Free software: MIT License
* Documentation: https://tfields.readthedocs.io.
Features
--------
* TODO
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.. include:: ../AUTHORS.rst
#####
#!/usr/bin/env python
#
# tfields documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import tfields
# -- General configuration ---------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autosectionlabel', # links
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'tfields'
copyright = "2020, Daniel Böckenhoff"
author = "Daniel Böckenhoff"
# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
# the built documents.
#
# The short X.Y version.
version = tfields.__version__
# The full version, including alpha/beta/rc tags.
release = tfields.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output -------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# Theme options are theme-specific and customize the look and feel of a
# theme further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Options for HTMLHelp output ---------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'tfieldsdoc'
# -- Options for LaTeX output ------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto, manual, or own class]).
latex_documents = [
(master_doc, 'tfields.tex',
'tfields Documentation',
'Daniel Böckenhoff', 'manual'),
]
# -- Options for manual page output ------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'tfields',
'tfields Documentation',
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'tfields',
'tfields Documentation',
author,
'tfields',
'One line description of project.',
'Miscellaneous'),
]
.. include:: ../CONTRIBUTING.rst
Welcome to tfields's documentation!
======================================
.. toctree::
:maxdepth: 2
:caption: Contents:
readme
installation
usage
source/modules
contributing
authors
Indices and tables
==================