Skip to content

Commit

Permalink
Merge branch 'adding_classes'
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyThomsonMonash committed Nov 1, 2022
2 parents 419e3a7 + e74e9e9 commit 77d99cd
Show file tree
Hide file tree
Showing 36 changed files with 5,514 additions and 6,624 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203, E501, E231, E731, E741
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
Expand Down Expand Up @@ -208,7 +207,8 @@ dmypy.json
.history
.vscode/


docs/build
docs/source/_autosummary/*
# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,c++,cmake
#ignore automatically generated doc files
docs/source/_autosummary
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
"algorithm": "cpp"
},
"restructuredtext.languageServer.disabled": true,
"esbonio.server.enabled": false
"esbonio.server.enabled": false,
"python.formatting.provider": "black",
"editor.formatOnSave": true
}
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
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)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

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% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
7 changes: 7 additions & 0 deletions docs/source/_static/getting_started/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Getting started
===============

.. toctree::
:caption: Getting started

installation
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

# Installing map2loop

Marks instructions


1) create a clean python env with

conda create --name loop python=3.8 # --name = minus minus name (no spaces)! If you already have an env called loop, call it loop2 or something.
Expand Down
Empty file.
2 changes: 2 additions & 0 deletions docs/source/_static/user_guide/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User Guide
===========
Empty file.
Empty file.
32 changes: 32 additions & 0 deletions docs/source/_templates/custom-class-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:show-inheritance:
:inherited-members:

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
68 changes: 68 additions & 0 deletions docs/source/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

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

.. autosummary::
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

.. autosummary::
:toctree:
:recursive:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree:
:template: custom-class-template.rst
:recursive:
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:template: custom-module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
12 changes: 12 additions & 0 deletions docs/source/_templates/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.toggle .header {
display: block;
clear: both;
}

.toggle .header:after {
content: " ▶";
}

.toggle .header.open:after {
content: " ▼";
}
14 changes: 14 additions & 0 deletions docs/source/_templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "!page.html" %}

{% block footer %}
<script type="text/javascript">
$(document).ready(function() {
$(".toggle > *").hide();
$(".toggle .header").show();
$(".toggle .header").click(function() {
$(this).parent().children().not(".header").toggle(400);
$(this).parent().children(".header").toggleClass("open");
})
});
</script>
{% endblock %}
110 changes: 110 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- 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('.'))


# -- Project information -----------------------------------------------------

project = 'map2loop'
copyright = '2022, Loop'
author = 'Loop team: Mark Jessell, Lachlan Grose, Laurent Ailleres, Roy Thompson, Yohan der Rose'

# The full version, including alpha/beta/rc tags
release = '1.2.1'


# -- General configuration ---------------------------------------------------
autoclass_content = "both" # include both class docstring and __init__
autodoc_default_flags = [
# Make sure that any autodoc declarations show the right members
"members",
"inherited-members",
"private-members",
"show-inheritance",
]
autosummary_generate = True # Make _autosummary files and include them
napoleon_numpy_docstring = True #False # Force consistency, leave only Google
napoleon_use_rtype = False # More legible
# autosummary_imported_members = True
autosummary_ignore_module_all = False
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
# Need the autodoc and autosummary packages to generate our docs.
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
# The Napoleon extension allows for nicer argument formatting.
'sphinx.ext.napoleon',
# add sphinx gallery
# 'sphinx_gallery.gen_gallery',
# citations
# 'myst_parser'


]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_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 = []

html_theme_options = {
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/loop3d/LoopStructural",
"icon": "fab fa-github-square",
},
{
"name": "Twitter",
"url": "https://twitter.com/loop3d",
"icon": "fab fa-twitter-square",
},
],
# "navbar_start": ["navbar-logo", "navbar-version"],
# "use_edit_page_button": True,
"external_links": [
{"name": "Loop3d", "url": "https://www.loop3d.org"},
],
}
# -- 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 = 'pydata_sphinx_theme'

# 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']

# # Sphinx gallery examples
# from LoopStructural.visualisation.sphinx_scraper import Scraper as LoopScraper
# from sphinx_gallery.sorting import ExampleTitleSortKey
# sphinx_gallery_conf = {
# 'examples_dirs': ['../../examples/'],

# 'gallery_dirs': ['auto_examples/']
# , # path to where to save gallery generated output
# 'image_scrapers': ('matplotlib',LoopScraper()),
# 'within_subsection_order': ExampleTitleSortKey,
# 'reference_url' : {'LoopStructural' : None},

# }
22 changes: 22 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. map2loop documentation master file, created by
sphinx-quickstart on Mon May 30 16:28:49 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to map2loop's documentation!
====================================

.. toctree::
:hidden:

_static/getting_started/index
_statuc/user_guide/index


.. autosummary::
:caption: API
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:

map2loop
Loading

0 comments on commit 77d99cd

Please sign in to comment.