Commit a4cc513e authored by dboe's avatar dboe
Browse files

even setup

parent 895b7690
#!/bin/bash
# pre-push.sh
# this hook is in SCM so that it can be shared
# to install it, create a symbolic link in the projects .git/hooks folder
#
# i.e. - from the .git/hooks directory, run
# $ ln -s ../../git-hooks/pre-commit.sh pre-commit
#
# to skip the tests, run with the --no-verify argument
# i.e. - $ 'git commit --no-verify'
# stash any unstaged changes
# run the tests in python2
echo "running pre-push tests ..."
python tfields test &> /tmp/git-pre-push-tests.log
# store the last exit code in a variable
RESULT=$?
if [ $RESULT -ne 0 ]
then
echo "Test failed! Log record at /tmp/git-pre-push-tests.log"
exit $RESULT
else
echo "... OK"
fi
# return the './gradlew test' exit code
exit $RESULT
# 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/
"""
Publishing:
either:
$make publish
or manually:
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
import os
title = os.path.basename(os.path.abspath('.'))
exec(open("./{title}/__about__.py".format(**locals())).read())
with open(os.path.join('.', 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name=title,
version=__version__,
description=__summary__,
long_description=long_description,
long_description_content_type='text/markdown',
author=__author__,
author_email=__email__,
license=__license__,
keywords=__keywords__,
packages=find_packages(),
url=__uri__,
project_urls={
'Documentation': __uri__,
'Source': __uri__,
},
test_require=[
'doctest',
'unittest',
'nose',
],
install_requires=__dependencies__,
classifiers=__classifiers__,
python_requires=__python_requires__,
)
# in the terminal:
# pip install .
......@@ -27,7 +27,6 @@ class BoundingBox_Test(unittest.TestCase):
class Searcher_Test(unittest.TestCase):
def setUp(self):
self._mesh = tfields.Mesh3D.grid((0, 1, 2), (1, 2, 2), (2, 3, 2))
print(self._mesh, self._mesh.maps)
def test_tree(self):
tree = tfields.bounding_box.Searcher(self._mesh, n_sections=[5, 5, 5])
......@@ -37,8 +36,6 @@ class Searcher_Test(unittest.TestCase):
[0.5, 1.5, 2.5]])
box_res = tree.in_faces(points, delta=0.0001)
usual_res = self._mesh.in_faces(points, delta=0.0001)
# print(box_res)
# print(usual_res)
self.assertTrue(np.array_equal(box_res, usual_res))
......
Markdown is supported
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