Skip to content

Commit

Permalink
Updated the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne committed Jan 15, 2020
1 parent cb5600b commit 0bbe59f
Show file tree
Hide file tree
Showing 17 changed files with 143 additions and 58 deletions.
5 changes: 0 additions & 5 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,3 @@ include MANIFEST.in

# Matlab files
recursive-include inpystem/restore/MatlabCodes/ *

# Sample data
recursive-include inpystem/data/ *


8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
.PHONY: init test html build clean

init:
pip install -r requirements.txt

test:
py.test

html:
cd doc && make html
cd docs && make html

build:
python setup.py sdist bdist_wheel
twine check dist/*
# cf https://realpython.com/pypi-publish-python-package/#different-ways-of-calling-a-package
# cf
# https://realpython.com/pypi-publish-python-package/#different-ways-of-calling-a-package
# https://packaging.python.org/tutorials/packaging-projects/
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

clean:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ This library was originally developed by its creator Etienne Monier to handle EE

## Documentation

This project documentation is hosted by [ReadTheDocs](https://readthedocs.org/). To access to it, please follow [this link](https://inpystem.readthedocs.io/en/latest/index.html).
This project documentation is hosted by [ReadTheDocs](https://readthedocs.org/). To access to it, please follow [this link](https://inpystem.readthedocs.io/en/latest/).

## Licence

This library is distributed under the MIT license.
This library is distributed under the MIT license.
2 changes: 1 addition & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Full inpystem API documentation
=============================
===============================

.. automodule:: inpystem

Expand Down
3 changes: 2 additions & 1 deletion docs/source/api/restore.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
inpystem.restore subpackage
=========================
===========================

.. automodule:: inpystem.restore

Expand All @@ -12,4 +12,5 @@ inpystem.restore subpackage
restore/LS_3D
restore/LS_CLS
restore/DL_ITKrMM
restore/DL_ITKrMM_matlab
restore/DL_BPFA
4 changes: 1 addition & 3 deletions docs/source/api/restore/DL_ITKrMM.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ The ITKrMM algorithm

.. autofunction:: inpystem.restore.DL_ITKrMM.ITKrMM

.. autofunction:: inpystem.restore.DL_ITKrMM.ITKrMM_matlab

The wKSVD algorithm
-------------------

.. autofunction:: inpystem.restore.DL_ITKrMM.wKSVD_matlab
.. autofunction:: inpystem.restore.DL_ITKrMM.wKSVD

Patch manipulation functions
----------------------------
Expand Down
19 changes: 19 additions & 0 deletions docs/source/api/restore/DL_ITKrMM_matlab.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
inpystem.restore.DL_ITKrMM module
===================================

.. automodule:: inpystem.restore.DL_ITKrMM_matlab

The ITKrMM algorithm
--------------------

.. autofunction:: inpystem.restore.DL_ITKrMM_matlab.ITKrMM_matlab

The wKSVD algorithm
-------------------

.. autofunction:: inpystem.restore.DL_ITKrMM_matlab.wKSVD_matlab

The dictionary learning interface
---------------------------------

.. autoclass:: inpystem.restore.DL_ITKrMM_matlab.Matlab_Dico_Learning_Executer
2 changes: 1 addition & 1 deletion docs/source/developper_guide.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
inpystem Developper Guide
=======================
=========================

Well, for now, this small library is developed by myself. I don't know yet how much this could be usefull. However, if someone is interested to help me, please let me know at *etienne[dot]monier[at]enseeiht[dot]fr*.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
contain the root `toctree` directive.
Welcome to inpystem's documentation!
==================================
====================================

.. toctree::
:maxdepth: 1
Expand Down
9 changes: 6 additions & 3 deletions docs/source/user/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Getting started
In this documentation, we will assume that the reader can write some command line or jupyter python.

Starting inpystem in python
-------------------------
---------------------------

inpystem can be imported in python just as any python package.

Expand Down Expand Up @@ -121,7 +121,7 @@ Well, data here are nothing else than `HyperSpy`_ data. Please refer to its `doc
.. _sec-result-data:

The result is inpystem data
-------------------------
---------------------------

As explained previously, the inpystem data is the combination of a :class:`~.signals.Scan` object and an HyperSpy data. Two classes are proposed to the user:

Expand Down Expand Up @@ -219,6 +219,9 @@ Other arguments (such as the scan pattern ratio) can be passed to the two load f

.. _this page: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure

.. note::
From this point, the examples can be tested directly in the command line as long as the data path is set and that the inpystem example data are downloaded and placed inside the data path. See :ref:`example_data` for more details.

What about restoration ?
------------------------

Expand All @@ -229,7 +232,7 @@ The methods to reconstruct the data include nearest neighbor interpolation, regu
.. code-block:: python
>>> import inpystem
>>> data = inpystem.load_example('HR-sample', ndim=2, scan_ratio=0.2) # This loads example data.
>>> data = inpystem.load_key('HR-sample', ndim=2, scan_ratio=0.2) # This loads example data.
Reading configuration file ...
Generating data ...
Creating STEM acquisition...
Expand Down
17 changes: 11 additions & 6 deletions docs/source/user/initializing_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The sampling scan can last be initialized with the :meth:`~.signals.Scan.random`
Construct inpystem data manually
------------------------------
--------------------------------

As explained in :ref:`sec-result-data`, the inpystem data is composed of a :class:`~.signals.Scan` object which defines the sampling pattern and the HyperSpy data which stores the data. Once both have been defined, the inpystem structure can be defined by hand.

Expand All @@ -70,7 +70,7 @@ As explained in :ref:`sec-result-data`, the inpystem data is composed of a :clas
Construct inpystem data from a Numpy array
----------------------------------------
------------------------------------------

In case your image is a numpy array, one should define the HyperSpy data before creating the inpystem data.

Expand All @@ -89,7 +89,7 @@ Well, the problem here, which is the same as for numpy-based HyperSpy data, is t


Construct inpystem data from a configuration file
-----------------------------------------------
-------------------------------------------------

As explained in :ref:`sec-loading-data`, inpystem can load data from a :code:`.conf` configuration file. This is loaded by using the :func:`~.dataset.load_file` function (or the :func:`~.dataset.load_key` function if the configuration file is in the data path). To that end, a configuration file gives to inpystem all important informations.

Expand Down Expand Up @@ -172,11 +172,16 @@ And the data would be loaded by simply typing this.
>>> inpystem.load_file('my-nice-file.conf', scan_ratio=0.5, scan_seed=0)
.. _example_data:

Loading example data for fast testing
-------------------------------------
Some example data for fast testing
----------------------------------

The package is delivered with some toy data for testng which are not provided inside the package itself due to the high data size. Please download it at the `github project page`_ under location :code:`DATA/` and copy it to your data path (see :ref:`sec-loading-data`). These data can be called afterwards with the :func:`~.dataset.load_key` function.

.. _github project page: https://github.com/etienne-monier/inpystem

Last way to load data, use one of the example data provided by inpystem. To that end, just use the :func:`~.dataset.load_example` function just as the :func:`~.dataset.load_key` with one of the following keys:
The three example data are called with the following keys:

* :code:`'HR-sample'`: this is a real atomic-scale HAADF/EELS sample,
* :code:`'HR-synth'`: this is a synthetic EELS image generated to be similar to :code:`'HR-sample'`,
Expand Down
63 changes: 60 additions & 3 deletions docs/source/user/installation.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,66 @@
Installing inpystem
=================
===================

Well, for the moment, please use.
With pip
--------

inpystem is listed in the `Python Package Index`_. Therefore, it can be automatically downloaded and installed with pip. You may need to install pip for the following commands to run.

.. _Python Package Index: https://pypi.org/

Install with pip:

.. code-block:: bash
$ pip install inpystem
Install from source
-------------------

When installing manually, be sure that all dependences are required. For example, do:

.. code-block:: bash
$ pip install numpy scipy matplotlib hyperspy scikit-learn scikit-image
Be aware that the scikit-image package versions is above 0.16.

Released version
~~~~~~~~~~~~~~~~

To install from source grab a tar.gz release from `Python Package Index <https://pypi.org/>` and use the following code if Linux/Mac user:

.. code-block:: bash
$ tar -xzf inpystem.tar.gz
$ cd inpystem
$ python setup.py install
You can also use a Python installer, e.g.

.. code-block:: bash
$ pip install inpystem.tar.gz
Development version
~~~~~~~~~~~~~~~~~~~

To get the development version from our git repository you need to install git. Then just do:

.. code-block:: bash
pip install git+https://github.com/etienne-monier/inpystem
$ git clone https://github.com/etienne-monier/inpystem
$ cd inpystem
Then, perform one of the following commands:

.. code-block:: bash
$ pip install -e .
$ python setup.py install
6 changes: 4 additions & 2 deletions docs/source/user/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Introduction
============

What is inpystem
--------------
----------------

inpystem is an open source Python library which provides tools to reconstruct partially sampled 2D images as multi-band images.

Expand All @@ -17,7 +17,9 @@ This library was originally developed by its creator Etienne Monier to handle EE
About the developer
-------------------

This library is developed by Etienne Monier, a French PhD student.
This library is developed by `Etienne Monier`_, a French PhD student.

.. _Etienne Monier: http://monier.perso.enseeiht.fr/

His research interests are in new methods and algorithms to solve challenging acquisition problems encountered in the acquisition of multi-band microscopy images. In particular, he is interested in acquiring high-SNR Electron Energy Loss Spectroscopy (EELS) images with extremely low beam energy to prevent destruction of sensitive microscopy samples. His goal is to provide to the EELS community precise algorithms to detect rapidly the presence of a chemical element inside a sample to reduce irradiation as much as possible. Such problem requires **signal processing** methods, such as **convex optimization** and **proximal splitting** methods.

Expand Down
Loading

0 comments on commit 0bbe59f

Please sign in to comment.