Commit 9698fc83 authored by Dario Seyb's avatar Dario Seyb

updated CI and added documentation

parent 5b5f51cd
test-3.5:
stages:
- build
- test
- deploy
build-3.6-VS2017:
stage:
build
tags:
- VS2017
variables:
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x64"
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive
script:
- set Path=%Path%;C:\Program Files\Python36;C:\Program Files\Python36\Scripts;
- virtualenv --clear -p "C:\Program Files\Python36\python.exe" .
- call .\Scripts\activate
- python setup.py bdist_wheel --dist-dir dist3
artifacts:
paths:
- dist3/
build-3.5-linux:
stage:
build
tags:
- Linux
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- virtualenv --clear -p python3.5 .
- source bin/activate
- pip install -e .
- cd tests
- python -m unittest discover
- virtualenv --clear -p python3.5 .
- source bin/activate
- python setup.py bdist_wheel --dist-dir dist3
artifacts:
paths:
- dist3/
build-3.5-macos:
stage:
build
tags:
- Apple
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- export PATH=/opt/local/bin:$PATH
- virtualenv --clear -p python3.5 .
- source bin/activate
- python setup.py bdist_wheel --dist-dir dist3
artifacts:
paths:
- dist3/
test-2.7:
build-2.7-linux:
stage:
build
tags:
- Linux
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- virtualenv --clear -p python2.7 .
- source bin/activate
- pip install -e .
- cd tests
- python -m unittest discover
\ No newline at end of file
- virtualenv --clear -p python2.7 .
- source bin/activate
- python setup.py bdist_wheel --dist-dir dist2
artifacts:
paths:
- dist2/
build-2.7-macos:
stage:
build
tags:
- Apple
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- export PATH=/opt/local/bin:$PATH
- virtualenv --clear -p python2.7 .
- source bin/activate
- python setup.py bdist_wheel --dist-dir dist2
artifacts:
paths:
- dist2/
test-3.6-VS2017:
stage:
test
tags:
- VS2017
dependencies:
- build-3.6-VS2017
script:
- set Path=%Path%;C:\Program Files\Python36;C:\Program Files\Python36\Scripts;
- virtualenv --clear -p "C:\Program Files\Python36\python.exe" .
- call .\Scripts\activate
- cd dist3
- FOR %%a IN (*.whl) DO pip install %%a
- cd ..\tests
- python -m unittest discover
test-3.5-linux:
stage:
test
tags:
- Linux
dependencies:
- build-3.5-linux
script:
- virtualenv --clear -p python3.5 .
- source bin/activate
- pip install dist3/*.whl
- cd tests
- python -m unittest discover
test-3.5-macos:
stage:
test
tags:
- Apple
dependencies:
- build-3.5-macos
script:
- export PATH=/opt/local/bin:$PATH
- virtualenv --clear -p python3.5 .
- source bin/activate
- pip install dist3/*.whl
- cd tests
- python -m unittest discover
test-2.7-linux:
stage:
test
tags:
- Linux
dependencies:
- build-2.7-linux
script:
- virtualenv --clear -p python2.7 .
- source bin/activate
- pip install dist2/*.whl
- cd tests
- python -m unittest discover
test-2.7-macos:
stage:
test
tags:
- Apple
dependencies:
- build-2.7-macos
script:
- export PATH=/opt/local/bin:$PATH
- virtualenv --clear -p python2.7 .
- source bin/activate
- pip install dist2/*.whl
- cd tests
- python -m unittest discover
deploy-3.6-VS2017:
stage:
deploy
tags:
- VS2017
dependencies:
- build-3.6-VS2017
script:
- mkdir release
- cd dist3
- FOR %%a IN (*.whl) DO cp %%a ..\release
artifacts:
paths:
- release/*.whl
deploy-3.5-linux:
stage:
deploy
tags:
- Linux
dependencies:
- build-3.5-linux
script:
- mkdir release
- cp dist3/*.whl release
artifacts:
paths:
- release/*.whl
deploy-3.5-macos:
stage:
deploy
tags:
- Apple
dependencies:
- build-3.5-macos
script:
- mkdir release
- cp dist3/*.whl release
artifacts:
paths:
- release/*.whl
deploy-2.7-linux:
stage:
deploy
tags:
- Linux
dependencies:
- build-2.7-linux
script:
- mkdir release
- cp dist2/*.whl release
artifacts:
paths:
- release/*.whl
deploy-2.7-macos:
stage:
deploy
tags:
- Apple
dependencies:
- build-2.7-macos
script:
- mkdir release
- cp dist2/*.whl release
artifacts:
paths:
- release/*.whl
deploy-documentation:
stage:
deploy
tags:
- Linux
dependencies:
- build-3.5-linux
script:
- virtualenv --clear -p python3.5 .
- source bin/activate
- pip install dist3/*.whl
- pip install sphinx sphinx_rtd_theme
- mkdir documentation
- cd docs
- make html
- cp -r build/html/* ../documentation
artifacts:
paths:
- documentation/
/build/
/source/_autosummary
\ No newline at end of file
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = meshvis
SOURCEDIR = source
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)
\ No newline at end of file
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=meshvis
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup --------------------------------------------------------------
# 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('../../meshvis/'))
# -- Project information -----------------------------------------------------
project = u'meshvis'
copyright = u'2018, Dario Seyb, Isaak Lim, Janis Born'
author = u'Dario Seyb, Isaak Lim, Janis Born'
# The short X.Y version
version = u''
# The full version, including alpha/beta/rc tags
release = u''
# -- 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.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.imgmath',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary'
]
autosummary_generate = True
# 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'
# 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 pattern also affects 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'
# -- 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']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'meshvisdoc'
# -- 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, 'meshvis.tex', u'meshvis Documentation',
u'Dario Seyb, Isaak Lim, Janis Born', '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, 'meshvis', u'meshvis 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, 'meshvis', u'meshvis Documentation',
author, 'meshvis', 'Visualize meshes, point clouds, volumes and other geometry in a Jupyter Notebook',
'Miscellaneous'),
]
# -- Extension configuration -------------------------------------------------
# -- Options for todo extension ----------------------------------------------
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
\ No newline at end of file
.. meshvis documentation master file, created by
sphinx-quickstart on Thu Feb 22 19:39:24 2018.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to meshvis's documentation!
===================================
.. toctree::
:maxdepth: 2
:caption: Contents:
Setup
===================================
- Install dependencies
- Clone the repository
- pip install -e .
Dependencies
===================================
- [pythreejs](https://github.com/jovyan/pythreejs/) 1.0.0-beta4
- [openmesh-python](https://graphics.rwth-aachen.de:9000/adielen/openmesh-python) latest
Example
===================================
Overview
===================================
.. autosummary::
:toctree: _autosummary
meshvis.Context
meshvis.immediate
meshvis.mesh
meshvis.openmesh_utils
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
......@@ -9,6 +9,9 @@ from .mesh_helper import calculateFaceNormals, calculatePointNormals
from .mesh import *
class Context(object):
"""
This is a module docstring
"""
def __init__(self, width=600, height=400, background_color = '#dddddd'):
self.camera = three.PerspectiveCamera(position=[1,1,1], fov=20,
......
......@@ -9,7 +9,7 @@ setup(name='meshvis',
description='Visualize meshes, point clouds, volumes and other geometry in a Jupyter Notebook',
long_description=readme(),
url='https://graphics.rwth-aachen.de:9000/dseyb/meshvis',
author='Dario Seyb',
author='Dario Seyb, Isaak Lim, Janis Born',
author_email='dario.seyb@rwth-aachen.de',
license='MIT',
packages=['meshvis'],
......
......@@ -4,14 +4,20 @@ import meshvis
class IndexedAttributes(unittest.TestCase):
quad_verts = [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]
quad_faces = [[0, 1, 2], [0, 2, 3]]
quad_faces_tri = [[0, 1, 2], [0, 2, 3]]
def point_attribute(self):
attrib = meshvis.PointAttribute(['a', 'b', 'c, ''d'])
resolved_attrib = meshvis.resolve_attributes(self.quad_faces, [attrib])
def point_attribute_tri(self):
attrib = meshvis.PointAttribute(['a', 'b', 'c', 'd'])
resolved_attrib = meshvis.resolve_attributes(self.quad_faces_tri, [attrib])[0]
self.assertEqual(len(resolved_attrib), 6)
self.assertListEqual(resolved_attrib, ['a', 'b', 'c', 'a', 'c', 'd'])
def face_attribute_tri(self):
attrib = meshvis.FaceAttribute(['a', 'b'])
resolved_attrib = meshvis.resolve_attributes(self.quad_faces_tri, [attrib])[0]
self.assertEqual(len(resolved_attrib), 2)
self.assertListEqual(resolved_attrib, ['a', 'b'])
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(IndexedAttributes)
......
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