diff --git a/README.md b/README.md index 2c522d3..1d37cef 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,20 @@ Many of the functions provided by `compas_libigl` are based on the examples in t ## Installation -`compas_libigl` can be installed using a combination of conda and pip. +### Stable + +The stable version of `compas_libigl` can now be installed from conda-forge. ```bash -conda create -n igl python=3.7 git cmake">=3.14" boost eigen=3.3 COMPAS compas_view2 --yes +conda create -n igl compas_libigl +``` + +### Dev install + +A dev version of `compas_libigl` can be installed using a combination of conda and pip. + +```bash +conda create -n igl-dev python=3.9 git cmake">=3.14" boost eigen=3.3 pybind11 --yes conda activate igl git clone --recursive https://github.com/BlockResearchGroup/compas_libigl.git cd compas_libigl @@ -16,9 +26,6 @@ rm -rf build pip install -e . ``` -> If you have git/cmake installed, this can be omitted from the environment installation. -> On Mac, don't forget to install `python.app`! - ## Libigl functions Currently the following functionalities of Libigl are included in the wrapper diff --git a/docs/_static/compas.css b/docs/_static/compas.css deleted file mode 100644 index b5bb915..0000000 --- a/docs/_static/compas.css +++ /dev/null @@ -1,30 +0,0 @@ -html[data-theme="light"] { - --pst-color-primary: #0092d2; - --pst-color-info: #0092d2; - --pst-color-text-muted: #888; -} - -body { - line-height: 1.75; - font-weight: 300; -} - -.bd-article-container h1 { - color: #0092d2; -} - -.navbar-brand .logo__image { - height: 36px !important; -} - -.bd-header { - box-shadow: none; - border-bottom: 1px solid var(--pst-color-shadow); -} - -#rtd-footer-container { - height: 0px; - bottom: 0 !important; - margin: 0 !important; - display: none; -} diff --git a/docs/_static/compas.ico b/docs/_static/compas.ico deleted file mode 100644 index ec6b1f2..0000000 Binary files a/docs/_static/compas.ico and /dev/null differ diff --git a/docs/_static/compas_icon.png b/docs/_static/compas_icon.png deleted file mode 100644 index f112c7b..0000000 Binary files a/docs/_static/compas_icon.png and /dev/null differ diff --git a/docs/_static/compas_icon_white.png b/docs/_static/compas_icon_white.png deleted file mode 100644 index 2c905bf..0000000 Binary files a/docs/_static/compas_icon_white.png and /dev/null differ diff --git a/docs/_static/compas_white.ico b/docs/_static/compas_white.ico deleted file mode 100644 index 381bd94..0000000 Binary files a/docs/_static/compas_white.ico and /dev/null differ diff --git a/docs/_templates/compas-sidebar-footer.html b/docs/_templates/compas-sidebar-footer.html deleted file mode 100644 index af7e762..0000000 --- a/docs/_templates/compas-sidebar-footer.html +++ /dev/null @@ -1,5 +0,0 @@ -
\ No newline at end of file diff --git a/docs/_templates/navbar-nav.html b/docs/_templates/navbar-nav.html deleted file mode 100644 index c5d0efa..0000000 --- a/docs/_templates/navbar-nav.html +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/docs/_templates/sbt-sidebar-nav.html b/docs/_templates/sbt-sidebar-nav.html deleted file mode 100644 index 8f41a32..0000000 --- a/docs/_templates/sbt-sidebar-nav.html +++ /dev/null @@ -1,24 +0,0 @@ - diff --git a/docs/conf.py b/docs/conf.py index 8812036..b3f4c73 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,40 +1,26 @@ # flake8: noqa # -*- coding: utf-8 -*- -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = "1.0" - -import inspect -import importlib -import re -import sphinx_compas_theme # this is a temp solution +from sphinx.writers import html, html5 +import sphinx_compas2_theme # -- General configuration ------------------------------------------------ project = "COMPAS Libigl" copyright = "COMPAS Association" author = "Tom Van Mele" -package = "compas_libigl" organization = "compas-dev" +package = "compas_libigl" +master_doc = "index" +source_suffix = {".rst": "restructuredtext", ".md": "markdown"} +templates_path = sphinx_compas2_theme.get_autosummary_templates_path() +exclude_patterns = sphinx_compas2_theme.default_exclude_patterns +add_module_names = False +language = "en" -def get_latest_version(): - with open("../CHANGELOG.md", "r") as file: - content = file.read() - pattern = re.compile(r"## (Unreleased|\[\d+\.\d+\.\d+\])") - versions = pattern.findall(content) - latest_version = versions[0] if versions else None - if ( - latest_version - and latest_version.startswith("[") - and latest_version.endswith("]") - ): - latest_version = latest_version[1:-1] - return latest_version - +latest_version = sphinx_compas2_theme.get_latest_version() -latest_version = get_latest_version() if latest_version == "Unreleased": release = "Unreleased" version = "latest" @@ -42,99 +28,39 @@ def get_latest_version(): release = latest_version version = ".".join(release.split(".")[0:2]) # type: ignore -master_doc = "index" -source_suffix = { - ".rst": "restructuredtext", - ".md": "markdown", -} -templates_path = sphinx_compas_theme.get_autosummary_templates_path() + ["_templates"] -exclude_patterns = ["_build", "**.ipynb_checkpoints", "_notebooks", "**/__temp"] - -add_module_names = True -language = "en" - - # -- Extension configuration ------------------------------------------------ -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.doctest", - "sphinx.ext.intersphinx", - "sphinx.ext.mathjax", - "sphinx.ext.extlinks", - "sphinx.ext.githubpages", - "sphinx.ext.coverage", - "sphinx.ext.autodoc.typehints", - "sphinx_design", - "sphinx_inline_tabs", - "sphinx_togglebutton", - "sphinx_remove_toctrees", - "sphinx_copybutton", - "numpydoc", -] +extensions = sphinx_compas2_theme.default_extensions + +# numpydoc options numpydoc_show_class_members = False numpydoc_class_members_toctree = False numpydoc_attributes_as_param_list = True +# bibtex options + # autodoc options autodoc_type_aliases = {} - -# this does not work properly yet -# autodoc_typehints = "none" -# autodoc_typehints_format = "short" autodoc_typehints_description_target = "documented" - -autodoc_mock_imports = [ - "System", - "clr", - "Eto", - "Rhino", - "Grasshopper", - "scriptcontext", - "rhinoscriptsyntax", - "bpy", - "bmesh", - "mathutils", -] - +autodoc_mock_imports = sphinx_compas2_theme.default_mock_imports autodoc_default_options = { "undoc-members": True, "show-inheritance": True, } - autodoc_member_order = "groupwise" - autoclass_content = "class" -def skip(app, what, name, obj, would_skip, options): - if name.startswith("_"): - return True - return would_skip - - def setup(app): - app.connect("autodoc-skip-member", skip) + app.connect("autodoc-skip-member", sphinx_compas2_theme.skip) # autosummary options autosummary_generate = True -autosummary_mock_imports = [ - "System", - "clr", - "Eto", - "Rhino", - "Grasshopper", - "scriptcontext", - "rhinoscriptsyntax", - "bpy", - "bmesh", - "mathutils", -] +autosummary_mock_imports = sphinx_compas2_theme.default_mock_imports # graph options @@ -154,148 +80,59 @@ def setup(app): # linkcode - -def linkcode_resolve(domain, info): - if domain != "py": - return None - if not info["module"]: - return None - if not info["fullname"]: - return None - - package = info["module"].split(".")[0] - if not package.startswith(package): - return None - - module = importlib.import_module(info["module"]) - parts = info["fullname"].split(".") - - if len(parts) == 1: - obj = getattr(module, info["fullname"]) - mod = inspect.getmodule(obj) - if not mod: - return None - filename = mod.__name__.replace(".", "/") - lineno = inspect.getsourcelines(obj)[1] - elif len(parts) == 2: - obj_name, attr_name = parts - obj = getattr(module, obj_name) - attr = getattr(obj, attr_name) - if inspect.isfunction(attr): - mod = inspect.getmodule(attr) - if not mod: - return None - filename = mod.__name__.replace(".", "/") - lineno = inspect.getsourcelines(attr)[1] - else: - return None - else: - return None - - return f"https://github.com/{organization}/{package}/blob/main/src/{filename}.py#L{lineno}" - +linkcode_resolve = sphinx_compas2_theme.get_linkcode_resolve(organization, package) # extlinks - -extlinks = { - "rhino": ("https://developer.rhino3d.com/api/RhinoCommon/html/T_%s.htm", "%s"), - "blender": ("https://docs.blender.org/api/2.93/%s.html", "%s"), -} +extlinks = {} # from pytorch -from sphinx.writers import html, html5 - - -def replace(Klass): - old_call = Klass.visit_reference - - def visit_reference(self, node): - if "refuri" in node: - refuri = node.get("refuri") - if "generated" in refuri: - href_anchor = refuri.split("#") - if len(href_anchor) > 1: - href = href_anchor[0] - anchor = href_anchor[1] - page = href.split("/")[-1] - parts = page.split(".") - if parts[-1] == "html": - pagename = ".".join(parts[:-1]) - if anchor == pagename: - node["refuri"] = href - return old_call(self, node) - - Klass.visit_reference = visit_reference - - -replace(html.HTMLTranslator) -replace(html5.HTML5Translator) +sphinx_compas2_theme.replace(html.HTMLTranslator) +sphinx_compas2_theme.replace(html5.HTML5Translator) # -- Options for HTML output ---------------------------------------------- -html_theme = "pydata_sphinx_theme" -html_logo = "_static/compas_icon.png" +html_theme = "sidebaronly" html_title = project -html_favicon = "_static/compas.ico" + +favicons = [ + { + "rel": "icon", + "href": "compas.ico", # relative to the static path + } +] html_theme_options = { - "use_repository_button": True, - "logo": { - "text": project, - "image_light": "_static/compas_icon.png", - "image_dark": "_static/compas_icon_white.png", - }, + "icon_links": [ + { + "name": "GitHub", + "url": f"https://github.com/{organization}/{package}", + "icon": "fa-brands fa-github", + "type": "fontawesome", + }, + { + "name": "Discourse", + "url": "http://forum.compas-framework.org/", + "icon": "fa-brands fa-discourse", + "type": "fontawesome", + }, + { + "name": "PyPI", + "url": f"https://pypi.org/project/{package}/", + "icon": "fa-brands fa-python", + "type": "fontawesome", + }, + ], "switcher": { "json_url": f"https://raw.githubusercontent.com/{organization}/{package}/gh-pages/versions.json", "version_match": version, }, - "check_switcher": False, - "navigation_depth": 3, - "show_nav_level": 1, - "show_toc_level": 2, - "pygment_light_style": "default", - "pygment_dark_style": "monokai", -} - -html_theme_options["icon_links"] = [ - { - "name": "GitHub", - "url": f"https://github.com/{organization}/{package}", - "icon": "fa-brands fa-github", - "type": "fontawesome", - }, - { - "name": "Discourse", - "url": "http://forum.compas-framework.org/", - "icon": "fa-brands fa-discourse", - "type": "fontawesome", - }, - { - "name": "PyPI", - "url": "https://pypi.org/project/compas-libigl/", - "icon": "fa-brands fa-python", - "type": "fontawesome", + "logo": { + "image_light": "_static/compas_icon_white.png", # relative to parent of conf.py + "image_dark": "_static/compas_icon_white.png", # relative to parent of conf.py + "text": project, }, -] - -html_theme_options["navbar_start"] = [ - "navbar-logo", -] - -html_theme_options["navbar_end"] = [ - "version-switcher", - "theme-switcher", - "navbar-icon-links", -] - - -html_sidebars = { - "**": [ - "sbt-sidebar-nav.html", - "compas-sidebar-footer.html", - ] } html_context = { @@ -304,11 +141,10 @@ def visit_reference(self, node): "github_repo": package, "github_version": "main", "doc_path": "docs", - "default_theme": "light", } -html_static_path = ["_static"] -html_css_files = ["compas.css"] +html_static_path = sphinx_compas2_theme.get_html_static_path() + ["_static"] +html_css_files = [] html_extra_path = [] html_last_updated_fmt = "" html_copy_source = False diff --git a/docs/installation.rst b/docs/installation.rst index c19b731..acf8fd3 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -2,16 +2,24 @@ Installation ******************************************************************************** -We are working on a ``conda-forge`` package for :mod:`compas_libigl`. -However, it is currently not available, yet. -In the meantime, :mod:`compas_libigl` can be installed "from source" using a combination of ``conda`` and ``pip``. +Stable +====== + +.. code-block:: bash + + conda install -c conda-forge compas_libigl + +Dev Install +=========== + +Adevelopment version of :mod:`compas_libigl` can be installed "from source" using a combination of ``conda`` and ``pip``. Create a ``conda`` environment with the required dependencies and activate it. -Note that you can choose a different name for the environment than ``igl``. +Note that you can choose a different name for the environment than ``igl-dev``. .. code-block:: bash - conda create -n igl python=3.7 git cmake">=3.14" boost eigen=3.3 compas + conda create -n igl-dev python=3.9 git cmake">=3.14" boost eigen=3.3 pybind11 conda activate igl Get a local copy of the source code of :mod:`compas_libigl` with all submodules. diff --git a/recipe/sha256.py b/recipe/sha256.py index 4d0895b..f0c588e 100644 --- a/recipe/sha256.py +++ b/recipe/sha256.py @@ -1,7 +1,7 @@ import hashlib from pathlib import Path -FILE = Path(__file__).parent / "compas_libigl-0.2.5.tar.gz" +FILE = Path(__file__).parent / "compas_libigl-0.3.1.tar.gz" with open(FILE, "rb") as f: data = f.read() diff --git a/requirements-dev.txt b/requirements-dev.txt index 014564f..164431b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,21 +7,7 @@ doc8 flake8 invoke >=0.14 isort -jinja2 >= 3.0 -numpydoc -pydata-sphinx-theme -pydocstyle -pytest -pytest-mock -sphinx ==4.5 -sphinx_compas_theme >=0.15.18 -sphinx-design -sphinx-inline-tabs -sphinx-togglebutton -sphinx-remove-toctrees -sphinx-copybutton -sphinxcontrib-bibtex -sphinxcontrib-youtube +sphinx_compas2_theme twine wheel -e .