Skip to content
Snippets Groups Projects
Commit eeb97a69 authored by Jan Caron's avatar Jan Caron
Browse files

Added stuff to docs, try to make it work correctly

parent 546e2a81
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ test_style:
image: continuumio/miniconda3:latest
script:
# -m: only run tests marked with "flake8"
- pyroma . --min=9 # Checks setup.py for cheese! # TODO: Set to maxium cheese (10)!
- pyroma . --min=10 # Checks setup.py for cheese! Maxium cheese 10!
- python setup.py test --addopts "--flake8 -m flake8"
test_function:
......
......@@ -28,16 +28,16 @@ EMPyRe is available on the `Python Package Index <http://pypi.python.org/pypi>`_
Per default, only the strictly required libraries are installed, but there are a few additional dependencies that will unlock additional capabilites of EMPYRE.
* ``io`` will install the `HyperSpy <https://hyperspy.org/>`_ package that is used for loading and saving additional file formats.
.. warning::
Due to this `issue <https://github.com/hyperspy/hyperspy/issues/2315>`_, a pip install of hyperspy is currently not possible. Please use
Due to this `issue <https://github.com/hyperspy/hyperspy/issues/2315>`_, a pip install of hyperspy is currently not possible. Please use
`conda <https://docs.conda.io/en/latest/>`_ to install HyperSpy, instead.
* ``fftw`` will install `PyFFTW <https://github.com/pyFFTW/pyFFTW>`_ to speed up Fourier transforms used in some forward models.
* ``colors`` will install the `cmocean <https://matplotlib.org/cmocean/>`_, whose ``balance`` color map is used as a default for the ``imshow`` commmand, if available.
* ``all`` will install all of the dependencies listed above.
......@@ -53,8 +53,7 @@ Structure
EMPyRe has several dedicated submodules which are fully documented `here <https://empyre.iffgit.fz-juelich.de/empyre/>`_!
* The ``fields`` submodule provides the ``Field`` container class for multidimensional scalar or vector fields and is the fundamental data structure used in EMPyRe.
* The ``fields`` submodule provides the ``Field`` container class for multidimensional scalar or vector fields and is the fundamental data structure used in EMPyRe.
* The ``vis`` submodule enables the plotting of ``Field`` objects, based on and similar in syntax to the commonly known `matplotlib <https://matplotlib.org/>`_ framework.
......@@ -68,4 +67,4 @@ EMPyRe has several dedicated submodules which are fully documented `here <https:
License
-------
EMPyRe is licensed under `GPLv3 <https://iffgit.fz-juelich.de/empyre/empyre/-/blob/master/LICENSE>`_.
EMPyRe is licensed under `GPLv3 <https://iffgit.fz-juelich.de/empyre/empyre/-/blob/master/LICENSE>`_.
empyre.fields package
=====================
Submodules
----------
empyre.fields.field module
--------------------------
.. automodule:: empyre.fields.field
:members:
:undoc-members:
:show-inheritance:
empyre.fields.shapes module
---------------------------
.. automodule:: empyre.fields.shapes
:members:
:undoc-members:
:show-inheritance:
empyre.fields.vectors module
----------------------------
.. automodule:: empyre.fields.vectors
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: empyre.fields
:members:
:undoc-members:
:show-inheritance:
empyre.io package
=================
Module contents
---------------
.. automodule:: empyre.io
:members:
:undoc-members:
:show-inheritance:
empyre.models package
=====================
Module contents
---------------
.. automodule:: empyre.models
:members:
:undoc-members:
:show-inheritance:
empyre.reconstruct package
==========================
Module contents
---------------
.. automodule:: empyre.reconstruct
:members:
:undoc-members:
:show-inheritance:
empyre package
==============
Subpackages
-----------
.. toctree::
empyre.fields
empyre.io
empyre.models
empyre.reconstruct
empyre.vis
Submodules
----------
empyre.version module
---------------------
.. automodule:: empyre.version
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: empyre
:members:
:undoc-members:
:show-inheritance:
empyre.vis package
==================
Submodules
----------
empyre.vis.colors module
------------------------
.. automodule:: empyre.vis.colors
:members:
:undoc-members:
:show-inheritance:
empyre.vis.decorators module
----------------------------
.. automodule:: empyre.vis.decorators
:members:
:undoc-members:
:show-inheritance:
empyre.vis.plot2d module
------------------------
.. automodule:: empyre.vis.plot2d
:members:
:undoc-members:
:show-inheritance:
empyre.vis.tools module
-----------------------
.. automodule:: empyre.vis.tools
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: empyre.vis
:members:
:undoc-members:
:show-inheritance:
empyre
======
.. toctree::
:maxdepth: 4
empyre
......@@ -2,3 +2,21 @@ The Field container class
=========================
Field docu here!
Submodules
----------
.. toctree::
empyre.fields.field
empyre.fields.shapes
empyre.fields.vectors
Module contents
---------------
.. automodule:: empyre.fields
:members:
:undoc-members:
:show-inheritance:
......@@ -438,7 +438,7 @@ class Field(NDArrayOperatorsMixin):
The calculation depends on the input:
3 dimensions, 3 components: Calculates the full 3D rotational vector field!
2 dimensions, 2 components: Calculates the out-of-plane component of the curl as a 2D scalar field!
2 dimensions, scalar: Calculates the planar rotatio as a 2D vector field!
2 dimensions, scalar: Calculates the planar rotation as a 2D vector field!
"""
self._log.debug('Calling curl')
......@@ -447,12 +447,12 @@ class Field(NDArrayOperatorsMixin):
if squeezed_field.ncomp == 3: # 3 component vector field (standard case):
self._log.debug('input: 3 dimensions, 3 components!')
field_x, field_y, field_z = squeezed_field.comp
grad_xx, grad_xy, grad_xz = field_x.gradient().comp
grad_yx, grad_yy, grad_yz = field_y.gradient().comp
grad_zx, grad_zy, grad_zz = field_z.gradient().comp
curl_x = grad_zy - grad_yz
curl_y = grad_xz - grad_zx
curl_z = grad_yx - grad_xy
gradx_x, grady_x, gradz_x = field_x.gradient().comp
gradx_y, grady_y, gradz_y = field_y.gradient().comp
gradx_z, grady_z, gradz_z = field_z.gradient().comp
curl_x = grady_z - gradz_y
curl_y = gradz_x - gradx_z
curl_z = gradx_y - grady_x
return Field.from_scalar_fields([curl_x, curl_y, curl_z])
else:
raise AssertionError('Can only handle 3 component vector fields in 3D!')
......@@ -460,14 +460,14 @@ class Field(NDArrayOperatorsMixin):
if squeezed_field.ncomp == 2: # 2 component vector field (return perpendicular component as scalar field):
self._log.debug('input: 2 dimensions, 2 components!')
field_x, field_y = squeezed_field.comp
grad_xx, grad_xy = field_x.gradient().comp
grad_yx, grad_yy = field_y.gradient().comp
return grad_yx - grad_xy
gradx_x, grady_x = field_x.gradient().comp
gradx_y, grady_y = field_y.gradient().comp
return gradx_y - grady_x
elif not squeezed_field.vector: # scalar field (return planar components as 2D vector field):
self._log.debug('input: 3 dimensions, scalar field!')
grad_x, grad_y = squeezed_field.gradient().comp
curl_x = grad_y
curl_y = -grad_x
gradx, grady = squeezed_field.gradient().comp
curl_x = grady
curl_y = -gradx
return Field.from_scalar_fields([curl_x, curl_y])
else:
raise AssertionError('Can only handle 3 component vector or scalar fields in 2D!')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment