Skip to content

Commit

Permalink
Merge pull request #38 from ctlee/scratch
Browse files Browse the repository at this point in the history
- Fix for Dolfin XML write out bug
- Improved functionality for curvature calculations (requires matplotlib in Blender)
- Added vertex valency constraint
  • Loading branch information
ctlee committed Jul 25, 2019
2 parents 93a89e4 + 71a737f commit b137dc9
Show file tree
Hide file tree
Showing 28 changed files with 1,342 additions and 485 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ option(GAMER_DOCS "Download and configure documentation?" OFF)

option(GAMER_CMAKE_VERBOSE "Print out information for debugging CMake configuration?")

option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
if (FORCE_COLORED_OUTPUT)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options (-fdiagnostics-color=always)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options (-fcolor-diagnostics)
endif ()
endif ()

#####################################################################
# Configuration
#####################################################################
Expand Down Expand Up @@ -177,8 +186,6 @@ target_include_directories(gamer_objlib PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(gamer_objlib PUBLIC casc tetstatic eigen)
# target_compile_options(gamer_objlib PRIVATE -Werror -Wall -Weverything -Wextra -pedantic-errors -Wconversion -Wsign-conversion -ferror-limit=3 -Wno-c++17-extensions)
# -ferror-limit=3 -Wno-unused-variable -Wno-unused-parameter)

# SHARED LIBRARY
add_library(gamershared SHARED $<TARGET_OBJECTS:gamer_objlib>)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.2
2.0.3
2 changes: 1 addition & 1 deletion cmake-modules/FindBlender.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ find_program(BLENDER_EXECUTABLE blender)

if(BLENDER_EXECUTABLE)
# Get the python path and version from blender
execute_process(COMMAND ${BLENDER_EXECUTABLE} -b --factory-startup --python-expr
execute_process(COMMAND ${BLENDER_EXECUTABLE} -b -noaudio --factory-startup --python-expr
"import sys;import struct;import bpy;
print(str(bpy.app.version[0]) + '.' + str(bpy.app.version[1]) + '.' + str(bpy.app.version[2]))
print(bpy.utils.script_path_user())
Expand Down
66 changes: 2 additions & 64 deletions docs/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extensions = [
'sphinx.ext.intersphinx',
'sphinx_issues',
'nbsphinx',
'jupyter_sphinx.embed_widgets',
'jupyter_sphinx.execute',
]

# Github repo
Expand Down Expand Up @@ -86,67 +86,6 @@ exhale_args = {
autosummary_generate = True
# autodoc_default_flags = ['members', 'inherited-members']

# try to exclude deprecated
# def skip_deprecated(app, what, name, obj, skip, options):
# if hasattr(obj, "func_dict") and "__deprecated__" in obj.func_dict:
# print("skipping " + name)
# return True
# return skip or False

# def setup(app):
# app.connect('autodoc-skip-member', skip_deprecated)
# try:
# from sphinx.ext.autosummary import Autosummary
# from sphinx.ext.autosummary import get_documenter
# from docutils.parsers.rst import directives
# from sphinx.util.inspect import safe_getattr
# import re

# class AutoAutoSummary(Autosummary):

# option_spec = {
# 'methods': directives.unchanged,
# 'attributes': directives.unchanged
# }

# required_arguments = 1

# @staticmethod
# def get_members(obj, typ, include_public=None):
# if not include_public:
# include_public = []
# items = []
# for name in dir(obj):
# try:
# documenter = get_documenter(app, safe_getattr(obj, name), obj)
# except AttributeError:
# continue
# if documenter.objtype == typ:
# items.append(name)
# public = [x for x in items if x in include_public or not x.startswith('_')]
# return public, items

# def run(self):
# clazz = self.arguments[0]
# try:
# (module_name, class_name) = clazz.rsplit('.', 1)
# m = __import__(module_name, globals(), locals(), [class_name])
# c = getattr(m, class_name)
# if 'methods' in self.options:
# _, methods = self.get_members(c, 'method', ['__init__'])

# self.content = ["~%s.%s" % (clazz, method) for method in methods if not method.startswith('_')]
# if 'attributes' in self.options:
# _, attribs = self.get_members(c, 'attribute')
# self.content = ["~%s.%s" % (clazz, attrib) for attrib in attribs if not attrib.startswith('_')]
# finally:
# return super(AutoAutoSummary, self).run()

# app.add_directive('autoautosummary', AutoAutoSummary)
# except BaseException as e:
# raise e


##############################
# Napoleon Settings
##############################
Expand Down Expand Up @@ -178,7 +117,6 @@ templates_path = ['@CMAKE_CURRENT_SOURCE_DIR@/src/_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '_templates', '**.ipynb_checkpoints']



##############################
# HTML Output Settings
##############################
Expand Down Expand Up @@ -207,4 +145,4 @@ html_context = {
##############################

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'https://docs.python.org/3/': None}
2 changes: 1 addition & 1 deletion docs/rtd-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ nbsphinx
jupyter_sphinx

# Visualization in docs
threevis
threevis
5 changes: 5 additions & 0 deletions docs/src/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

.. autoclass:: {{ objname }}

{% block methods %}
{% if methods %}
.. rubric:: Methods

Expand All @@ -14,7 +15,10 @@
{{ name }}.{{ item }}
{% endfor %}
{% endif %}
{% endblock %}


{% block attributes %}
{% if attributes %}
.. rubric:: Attributes

Expand All @@ -24,3 +28,4 @@
{{ name }}.{{ item }}
{% endfor %}
{% endif %}
{% endblock %}
34 changes: 18 additions & 16 deletions docs/src/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,28 @@

.. rubric:: Description

.. currentmodule:: {{ fullname }}
.. automodule:: {{ fullname }}

{% block classes %}
{% if classes %}
.. rubric:: Classes

.. autosummary::
:toctree: .
{% for class in classes %}
{{ class }}
{% endfor %}
.. rubric:: Classes

.. autosummary::
:toctree: .
{% for class in classes %}
{{ class }}
{% endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: Functions

.. autosummary::
:toctree: .
{% for function in functions %}
{{ function }}
{% endfor %}
.. rubric:: Functions

{% endif %}
.. autosummary::
:toctree: .
{% for function in functions %}
{{ function }}
{% endfor %}
{% endif %}
{% endblock %}
84 changes: 11 additions & 73 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Add the local lib to path if desired
# import sys
# sys.path.insert(0, os.path.abspath('/Users/ctlee/gamer/gamer/_skbuild/macosx-10.14-x86_64-3.7/cmake-build/lib/'))
# sys.path.insert(0, os.path.abspath('/home/ctlee/gamer/gamer/buildpy37/lib/'))

import os
import pygamer
Expand All @@ -25,8 +25,8 @@
copyright = '2019, Christopher T. Lee'
author = 'Christopher T. Lee'

version = '2.0.2'
release = 'v2.0.2-dev-16-g721d135.dirty'
version = '2.0.3'
release = 'v2.0.3-dev-21-g2ecdc88.dirty'

# -- General configuration ---------------------------------------------------

Expand All @@ -40,7 +40,7 @@
'sphinx.ext.intersphinx',
'sphinx_issues',
'nbsphinx',
'jupyter_sphinx.embed_widgets',
'jupyter_sphinx.execute',
]

# Github repo
Expand All @@ -52,7 +52,7 @@
##############################
# Breathe Settings
##############################
breathe_projects = { "gamer_project": "/Users/ctlee/gamer/gamer/docs/src/_doxyoutput/xml" }
breathe_projects = { "gamer_project": "/home/ctlee/gamer/gamer/docs/src/_doxyoutput/xml" }
breathe_default_project = "gamer_project"

##############################
Expand All @@ -61,17 +61,17 @@

doxystdin = \
"""
INPUT = /Users/ctlee/gamer/gamer/include
INPUT = /home/ctlee/gamer/gamer/include
OPTIMIZE_OUTPUT_FOR_C = YES
EXTRACT_ALL = YES
"""
# ENABLED_SECTIONS = detail

exhale_args = {
"containmentFolder": "/Users/ctlee/gamer/gamer/docs/src/_cppapi",
"containmentFolder": "/home/ctlee/gamer/gamer/docs/src/_cppapi",
"rootFileName": "root.rst",
"rootFileTitle": "C++ API Reference",
"doxygenStripFromPath": "/Users/ctlee/gamer/gamer",
"doxygenStripFromPath": "/home/ctlee/gamer/gamer",
# "pageLevelConfigMeta": ":github_url: https://github.com/ctlee/gamer",
"createTreeView": True,
"exhaleExecutesDoxygen": True,
Expand All @@ -86,67 +86,6 @@
autosummary_generate = True
# autodoc_default_flags = ['members', 'inherited-members']

# try to exclude deprecated
# def skip_deprecated(app, what, name, obj, skip, options):
# if hasattr(obj, "func_dict") and "__deprecated__" in obj.func_dict:
# print("skipping " + name)
# return True
# return skip or False

# def setup(app):
# app.connect('autodoc-skip-member', skip_deprecated)
# try:
# from sphinx.ext.autosummary import Autosummary
# from sphinx.ext.autosummary import get_documenter
# from docutils.parsers.rst import directives
# from sphinx.util.inspect import safe_getattr
# import re

# class AutoAutoSummary(Autosummary):

# option_spec = {
# 'methods': directives.unchanged,
# 'attributes': directives.unchanged
# }

# required_arguments = 1

# @staticmethod
# def get_members(obj, typ, include_public=None):
# if not include_public:
# include_public = []
# items = []
# for name in dir(obj):
# try:
# documenter = get_documenter(app, safe_getattr(obj, name), obj)
# except AttributeError:
# continue
# if documenter.objtype == typ:
# items.append(name)
# public = [x for x in items if x in include_public or not x.startswith('_')]
# return public, items

# def run(self):
# clazz = self.arguments[0]
# try:
# (module_name, class_name) = clazz.rsplit('.', 1)
# m = __import__(module_name, globals(), locals(), [class_name])
# c = getattr(m, class_name)
# if 'methods' in self.options:
# _, methods = self.get_members(c, 'method', ['__init__'])

# self.content = ["~%s.%s" % (clazz, method) for method in methods if not method.startswith('_')]
# if 'attributes' in self.options:
# _, attribs = self.get_members(c, 'attribute')
# self.content = ["~%s.%s" % (clazz, attrib) for attrib in attribs if not attrib.startswith('_')]
# finally:
# return super(AutoAutoSummary, self).run()

# app.add_directive('autoautosummary', AutoAutoSummary)
# except BaseException as e:
# raise e


##############################
# Napoleon Settings
##############################
Expand All @@ -170,15 +109,14 @@
show_authors = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['/Users/ctlee/gamer/gamer/docs/src/_templates']
templates_path = ['/home/ctlee/gamer/gamer/docs/src/_templates']

# 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', '_templates', '**.ipynb_checkpoints']



##############################
# HTML Output Settings
##############################
Expand All @@ -194,7 +132,7 @@
# 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 = ['/Users/ctlee/gamer/gamer/docs/src/_static']
html_static_path = ['/home/ctlee/gamer/gamer/docs/src/_static']

html_context = {
'css_files': [
Expand All @@ -207,4 +145,4 @@
##############################

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'https://docs.python.org/3/': None}
Loading

0 comments on commit b137dc9

Please sign in to comment.