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

Added automated way to build documentation and deploy it to github pages #126

Merged
merged 44 commits into from
Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a25d008
documentation auto-deployment added
Feb 19, 2021
d77c977
documentation auto-deployment added - fix typo
Feb 19, 2021
59969ed
documentation auto-deployment added - fix typo
Feb 19, 2021
bb3ae2d
documentation auto-deployment added - fix typo2
Feb 19, 2021
f7f86f8
test automatic deployment
Feb 19, 2021
6d44c9b
fixed python version - 3.9 too new
Feb 19, 2021
9442f85
working deployment verion
Feb 19, 2021
4a2a393
working deployment verion - fix typo
Feb 19, 2021
db43827
update automatic documentation sashimi
fedem-p Mar 30, 2021
20b9220
update github token
fedem-p Mar 30, 2021
025d233
test api
fedem-p Mar 30, 2021
b4124ae
+ api + titles + logo
fedem-p Mar 30, 2021
d687795
fix api + logo
fedem-p Mar 30, 2021
e60fc29
fix intro + logo
fedem-p Mar 30, 2021
41bb921
fix intro from readme
fedem-p Mar 30, 2021
ad58c1e
fix intro from readme
fedem-p Mar 30, 2021
007d2f7
fix intro from readme
fedem-p Mar 30, 2021
4aea6a0
fix intro from readme 2
fedem-p Mar 30, 2021
a44da1e
fix intro from readme 2
fedem-p Mar 30, 2021
1e0a112
fix intro from readme 3
fedem-p Mar 30, 2021
6bfd568
fix intro from readme 4
fedem-p Mar 30, 2021
1904ae9
fix intro from readme 4
fedem-p Mar 30, 2021
13b82ec
fix intro from readme 5
fedem-p Mar 30, 2021
529e057
fix intro from readme 6
fedem-p Mar 30, 2021
27a0e39
step back
fedem-p Mar 30, 2021
27f234f
only master push
fedem-p Mar 30, 2021
a1f0b90
changed intro
fedem-p Mar 30, 2021
9898328
only master push
fedem-p Mar 30, 2021
5bed5cf
reduce doc deploy
fedem-p Apr 14, 2021
413a51f
fixed logo
fedem-p Apr 14, 2021
452da3f
fixed logo
fedem-p Apr 14, 2021
addd5e1
logo
fedem-p Apr 15, 2021
8b8804d
link readme
fedem-p Apr 15, 2021
9d788e4
test logo
fedem-p Apr 15, 2021
06987d6
link readme 2
fedem-p Apr 15, 2021
ccff91a
test logo 2
fedem-p Apr 15, 2021
72946bf
link readme 3
fedem-p Apr 15, 2021
e1fd538
test logo 3
fedem-p Apr 15, 2021
03013b5
test logo 4
fedem-p Apr 15, 2021
4b5d92f
test logo 5
fedem-p Apr 15, 2021
9b5887f
test logo 6
fedem-p Apr 15, 2021
ad3f654
restyle docs
fedem-p Apr 15, 2021
32f4b7d
restyle docs
fedem-p Apr 15, 2021
ead3a98
restyle docs
fedem-p Apr 15, 2021
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
35 changes: 35 additions & 0 deletions .github/workflows/doc_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: page_deploy

on: #push
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main

jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Install dependencies
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
Copy link
Member

Choose a reason for hiding this comment

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

Is there a need to install all requirements from the main program, to build the docs? Is just toml enough maybe? Or not even, in which case Install dependencies job can be skipped altogether.

Copy link
Member Author

Choose a reason for hiding this comment

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

You were right! Thanks!

# Build the book
- name: Build the book
run: |
make docs
# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: docs

docs:
rm -rf docs/_build/html
find docs/api ! -name 'index.rst' -type f -exec rm -f {} +
pip install -qr docs/requirements.txt
pip install -r requirements.txt
pip install -r requirements_dev.txt
pip install -e .
jb build docs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Sashimi

<a href="url"><img
src="https://github.com/portugueslab/sashimi/blob/master/sashimi/icons/main_icon.png"
src="https://github.com/portugueslab/sashimi/blob/master/sashimi/icons/main_icon.png"
align="left"
height="190"
width="270"></a>
Expand Down
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

58 changes: 58 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: Sashimi
author: Diego Asua, Vilim Stih, Luigi Petrucco @portugueslab
logo: "../sashimi/icons/main_icon.png"
copyright: Portugues lab
release: 0.2.0
# only_build_toc_files: true

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: force

# Information about where the book exists on the web
repository:
url: https://github.com/portugueslab/sashimi # Online location of your book
path_to_book: docs # Optional path to your book, relative to the repository root

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true
use_edit_page_button : false # Whether to add an "edit this page" button to pages. If `true`, repository information in repository: must be filled in
extra_navbar : Powered by <a href="https://jupyterbook.org">Jupyter Book</a> # Will be displayed underneath the left navbar.
extra_footer : "Mantained by Federico Puppo" # Will be displayed underneath the footer.

latex:
latex_engine : pdflatex # one of 'pdflatex', 'xelatex' (recommended for unicode), 'luatex', 'platex', 'uplatex'


sphinx:
extra_extensions:
- sphinx.ext.viewcode
- sphinx.ext.napoleon
- sphinx.ext.autodoc
- sphinx_autodoc_typehints
- sphinx.ext.autosummary
- sphinx.ext.intersphinx
- sphinx.ext.coverage
- sphinx.ext.inheritance_diagram
- sphinx.ext.githubpages

config:
autosummary_generate: True
autosummary_imported_members: True
html_theme: furo
templates_path:
- '_templates'
intersphinx_mapping:
python:
- "https://docs.python.org/3"
- null
numpy:
- "https://docs.scipy.org/doc/numpy/"
- null
35 changes: 35 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:show-inheritance:
:inherited-members:

{% block methods %}

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:inherited-members:
{% for item in methods %}
{% if not item.startswith('_') %}
~{{ name }}.{{ item }}
{% endif %}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
:inherited-members:
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
49 changes: 49 additions & 0 deletions docs/_templates/autosummary/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: Module Attributes

{% for item in attributes %}
.. autoattribute:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:nosignatures:
:toctree:
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

{% for item in functions %}
.. autofunction:: {{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
:nosignatures:
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
22 changes: 22 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- file: index

- part: Introduction
chapters:
- file: intro
- file: timeline

- part: Configuration
chapters:
- file: configuration/configuration

- part: Development
chapters:
- file: development/code_organization

- part: Hardware
chapters:
- file: hardware/hardware

- part: Api
chapters:
- file: api/index
24 changes: 24 additions & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. _api:

API Reference
=============

Information on specific functions, classes, and methods.


Modules
-------

For the average user's workflows.

.. autosummary::
:toctree:
:recursive:


sashimi.events
sashimi.hardware.cameras
sashimi.utilities
sashimi.processes.logging
sashimi.config
sashimi.hardware.scanning
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Welcome to the Sashimi documentation!

maybe add index here?
Copy link
Member

Choose a reason for hiding this comment

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

It should be an internal comment for us, not user-visible


94 changes: 94 additions & 0 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Sashimi

<a href="url"><img
src="https://github.com/portugueslab/sashimi/blob/master/sashimi/icons/main_icon.png"
Copy link
Member

Choose a reason for hiding this comment

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

This image does not seem to load correctly. Try without the hyperlink (<a></a>) tag:

<img src=https://github.com/portugueslab/sashimi/blob/master/sashimi/icons/main_icon.png align="left" height="190" width="270">

align="left"
height="190"
width="270"></a>

![tests](https://github.com/portugueslab/sashimi/workflows/tests/badge.svg?branch=master)
[![Docs](https://img.shields.io/badge/docs-dev-brightgreen)](https://portugueslab.github.io/sashimi/)
[![Coverage Status](https://coveralls.io/repos/github/portugueslab/sashimi/badge.svg)](https://coveralls.io/github/portugueslab/sashimi)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4122062.svg)](https://doi.org/10.5281/zenodo.4122062)
[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/)

Sashimi is a user-friendly software for efficient control of digital scanned light sheet microscopes (DSLMs).
It is developed by members of the [PortuguesLab](http://www.portugueslab.com/)
at the Technical University of Munich and Max Planck Institute of Neurobiology. Sashimi relies on the fast, multidimensional
[Napari viewer](https://github.com/napari/napari).

While built for a particular microscope configuration, the modular architecture allows for easy replacement of
hardware by other vendors (we will help with and welcome contributions for supporting other cameras, boards and light sources).



## Installation

[Install the latest Anaconda](https://www.anaconda.com/) distribution of Python 3.

Clone this repository and navigate to the main folder `../sashimi`

### Recommended: Create a new environment

It is a good practice to create an environment for every project. The provided `environment.yml` sets up almost all required dependencies (see below).

conda env create -f {path to environment.yml}

You can activate the environment by running:

conda activate sashimi

After this you moght have to install two extra dependencies for controlling a Cobolt laser:
Copy link
Member

Choose a reason for hiding this comment

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

Technically this should read for controlling a laser through serial communication, such as Cobolt lasers.


pip install pyvisa
pip install pyvisa-py

### Install with pip

For a non-editable installation run:

pip install .

Otherwise, if you want to contribute to the project as a developer, for editable installation run:

pip install -e .

Now you are ready to go!

## Configuring sashimi

Sashimi includes the `sashimi-config` module that lets you interact with the hardware and software
settings from command line. You can display the current configuration of the system.:

sashimi-config show

You can ask sashimi for help:

sashimi --help

More information on its usage can be found by asking `sashimi-config` for help:

sashimi-config --help

You can add and modify parameters just from the command line. For example, to set the piezo waveform readout channel to `Dev1/ao0:0` just run:

sashimi-config edit -n z_board.write.channel -v Dev1/ao0:0

Or to modify the minimum and maximum voltage (in Volts) of the channel:

sashimi-config edit -n piezo.position_write.min_val -v 0
sashimi-config edit -n piezo.position_write.max_val -v 10


## Starting the software from command line

Open a new anaconda prompt and activate your environment like above. Then run:

sashimi

Add the option `--scopeless`:

sashimi --scopeless

If you want to run the software with mock hardware, such as for debugging or developing.
Loading