Skip to content

Commit

Permalink
Merge branch 'develop' into release/2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WeisLeDocto authored Nov 28, 2023
2 parents e2591cc + 565fe7d commit a225880
Show file tree
Hide file tree
Showing 166 changed files with 2,497 additions and 869 deletions.
6 changes: 6 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@

# PIERROOOTT owns the Gstreamer cameras
/src/crappy/camera/gstreamer_* @WeisLeDocto @PIERROOOTT

# PIERROOOTT owns the Opencv cameras
/src/crappy/camera/opencv_* @WeisLeDocto @PIERROOOTT

# PIERROOOTT owns the base v4l2 class
/src/crappy/camera/_v4l2_base.py @WeisLeDocto @PIERROOOTT
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

2 changes: 2 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
API
===

.. sectionauthor:: Antoine Weisrock <[email protected]>

This section contains the inline documentation of all the objects of the module
Crappy. In particular, a description is given for each possible argument of the
classes and methods. The only way to get an even finer understanding of an
Expand Down
2 changes: 2 additions & 0 deletions docs/source/citing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Citing Crappy
==============

.. sectionauthor:: Antoine Weisrock <[email protected]>

If Crappy has been of help in your research, please reference it in your
academic publications by citing one or both of the following articles :

Expand Down
14 changes: 10 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# -- Project information -----------------------------------------------------

project = 'Crappy'
author = 'Antoine Weisrock'
author = 'LaMcube and contributors'
copyright = f"{strftime('%Y', gmtime())}, {author}"
version = match(r'\d+\.\d+', __version__).group()
release = __version__
Expand All @@ -37,7 +37,7 @@
# Including undocumented features
autodoc_default_options = {'undoc-members': True}
# The codeauthor and sectionauthor directives do produce output
show_authors = True
show_authors = False

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand All @@ -52,7 +52,9 @@
'sphinx.ext.mathjax',
'sphinx.ext.duration',
'sphinx_copybutton',
'sphinx_tabs.tabs'
'sphinx_tabs.tabs',
'sphinx_toolbox.collapse',
'sphinx_toolbox.changeset'
]

# Tabs settings
Expand Down Expand Up @@ -232,4 +234,8 @@
# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'matplotlib': ('https://matplotlib.org/stable/', None),
'psutil': ('https://psutil.readthedocs.io/en/latest/', None)}
9 changes: 8 additions & 1 deletion docs/source/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Developers information
Contributing to Crappy
----------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

If you want to help developing Crappy with us, we'll be more than happy to
welcome you in the community ! Here you'll find some practical information on
**how Crappy works under the hood, and a few guidelines for contributors**.
Expand Down Expand Up @@ -40,6 +42,8 @@ directly committed to.
Technical description of Crappy
-------------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

.. note::
This is a very simplified overview of how the module actually works. Only the
main ideas are presented, and many technical aspects are omitted. Reading the
Expand Down Expand Up @@ -248,6 +252,8 @@ the examples.
Detailed runtime sequence of Crappy
-----------------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

Crappy's main strength lies in the use of massive parallelization to maximize
the performance of the module. Unfortunately, this means we had to cope with
Python's notoriously complex :mod:`multiprocessing` architecture, and come up
Expand Down Expand Up @@ -406,7 +412,8 @@ cases :

- If all the Blocks are not done running at the end of this phase.
- If an :exc:`Exception` was caught during Crappy's execution.
- If Crappy was stopped using CTRL+C, resulting in a :exc:`KeyboardInterrupt`.
- If Crappy was stopped using :kbd:`Control-c`, resulting in a
:exc:`KeyboardInterrupt`.

The goal of this exception is to stop the execution of the ``__main__``
Process, to avoid any more code to be executed in case something went wrong in
Expand Down
8 changes: 8 additions & 0 deletions docs/source/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Current functionalities
=======================

.. sectionauthor:: Antoine Weisrock <[email protected]>

On this page are listed all the objects currently distributed with Crappy and
exposed to the users. Information on how to use them can be found in the
:ref:`Tutorials`, as well as guidelines for creating your own objects. For most
Expand All @@ -14,6 +16,8 @@ can click on its name to open the complete documentation given in the
Functionalities (Blocks)
------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

The Blocks are the base bricks of Crappy, that fulfill various functions. In
the tutorials, you can learn more about :ref:`how to use Blocks
<1. Understanding Crappy's syntax>` and :ref:`how to create new Blocks
Expand Down Expand Up @@ -366,6 +370,8 @@ Others
Supported hardware (Cameras, InOuts, Actuators)
-----------------------------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

Supported Cameras
+++++++++++++++++

Expand Down Expand Up @@ -810,6 +816,8 @@ LaMcube-specific hardware
On-the-fly data modification (Modifiers)
----------------------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

- :ref:`Demux`

Takes the signal returned by a streaming :ref:`IOBlock` and transforms it
Expand Down
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Crappy
======

.. sectionauthor:: Antoine Weisrock <[email protected]>

Crappy is a **Python module** that aims to provide easy-to-use and open-source
tools for **command and data acquisition on complex experimental setups**. It
is designed to let users drive most setups in **less than 100 lines of code**.
Expand Down
10 changes: 10 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Installation
Requirements
------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

Crappy was successfully installed and tested on **Linux** (Ubuntu 18.04 and
higher), **Windows** (8 and higher) and **MacOS** (Sierra and higher). It was
also successfully installed on **Raspberry Pi** 3B+ and 4B. As a Python module,
Expand Down Expand Up @@ -45,6 +47,8 @@ functionalities (this list is not exhaustive) :
1. Check your Python version
----------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

Before installing Crappy, first check that you have **a compatible version of**
**Python** installed. You can get the current version of Python by running
:shell:`python --version` in a console. The version should then be displayed,
Expand All @@ -67,6 +71,8 @@ are beyond the scope of this documentation.
2. Deploy a virtual environment (optional)
------------------------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

It is **recommended** to install Crappy in a `virtual environment
<https://docs.python.org/3/library/venv.html>`_, to avoid conflicts with other
Python packages installed at the user or system level. This step is however not
Expand All @@ -85,6 +91,8 @@ console, containing an independent install of Python.
3. Install Crappy
-----------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

Once you have a compatible version of Python installed, and after optionally
setting up a virtual environment, you're **ready to install Crappy**. A single
line of code is necessary to install Crappy :
Expand Down Expand Up @@ -143,6 +151,8 @@ you would need to use along with Crappy. For example :
4. Check your install
---------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

Once you have installed Crappy, you can **run a few checks** to make sure it
works fine on your system. First, try to simply import it :

Expand Down
3 changes: 2 additions & 1 deletion docs/source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
numpy==1.24.3
sphinx_copybutton==0.5.2
sphinx-tabs==3.4.1
sphinx-rtd-theme==1.3.0
sphinx-rtd-theme==1.3.0
sphinx-toolbox==3.5.0
2 changes: 2 additions & 0 deletions docs/source/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Troubleshooting
===============

.. sectionauthor:: Antoine Weisrock <[email protected]>

When encountering a problem with Crappy, please **first carefully read the**
**present documentation**. Most of the difficulties users may face come from an
incorrect use of Crappy. If you cannot find an answer in the documentation, you
Expand Down
36 changes: 29 additions & 7 deletions docs/source/tutorials/complex_custom_objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
More about custom objects in Crappy
===================================

.. sectionauthor:: Antoine Weisrock <[email protected]>

.. role:: py(code)
:language: python
:class: highlight
Expand All @@ -15,6 +17,8 @@ understanding of the module, or users with a specific need.
1. Custom Generator Paths
-------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

Starting from version 2.0.0, **it is now possible for users to create their**
**own** :ref:`Generator Paths` ! There are two reasons why this possibility was
added so late in the module. First, we're not certain that there is a need for
Expand Down Expand Up @@ -92,13 +96,17 @@ clearer how to create a custom Generator Path and how to handle the
conditions. This example generates a square wave, whose duty cycle can be
either fixed or controlled by the value of an input label :

.. literalinclude:: /downloads/complex_custom_objects/custom_path.py
:language: python
:emphasize-lines: 35, 40-41, 49, 52-53
.. collapse:: (Expand to see the full code)

.. literalinclude:: /downloads/complex_custom_objects/custom_path.py
:language: python
:emphasize-lines: 35, 40-41, 49, 52-53

|
.. Note::
To run this example, you'll need to have the *matplotlib* and *scipy* Python
modules installed.
To run this example, you'll need to have the :mod:`matplotlib` and *scipy*
Python modules installed.

This example contains all the ingredients described above. The parent class is
initialized, then the :py:`condition` argument is parsed with
Expand Down Expand Up @@ -142,6 +150,8 @@ labels).
2. More about custom InOuts
---------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

In addition to what was described in the tutorial section about :ref:`how to
create custom InOut objects <3. Custom InOuts>`, there is one more minor
feature that the :ref:`In / Out` possess and that is worth describing in the
Expand Down Expand Up @@ -180,6 +190,8 @@ users to override it.
3. More about custom Actuators
------------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

In the tutorial section about :ref:`how to create custom Actuator objects
<2. Custom Actuators>`, then entire speed management aspect in :py:`position`
mode was left out. **In this section, we're going to cover in more details**
Expand Down Expand Up @@ -224,6 +236,8 @@ examples/blocks>`_.
4. More about custom Cameras
----------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

Because image acquisition is such a complex topic, the
:class:`~crappy.camera.Camera` object is by far the richest of the classes
interfacing with hardware in Crappy. For that reason, not all of its features
Expand Down Expand Up @@ -385,6 +399,8 @@ will change in future releases !
5. Custom Camera Blocks
-----------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

On the previous tutorial page, :ref:`a section <5. Custom Blocks>` was
dedicated to the instantiation of custom :ref:`Blocks`. Always moving one step
further into customization, we're going to see in this section how you can
Expand Down Expand Up @@ -672,8 +688,12 @@ that is the final object called by the user in its script. Based on these
development, here is a final runnable code performing eye detection and adding
the detected eyes on the displayed images :

.. literalinclude:: /downloads/complex_custom_objects/custom_camera_block.py
:language: python
.. collapse:: (Expand to see the full code)

.. literalinclude:: /downloads/complex_custom_objects/custom_camera_block.py
:language: python

|
.. Note::
To run this example, you'll need to have the *opencv-python* and *Pillow*
Expand All @@ -694,6 +714,8 @@ aspects in future releases.
6. Sharing custom objects and Blocks
------------------------------------

.. sectionauthor:: Antoine Weisrock <[email protected]>

You have been through all the tutorials of Crappy and have now become a master
at creating and using your own objects, and you now **want to share your**
**works with other user** ? No problem ! There are several options for that,
Expand Down
Loading

0 comments on commit a225880

Please sign in to comment.