Skip to content

Commit

Permalink
Fixes to docs.
Browse files Browse the repository at this point in the history
Changed "sLEAP" to "SLEAP".
Added modules to tree.
Misc fixes to docstrings.
  • Loading branch information
ntabris committed Sep 30, 2019
1 parent ff4de22 commit f6b57cc
Show file tree
Hide file tree
Showing 16 changed files with 201 additions and 71 deletions.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = ..\..\sleap-docs
BUILDDIR = ../../sleap-docs

# Export the BUILDDIR so we can pick it up in conf.py. We need this to
# be able to copy some the files in _static to an alternative location
Expand Down
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# -- Project information -----------------------------------------------------

project = 'LEAP'
project = 'SLEAP'
copyright = '2019, Murthy Lab @ Princeton'
author = 'Talmo D. Pereira, Nat Tabris, David M. Turner'

Expand Down Expand Up @@ -105,7 +105,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'sLEAPdoc'
htmlhelp_basename = 'SLEAPdoc'


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -132,7 +132,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'sLEAP.tex', 'sLEAP Documentation',
(master_doc, 'SLEAP.tex', 'SLEAP Documentation',
'Talmo D. Pereira, Nat Tabris, David M. Turner', 'manual'),
]

Expand All @@ -142,7 +142,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'sleap', 'sLEAP Documentation',
(master_doc, 'Sleap', 'SLEAP Documentation',
[author], 1)
]

Expand All @@ -153,8 +153,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'sLEAP', 'sLEAP Documentation',
author, 'sLEAP', 'One line description of project.',
(master_doc, 'SLEAP', 'SLEAP Documentation',
author, 'SLEAP', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
90 changes: 86 additions & 4 deletions docs/gui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,100 @@ GUI

.. automodule:: sleap.gui.app
:members:

Video Player
-------------
.. automodule:: sleap.gui.video
:members:

Dialogs
-------------

Active Learning
^^^^^^^^^^^^^^^
.. automodule:: sleap.gui.active
:members:

Video Importer
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.importvideos
:members:
.. automodule:: sleap.gui.confmapsplot

Merging
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.merge
:members:
.. automodule:: sleap.gui.quiverplot

Shortcuts
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.shortcuts
:members:
.. automodule:: sleap.gui.dataviews

Suggestions
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.suggestions
:members:
.. automodule:: sleap.gui.multicheck

Training Profiles
^^^^^^^^^^^^^^^^^
.. automodule:: sleap.gui.training_editor
:members:

Other Widgets
-------------

Form builder
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.formbuilder
:members:

Slider
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.slider
:members:

Multicheck
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.multicheck
:members:

Overlays
-------------

Instances
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.overlays.instance
:members:

Tracks
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.overlays.tracks
:members:

Anchors
^^^^^^^^^^^^^^
.. automodule:: sleap.gui.overlays.anchors
:members:

Datasource classes
^^^^^^^^^^^^^^^^^^
.. automodule:: sleap.gui.overlays.base
:members:

Confidence maps
^^^^^^^^^^^^^^^
.. automodule:: sleap.gui.overlays.confmaps
:members:


Part affinity fields
^^^^^^^^^^^^^^^^^^^^
.. automodule:: sleap.gui.overlays.pafs
:members:



Dataviews
-------------
.. automodule:: sleap.gui.dataviews
:members:
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.. _sleap:
.. toctree::
:caption: sLEAP Package
:caption: SLEAP Package
:maxdepth: 3

tutorial
Expand All @@ -14,6 +14,7 @@
training
inference
gui
misc

.. _Indices_and_Tables:

Expand Down
35 changes: 35 additions & 0 deletions docs/misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Misc
========

Utils
-------------
.. automodule:: sleap.util
:members:

Range list
-------------
.. automodule:: sleap.rangelist
:members:

Legacy formats
--------------
.. automodule:: sleap.io.legacy
:members:

Info tools
----------

Metrics
^^^^^^^^^^^^^^
.. automodule:: sleap.info.metrics
:members:

Summary
^^^^^^^^^^^^^^
.. automodule:: sleap.info.summary
:members:

Track Analysis
^^^^^^^^^^^^^^
.. automodule:: sleap.info.write_tracking_h5
:members:
22 changes: 11 additions & 11 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Tutorial
========

Before you can use sLEAP, you’ll need to install it. Follow the
instructions at :ref:`Installation` to install sLEAP and
Before you can use SLEAP, you’ll need to install it. Follow the
instructions at :ref:`Installation` to install SLEAP and
start the GUI app.

There are three main stages of using sLEAP:
There are three main stages of using SLEAP:

1. Creating a project, opening a movie and defining the skeleton;

Expand All @@ -18,7 +18,7 @@ There are three main stages of using sLEAP:
Stage 1: Creating a project
---------------------------

When you first start sLEAP you’ll see an open dialog. Since you don’t
When you first start SLEAP you’ll see an open dialog. Since you don’t
yet have a project to open, click “Cancel” and you’ll be left with a
new, empty project.

Expand All @@ -32,7 +32,7 @@ on the right side of the main window, the “Add Video” command in the
|image0|

You’ll then be able to select one or more video files and click “Open”.
sLEAP currently supports mp4, avi, and h5 files. For mp4 and avi files,
SLEAP currently supports mp4, avi, and h5 files. For mp4 and avi files,
you’ll be asked whether to import the video as grayscale. For h5 files,
you’ll be asked the dataset and whether the video is stored with
channels first or last.
Expand Down Expand Up @@ -65,7 +65,7 @@ Stage 2: Labeling and learning

We start by assembling a candidate group of images to label. You can
either pick your own frames or let the system suggest a set of frames
using the “Generate Suggestions” panel. sLEAP can choose these frames
using the “Generate Suggestions” panel. SLEAP can choose these frames
(i) randomly, or using (ii) Strides (evenly spaced samples), (iii) PCA
(runs Principle Component Analysis on the images, clusters the images
into groups, and uses sample frames from each cluster), or (iv) BRISK
Expand Down Expand Up @@ -102,9 +102,9 @@ Saving
~~~~~~

Since this is a new project, you’ll need to select a location and name
the first time you save. sLEAP will ask you to save before closing any
the first time you save. SLEAP will ask you to save before closing any
project that has been changed to avoid losing any work. Note: There is
not yet an “undo” feature built into sLEAP. If you want to make
not yet an “undo” feature built into SLEAP. If you want to make
temporary changes to a project, use the “Save As…” command first to save
a copy of your project.

Expand Down Expand Up @@ -197,7 +197,7 @@ model doesn’t improve for a certain number of epochs (15 by default)
First we train a model for confidence maps, part affinity fields, and
centroids, and then we run inference. The GUI doesn’t yet give you a way
to monitor the progress during inference, although you can get more
information in the console window from which you started sLEAP.
information in the console window from which you started SLEAP.

When active learning finishes, you’ll be told how many instances were
predicted. Suggested frames with predicted instances will be marked in
Expand Down Expand Up @@ -265,7 +265,7 @@ Running inference remotely (optional)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It’s also possible to run inference using the command line interface, which is
useful if you’re going to run on a cluster). The command to run inference on
useful if you’re going to run on a cluster. The command to run inference on
an entire video is:

::
Expand All @@ -276,7 +276,7 @@ an entire video is:
-m path/to/models/your_paf_model.json \
-m path/to/models/your_centroid_model.json

The predictions will be saved in path/to/video.mp4.predictions.json.zip,
The predictions will be saved in path/to/video.mp4.predictions.h5,
which you can open from the GUI app. You can also import these predictions into
your project by opening your project and then using the "Import Predictions..."
command in the "Predict" menu.
Expand Down
4 changes: 2 additions & 2 deletions sleap/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class MainWindow(QMainWindow):
"""The SLEAP GUI application.
Each project (`Labels` dataset) that you have loaded in the GUI will
have it's own `MainWindow` object.
have its own `MainWindow` object.
Attributes:
labels: The :class:`Labels` dataset. If None, a new, empty project
(i.e., :class:`Labels' object) will be created.
(i.e., :class:`Labels` object) will be created.
skeleton: The active :class:`Skeleton` for the project in the gui
video: The active :class:`Video` in view in the gui
"""
Expand Down
8 changes: 5 additions & 3 deletions sleap/gui/formbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Module for creating a form from a yaml file.
Example:
>>> widget = YamlFormWidget(yaml_file="example.yaml")
>>> widget.mainAction.connect(my_function)
Expand Down Expand Up @@ -81,7 +82,7 @@ class FormBuilderLayout(QtWidgets.QFormLayout):
Custom QFormLayout which populates itself from list of form fields.
Args:
items_to_create: list which gets passed to :method:`get_form_data`
items_to_create: list which gets passed to :meth:`get_form_data`
(see there for details about format)
"""

Expand Down Expand Up @@ -183,7 +184,8 @@ def build_form(self, items_to_create: List[Dict[str, Any]]):
"""Adds widgets to form layout for each item in items_to_create.
Args:
items_to_create: list of dictionaries with fields:
items_to_create: list of dictionaries with keys
* name: used as key when we return form data as dict
* label: string to show in form
* type: supports double, int, bool, list, button, stack
Expand Down Expand Up @@ -311,7 +313,7 @@ class StackBuilderWidget(QtWidgets.QWidget):
The "options" key will give the list of options to show in
menu. Each of the "options" will also be the key of a dictionary
within stack_data that has the same structure as the dictionary
passed to :method:`FormBuilderLayout.build_form()`.
passed to :meth:`FormBuilderLayout.build_form()`.
"""

def __init__(self, stack_data, *args, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions sleap/gui/importvideos.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
method while passing the user-selected params as the named parameters:
>>> vid = item["video_class"](**item["params"])
"""

from PySide2.QtCore import Qt, QRectF, Signal
Expand Down
2 changes: 1 addition & 1 deletion sleap/gui/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class MergeTable(QtWidgets.QTableView):
Args:
merged: The frames that were cleanly merged.
See :method:`Labels.complex_merge_between` for details.
See :meth:`Labels.complex_merge_between` for details.
"""

def __init__(self, merged, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion sleap/gui/overlays/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class TrackTrailOverlay:
trail_length: The maximum number of frames to include in trail.
Usage:
After class is instantiated, call :method:`add_to_scene(frame_idx)`
After class is instantiated, call :meth:`add_to_scene(frame_idx)`
to plot the trails in scene.
"""

Expand Down
7 changes: 4 additions & 3 deletions sleap/gui/suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class VideoFrameSuggestions:
* proofreading
Each of algorithm method should accept `video`; other parameters will be
passed from the `params` dict given to :method:`suggest()`.
passed from the `params` dict given to :meth:`suggest`.
"""

Expand Down Expand Up @@ -343,9 +343,10 @@ def clusters_to_list(

@classmethod
def get_scale_factor(cls, video: "Video") -> int:
"""Determines how much we need to scale to get video within size.
"""
Determines how much we need to scale to get video within size.
Size is specified by :attribute:`rescale_below`.
Size is specified by :attr:`rescale_below`.
"""
factor = 1
if cls.rescale:
Expand Down
Loading

0 comments on commit f6b57cc

Please sign in to comment.