Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the design and the logo in documentation #268

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/_rst/_code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Problem
SpatialProblem <problem/spatialproblem.rst>
TimeDependentProblem <problem/timedepproblem.rst>
ParametricProblem <problem/parametricproblem.rst>
InverseProblem <problem/invproblem.rst>

Geometries
-----------------
Expand Down
1 change: 0 additions & 1 deletion docs/source/_rst/geometry/cartesian.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ CartesianDomain
.. autoclass:: CartesianDomain
:members:
:show-inheritance:
:noindex:
1 change: 0 additions & 1 deletion docs/source/_rst/geometry/ellipsoid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ EllipsoidDomain
.. autoclass:: EllipsoidDomain
:members:
:show-inheritance:
:noindex:
1 change: 0 additions & 1 deletion docs/source/_rst/geometry/simplex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ SimplexDomain
.. autoclass:: SimplexDomain
:members:
:show-inheritance:
:noindex:
9 changes: 9 additions & 0 deletions docs/source/_rst/problem/invproblem.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
InverseProblem
================
.. currentmodule:: pina.problem.inverse_problem

.. automodule:: pina.problem.inverse_problem

.. autoclass:: InverseProblem
:members:
:show-inheritance:
66 changes: 51 additions & 15 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
import sys
import os
import sphinx_rtd_theme

# 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.
sys.path.insert(0, os.path.abspath('../..'))
import pina

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

project = pina.__project__
copyright = pina.__copyright__
author = pina.__author__
version = release ='1.0.0'


sys.path.insert(0, os.path.abspath('../sphinx_extensions')) # extension to remove paramref link from lightinig

# -- General configuration ------------------------------------------------
Expand Down Expand Up @@ -51,6 +54,21 @@
'sphinx_copybutton',
]

# The root document.
root_doc = 'index'

# 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', 'docstrings', 'nextgen', 'Thumbs.db', '.DS_Store']

# The reST default role (used for this markup: `text`) to use for all documents.
default_role = 'literal'

# Generate the API documentation when building
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed @ZahraMirzaiyan ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need! Deleted for now.

autosummary_generate = True
numpydoc_show_class_members = False

intersphinx_mapping = {
'python': ('http://docs.python.org/3', None),
# 'numpy': ('http://docs.scipy.org/doc/numpy/', None),
Expand All @@ -68,7 +86,6 @@
('py:func', 'torch.inference_mode'),
('py:func', 'torch.no_grad'),
('py:class', 'torch.utils.data.DistributedSampler'),
('py:class', 'CartesianDomain'), # TO FIX
('py:class', 'pina.model.layers.convolution.BaseContinuousConv'),
('py:class', 'Module'),
('py:class', 'torch.nn.modules.loss._Loss'), # TO FIX
Expand Down Expand Up @@ -162,7 +179,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"
html_theme = 'pydata_sphinx_theme'

# 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
Expand All @@ -181,12 +198,32 @@

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = "index_files/pina_logo.png"
html_logo = "index_files/pina_logo_pina.png"
html_theme_options = {
'logo_only': True,
'display_version': True,
'prev_next_buttons_location': 'bottom',

"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/mathLab/PINA",
"icon": "fab fa-github",
"type": "fontawesome",
},
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZahraMirzaiyan please remove it for now

"name": "StackOverflow",
"url": "https://github.com/mathLab/PINA",
"icon": "fab fa-stack-overflow",
"type": "fontawesome",
},
{
"name": "Twitter",
"url": "http://twitter.com/rozzagroup",
"icon": "fab fa-twitter",
"type": "fontawesome",
},
],
"show_prev_next": False,
"navbar_start": ["navbar-logo"],
"navbar_end": ["navbar-icon-links"],
"header_links_before_dropdown": 8,
}

# The name of an image file (within the static path) to use as favicon of the
Expand All @@ -195,8 +232,7 @@
# html_favicon = None

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

# Add any extra paths that contain custom files (such as robots.txt or
Expand Down Expand Up @@ -342,4 +378,4 @@

# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
autodoc_member_order = 'bysource'
autodoc_member_order = 'bysource'
33 changes: 6 additions & 27 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Welcome to PINA's documentation!
===================================================

.. figure:: index_files/API_color.png
:alt: PINA application program interface
:align: center
:width: 700

Physics Informed Neural network for Advanced modeling (**PINA**) is
an open-source Python library providing an intuitive interface for
solving differential equations using PINNs, NOs or both together.
Expand All @@ -19,32 +24,6 @@ underlying code.
The high-level structure of the package is depicted in our API. The pipeline to solve differential equations
with PINA follows just five steps: problem definition, model selection, data generation, solver selection, and training.

.. figure:: index_files/API_color.png
:alt: PINA application program interface
:align: center
:width: 600

|

Physics-informed neural network
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`PINN <https://www.sciencedirect.com/science/article/abs/pii/S0021999118307125>`_ is a novel approach that
involves neural networks to solve differential equations in an unsupervised manner, while respecting
any given law of physics described by general differential equations. Proposed in "*Physics-informed neural
networks: A deep learning framework for solving forward and inverse problems
involving nonlinear partial differential equations*", such framework aims to
solve problems in a continuous and nonlinear settings.

Neural operator learning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`Neural Operators <https://www.jmlr.org/papers/v24/21-1524.html>`_ is a novel approach involving neural networks
to learn differential operators using supervised learning strategies. By learning the differential operator, the
neural network is able to generalize across different instances of the differential equations (e.g. different forcing
terms), without the need of re-training.



.. toctree::
:maxdepth: 1
Expand All @@ -70,4 +49,4 @@ terms), without the need of re-training.
Team & Foundings <_team.rst>
Contributing <_rst/_contributing>
License <_LICENSE.rst>
Cite PINA <_cite.rst>
Cite PINA <_cite.rst>
Binary file added docs/source/index_files/pina_logo_nw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/index_files/pina_logo_pina.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pina/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Condition:
"""
The class ``Condition`` is used to represent the constraints (physical
equations, boundary conditions, etc.) that should be satisfied in the
problem at hand. Condition objects are used to formulate the PINA :obj:`pina.problem.abstract_problem.AbstractProblem` object.
problem at hand. Condition objects are used to formulate the PINA :class:`~pina.problem.abstract_problem.AbstractProblem` object.
Conditions can be specified in three ways:

1. By specifying the input and output points of the condition; in such a
Expand Down
6 changes: 3 additions & 3 deletions pina/geometry/cartesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def variables(self):
return list(self.fixed_.keys()) + list(self.range_.keys())

def update(self, new_domain):
"""Adding new dimensions on the ``CartesianDomain``
"""Adding new dimensions on the :class:`~pina.geometry.cartesian.CartesianDomain`

:param CartesianDomain new_domain: A new ``CartesianDomain`` object to merge
:param CartesianDomain new_domain: A new :class:`~pina.geometry.cartesian.CartesianDomain` object to merge

:Example:
>>> spatial_domain = CartesianDomain({'x': [0, 1], 'y': [0, 1]})
Expand Down Expand Up @@ -103,7 +103,7 @@ def sample(self, n, mode="random", variables="all"):
:type mode: str
:param variables: pinn variable to be sampled, defaults to ``all``.
:type variables: str | list[str]
:return: Returns ``LabelTensor`` of n sampled points.
:return: Returns :class:`~pina.label_tensor.LabelTensor` of n sampled points.
:rtype: LabelTensor

.. note::
Expand Down
8 changes: 4 additions & 4 deletions pina/geometry/difference_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, geometries):
the dimension of the geometry space.

:param list geometries: A list of geometries from ``pina.geometry``
such as ``EllipsoidDomain`` or ``CartesianDomain``. The first
such as :class:`~pina.geometry.ellipsoid.EllipsoidDomain` or :class:`~pina.geometry.cartesian.CartesianDomain`. The first
geometry in the list is the geometry from which points are
sampled. The rest of the geometries are the geometries that
are excluded from the first geometry to find the difference.
Expand All @@ -36,7 +36,7 @@ def __init__(self, geometries):

def is_inside(self, point, check_border=False):
"""
Check if a point is inside the ``Difference`` domain.
Check if a point is inside the :class:`~pina.geometry.difference_domain.Difference` domain.

:param point: Point to be checked.
:type point: torch.Tensor
Expand All @@ -51,13 +51,13 @@ def is_inside(self, point, check_border=False):

def sample(self, n, mode="random", variables="all"):
"""
Sample routine for ``Difference`` domain.
Sample routine for :class:`~pina.geometry.difference_domain.Difference` domain.

:param int n: Number of points to sample in the shape.
:param str mode: Mode for sampling, defaults to ``random``. Available modes include: ``random``.
:param variables: Variables to be sampled, defaults to ``all``.
:type variables: str | list[str]
:return: Returns ``LabelTensor`` of n sampled points.
:return: Returns :class:`~pina.label_tensor.LabelTensor` of n sampled points.
:rtype: LabelTensor

:Example:
Expand Down
2 changes: 1 addition & 1 deletion pina/geometry/ellipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def sample(self, n, mode="random", variables="all"):
:param str mode: Mode for sampling, defaults to ``random``. Available modes include: ``random``.
:param variables: Variables to be sampled, defaults to ``all``.
:type variables: str | list[str]
:return: Returns ``LabelTensor`` of n sampled points.
:return: Returns :class:`~pina.label_tensor.LabelTensor` of n sampled points.
:rtype: LabelTensor

:Example:
Expand Down
8 changes: 4 additions & 4 deletions pina/geometry/exclusion_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, geometries):
the dimension of the geometry space.

:param list geometries: A list of geometries from ``pina.geometry``
such as ``EllipsoidDomain`` or ``CartesianDomain``.
such as :class:`~pina.geometry.ellipsoid.EllipsoidDomain` or :class:`~pina.geometry.cartesian.CartesianDomain`.

:Example:
>>> # Create two ellipsoid domains
Expand All @@ -34,7 +34,7 @@ def __init__(self, geometries):

def is_inside(self, point, check_border=False):
"""
Check if a point is inside the ``Exclusion`` domain.
Check if a point is inside the :class:`~pina.geometry.exclusion_domain.Exclusion` domain.

:param point: Point to be checked.
:type point: torch.Tensor
Expand All @@ -50,13 +50,13 @@ def is_inside(self, point, check_border=False):

def sample(self, n, mode="random", variables="all"):
"""
Sample routine for ``Exclusion`` domain.
Sample routine for :class:`~pina.geometry.exclusion_domain.Exclusion` domain.

:param int n: Number of points to sample in the shape.
:param str mode: Mode for sampling, defaults to ``random``. Available modes include: ``random``.
:param variables: Variables to be sampled, defaults to ``all``.
:type variables: str | list[str]
:return: Returns ``LabelTensor`` of n sampled points.
:return: Returns :class:`~pina.label_tensor.LabelTensor` of n sampled points.
:rtype: LabelTensor

:Example:
Expand Down
8 changes: 4 additions & 4 deletions pina/geometry/intersection_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, geometries):
the dimension of the geometry space.

:param list geometries: A list of geometries from ``pina.geometry``
such as ``EllipsoidDomain`` or ``CartesianDomain``. The intersection
such as :class:`~pina.geometry.ellipsoid.EllipsoidDomain` or :class:`~pina.geometry.cartesian.CartesianDomain`. The intersection
will be taken between all the geometries in the list. The resulting
geometry will be the intersection of all the geometries in the list.

Expand All @@ -36,7 +36,7 @@ def __init__(self, geometries):

def is_inside(self, point, check_border=False):
"""
Check if a point is inside the ``Intersection`` domain.
Check if a point is inside the :class:`~pina.geometry.intersection_domain.Intersection` domain.

:param point: Point to be checked.
:type point: torch.Tensor
Expand All @@ -52,13 +52,13 @@ def is_inside(self, point, check_border=False):

def sample(self, n, mode="random", variables="all"):
"""
Sample routine for ``Intersection`` domain.
Sample routine for :class:`~pina.geometry.intersection_domain.Intersection` domain.

:param int n: Number of points to sample in the shape.
:param str mode: Mode for sampling, defaults to ``random``. Available modes include: ``random``.
:param variables: Variables to be sampled, defaults to ``all``.
:type variables: str | list[str]
:return: Returns ``LabelTensor`` of n sampled points.
:return: Returns :class:`~pina.label_tensor.LabelTensor` of n sampled points.
:rtype: LabelTensor

:Example:
Expand Down
2 changes: 1 addition & 1 deletion pina/geometry/operation_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, geometries):
Abstract set operation class. Any geometry operation entity must inherit from this class.

:param list geometries: A list of geometries from ``pina.geometry``
such as ``EllipsoidDomain`` or ``CartesianDomain``.
such as :class:`~pina.geometry.ellipsoid.EllipsoidDomain` or :class:`~pina.geometry.cartesian.CartesianDomain`.
"""
# check consistency geometries
check_consistency(geometries, Location)
Expand Down
2 changes: 1 addition & 1 deletion pina/geometry/simplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def sample(self, n, mode="random", variables="all"):
:param str mode: Mode for sampling, defaults to ``random``. Available modes include: ``random``.
:param variables: Variables to be sampled, defaults to ``all``.
:type variables: str | list[str]
:return: Returns ``LabelTensor`` of n sampled points.
:return: Returns :class:`~pina.label_tensor.LabelTensor` of n sampled points.
:rtype: LabelTensor

.. warning::
Expand Down
8 changes: 4 additions & 4 deletions pina/geometry/union_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, geometries):
the dimension of the geometry space.

:param list geometries: A list of geometries from ``pina.geometry``
such as ``EllipsoidDomain`` or ``CartesianDomain``.
such as :class:`~pina.geometry.ellipsoid.EllipsoidDomain` or :class:`~pina.geometry.cartesian.CartesianDomain`.

:Example:
>>> # Create two ellipsoid domains
Expand All @@ -35,7 +35,7 @@ def __init__(self, geometries):

def is_inside(self, point, check_border=False):
"""
Check if a point is inside the ``Union`` domain.
Check if a point is inside the :class:`~pina.geometry.union_domain.Union` domain.

:param point: Point to be checked.
:type point: LabelTensor
Expand All @@ -52,13 +52,13 @@ def is_inside(self, point, check_border=False):

def sample(self, n, mode="random", variables="all"):
"""
Sample routine for ``Union`` domain.
Sample routine for :class:`~pina.geometry.union_domain.Union` domain.

:param int n: Number of points to sample in the shape.
:param str mode: Mode for sampling, defaults to ``random``. Available modes include: ``random``.
:param variables: Variables to be sampled, defaults to ``all``.
:type variables: str | list[str]
:return: Returns ``LabelTensor`` of n sampled points.
:return: Returns :class:`~pina.label_tensor.LabelTensor` of n sampled points.
:rtype: LabelTensor

:Example:
Expand Down
Loading
Loading