Skip to content

Commit

Permalink
Updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Dec 13, 2023
1 parent 52e819e commit c1f0988
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 24 deletions.
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
author = "Tom de Geus"

extensions = [
"sphinx_tabs.tabs",
"sphinx.ext.autosummary",
"sphinx.ext.mathjax",
"sphinx.ext.todo",
"sphinx_tabs.tabs",
]

autodoc_type_aliases = {"Iterable": "Iterable", "ArrayLike": "ArrayLike", "DTypeLike": "DTypeLike"}
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
html_theme = "furo"
33 changes: 13 additions & 20 deletions docs/python_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,30 @@ The quickest (but not the most efficient!) is to use *conda* to install *GooseEY

.. warning::

This package does not benefit from *xsimd* optimisation, as it is not compiled on your hardware. Therefore compiling by hand is recommended.
This package does not benefit from *xsimd* optimisation, as it is not compiled on your hardware. Therefore compiling by hand can be advantageous.

From source
^^^^^^^^^^^

Start by installing the dependencies, for example using *conda*::
Start by downloading the package::

conda install -c conda-forge pyxtensor xsimd

Note that *xsimd* is optional, but recommended.

.. note::

You can also use::
git checkout https://github.com/tdegeus/GooseEYE.git
cd GooseEYE

python -m pip install pyxtensor pybind11
Then, install the dependencies, for example using *conda*::

for use without *conda*. Note that you install *xsimd* yourself in such a way that Python can find it in order to use it.
conda env update --file environment.yaml

Then, download the package::
Finally, install the package using::

git checkout https://github.com/tdegeus/GooseEYE.git
cd GooseEYE
python -m pip install . -v --no-build-isolation --no-deps

Install the package using::
If you want to use hardware optimisations, you can use::

python -m pip install .
SKBUILD_CONFIGURE_OPTIONS="-DUSE_SIMD=1" python -m pip install . -v --no-build-isolation --no-deps

.. note::

The following will give more readable output::

python setup.py build
python setup.py install
Since you are compiling a C++ extension, with C++ libraries as dependencies, you cannot rely solely on *pip* to install the dependencies.
As observed, *conda* does contain all the dependencies.
Alternatively, you can use whatever non-supported method you prefer.
24 changes: 21 additions & 3 deletions docs/python_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
Functions & Usage
###################

The Python interface is a simple wrapper around the C++ classes and
functions. In general the Python and C++ codes are almost identical,
with as only differences:
Syntax
======

The Python interface is mostly wrapper around the C++ classes and functions.
In general the Python and C++ codes are almost identical, with as only differences:

- The C++ ``xt::xarray`` are ``numpy.ndarray`` in Python.
- The syntax ``::`` in Python in simply a ``.``.
Expand All @@ -20,3 +22,19 @@ In Python is
.. code:: python
ensemble = GooseEYE.Ensemble([51, 51])
Python only functions
=====================

Overview
--------

.. autosummary::

GooseEYE.Structure

Details
-------

.. automodule:: GooseEYE
:members:
8 changes: 8 additions & 0 deletions docs/theory_heightheight.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ The structure factor is defined as:
S(\vec{q}) = \langle \hat{u}(\vec{q}) \hat{u}(\vec{q}) \rangle
where :math:`\vec{q}` is the angular frequency.
It can be used to compute the roughness exponent :math:`\zeta`:

.. math::
S(|q|) \sim |q|^{-(d + 2 \zeta)}
where :math:`d` is the dimension of the image.
An example is shown below.

.. image:: examples/structure.svg
:width: 700px
Expand Down
1 change: 1 addition & 0 deletions python/GooseEYE/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
def ClusterLabeller(shape, periodic=True, **kwargs):
"""
Allocate a cluster labeller.
:param shape: The shape of the image.
:param periodic: Whether the image is periodic.
:return: A cluster labeller.
Expand Down

0 comments on commit c1f0988

Please sign in to comment.