Commit 62cc895c authored by Daniel Boeckenhoff's avatar Daniel Boeckenhoff
Browse files

test_core abstract baseclasses should be calld Check... Otherwise they are found by test searchers

parent ae9b671b
# 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
/home/IPP-HGW/dboe/git/tfields/make/python/.gitignore
\ No newline at end of file
[submodule "make"]
path = make
url = https://gitlab.mpcdf.mpg.de/dboe/make.git
This diff is collapsed.
init:
# symlink the .git/hooks to .githooks so they can be shared
find .git/hooks -type l -exec rm {} \;
find .githooks -type f -exec ln -sf ../../{} .git/hooks/ \;
test: FORCE
python tfields test
coverage:
coverage run tfields test
coverage report
coverage html
firefox htmlcov/index.html
clear:
coverage erase
VERSION := $(shell python -c "import sys; import tfields; sys.stdout.write(tfields.__version__)")
publish:
@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/tfields-$(VERSION).tag.gz' in last step
python setup.py sdist # building package
twine upload dist/* # publish package
FORCE: ;
/home/IPP-HGW/dboe/git/tfields/make/python/Makefile
\ No newline at end of file
Subproject commit 11b3077255a934533eca0c1e681cb7220b8afe99
"""
Publishing:
run tests
remember to change the version in setup(... ) below
$ git commit -am "<my message>"
$ git push
$ git tag -a v<my.version.id> -m "<comment to my version>" # tag version
$ git push origin v<my.version.id> # explicitly push tag to the shared server
$ python setup.py sdist
$ twine upload dist/*
"""
from setuptools import setup, find_packages
exec(open("./tfields/__about__.py").read())
setup(
name=__title__,
version=__version__,
description=__summary__,
author=__author__,
author_email=__email__,
license=__license__,
keywords=__keywords__,
packages=find_packages(),
url=__uri__,
project_urls={
'Documentation': __uri__,
'Source': __uri__,
},
test_require=[
'doctest',
'unittest'
],
install_requires=[
'numpy',
'sympy',
'scipy',
'pathlib',
'six',
'matplotlib',
],
entry_points={
'console_scripts': ['tfields = tfields.__main__:runDoctests']
},
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 3 - Alpha',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: MIT License',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
python_requires='>=2.7',
)
# in the terminal:
# pip install .
/home/IPP-HGW/dboe/git/tfields/make/python/setup.py
\ No newline at end of file
......@@ -11,22 +11,18 @@ import sympy # NOQA: F401
ATOL = 1e-8
class Base_Test(object):
class Base_Check(object):
"""
Testing derivatives of Points3D
Testing derivatives of Tensors
"""
_inst = None
def test_self_equality(self):
"""
Test equality
"""
# Test equality
self.assertTrue(self._inst.equal(self._inst))
def test_cylinderTrafo(self):
"""
Test coordinate transformations in circle
"""
# Test coordinate transformations in circle
transformer = self._inst.copy()
transformer.transform(tfields.bases.CYLINDER)
self.assertTrue(tfields.Tensors(self._inst).equal(transformer, atol=ATOL))
......@@ -38,9 +34,7 @@ class Base_Test(object):
self.assertTrue(self._inst.equal(transformer, atol=ATOL))
def test_spericalTrafo(self):
"""
Test coordinate transformations in circle
"""
# Test coordinate transformations in circle
transformer = self._inst.copy()
transformer.transform(tfields.bases.SPHERICAL)
......@@ -82,7 +76,7 @@ class Base_Test(object):
del self._inst
class Tensor_Fields_Test(object):
class Tensor_Fields_Check(object):
def test_fields(self):
# field is of type list
self.assertTrue(isinstance(self._inst.fields, list))
......@@ -99,12 +93,12 @@ EMPTY TESTS
"""
class Tensors_Empty_Test(Base_Test, unittest.TestCase):
class Tensors_Empty_Test(Base_Check, unittest.TestCase):
def setUp(self):
self._inst = tfields.Tensors([], dim=3)
class TensorFields_Empty_Test(Tensors_Empty_Test, Tensor_Fields_Test):
class TensorFields_Empty_Test(Tensors_Empty_Test, Tensor_Fields_Check):
def setUp(self):
self._fields = []
self._inst = tfields.TensorFields([], dim=3)
......
"""
Description of project with title, state and further constants
"""
import os
__all__ = [
"__version__",
"__title__",
......@@ -8,13 +12,38 @@ __all__ = [
"__email__",
"__license__",
"__copyright__",
"__python_requires__",
"__dependencies__",
"__classifiers__",
]
__version__ = '0.1.0.dev11'
__title__ = 'tfields'
__version__ = '0.1.0.dev12'
__title__ = os.path.basename(os.path.abspath('.'))
__summary__ = "numpy + sympy implementation of tensor fields with attached coordinate systems"
__keywords__ = "tensors coordinate system trafo sympy numpy"
__uri__ = 'https://gitlab.mpcdf.mpg.de/dboe/tfields'
__author__ = "Daniel Boeckenhoff"
__email__ = "daniel.boeckenhoff@ipp.mpg.de"
__license__ = "Apache License, Version 2.0"
__license__ = "Apache Software License"
__copyright__ = "2018 %s" % __author__
__python_requires__ = '>=2.7'
__dependencies__ = [
'pathlib2;python_version<"3.0"',
'pathlib;python_version>="3.0"',
'rna',
]
__classifiers__ = [
# find the full list of possible classifiers at https://pypi.org/classifiers/
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: {0}'.format(__license__),
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
]
......@@ -437,5 +437,5 @@ class Searcher(Node):
if __name__ == '__main__':
import doctest
# doctest.run_docstring_examples(Mesh3D.clean, globals())
# doctest.run_docstring_examples(Searcher.in_faces, globals())
doctest.testmod()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment