Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from kushalkolar/tslearn-optional
Browse files Browse the repository at this point in the history
Make tslearn optional & use readthedocs to build docs
  • Loading branch information
kushalkolar committed Jul 14, 2020
2 parents 8fef1a4 + c9113dc commit 2827cba
Show file tree
Hide file tree
Showing 54 changed files with 164 additions and 290 deletions.
2 changes: 1 addition & 1 deletion docs/source/Overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ Create shareable interactive plots where the analysis history of every datapoint

**Interactive Cross-correlation analysis**

.. thumbnail:: ./user_guides/plots/cross_cor.gif
.. image:: ./user_guides/plots/cross_cor.gif

Other types of plots: Beeswarm, Violins, KShape, Proportions, Scatter
2 changes: 1 addition & 1 deletion docs/source/api_reference/Analysis_data_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Transmission
**Inherits from BaseTransmission**

.. autoclass:: mesmerize.Transmission
:members: __init__, empty_df, from_pickle, to_pickle, from_hicke, to_hickle, from_hdf5, to_hdf5, get_proj_path, set_proj_path, to_dict, from_proj, _load_files, merge
:members: __init__, empty_df, from_pickle, to_pickle, from_hdf5, to_hdf5, get_proj_path, set_proj_path, to_dict, from_proj, _load_files, merge
:member-order: bysource

BaseTransmission
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api_reference/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ CC_Data
.. warning:: All arguments MUST be numpy.ndarray type for CC_Data for the save to be saveable as an hdf5 file. Set ``numpy.unicode`` as the **dtype** for the ``curve_uuids`` and ``labels`` arrays. If the **dtype** is ``'O'`` (object) the **to_hdf5()** method will fail.

.. autoclass:: mesmerize.analysis.cross_correlation.CC_Data
:members: __init__, ccs, lag_matrix, epsilson_matrix, curve_uuids, labels, get_threshold_matrix, from_dict, to_hdf5, from_hdf5
:members: __init__, ccs, lag_matrix, epsilon_matrix, curve_uuids, labels, get_threshold_matrix, from_dict, to_hdf5, from_hdf5
:member-order: bysource


Expand Down
2 changes: 1 addition & 1 deletion docs/source/api_reference/plotting/widgets/heatmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Heatmap with an embedded :ref:`Datapoint Tracer <API_DatapointTracer>` that can

.. autoclass:: mesmerize.plotting.HeatmapTracerWidget
:show-inheritance:
:members: plot_variant, set_update_live, set_current_datapoint, set_input, get_plot_opts, set_plot_opts, update_plot, get_cluster_kwrags, set_data, transmission, set_input, save_plot_dialog, save_plot, open_plot_dialog, open_plot, live_datapoint_tracer
:members: set_update_live, set_current_datapoint, set_input, get_plot_opts, set_plot_opts, update_plot, get_cluster_kwargs, set_data, transmission, set_input, save_plot_dialog, save_plot, open_plot_dialog, open_plot, live_datapoint_tracer
:member-order: bysource

.. autoattribute:: drop_opts
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api_reference/plotting/widgets/scatter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Scatter plot with docked Control Widget, :ref:`Datapoint Tracer <API_DatapointTr

.. autoclass:: mesmerize.plotting.ScatterPlotWidget
:show-inheritance:
:members: plot_variant, set_update_live, set_current_datapoint, set_input, get_plot_opts, set_plot_opts, update_plot, transmission, set_input, save_plot_dialog, save_plot, open_plot_dialog, open_plot, live_datapoint_tracer
:members: set_update_live, set_current_datapoint, set_input, get_plot_opts, set_plot_opts, update_plot, transmission, save_plot_dialog, save_plot, open_plot_dialog, open_plot, live_datapoint_tracer
:member-order: bysource

.. _API_Variant_PgScatterPlot:

Variant
Expand Down
7 changes: 0 additions & 7 deletions docs/source/api_reference/viewer_modules/batch_manager.rst

This file was deleted.

8 changes: 4 additions & 4 deletions docs/source/api_reference/viewer_modules/roi_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ BaseROI

.. autoclass:: mesmerize.viewer.modules.roi_manager_modules.roi_types.BaseROI
:show-inheritance:
:members: __init__, curve_data, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state
:members: __init__, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state
:member-order: bysource

ManualROI
Expand All @@ -126,22 +126,22 @@ ScatterROI

.. autoclass:: mesmerize.viewer.modules.roi_manager_modules.roi_types.ScatterROI
:show-inheritance:
:members: __init__, curve_data, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data
:members: __init__, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data
:member-order: bysource

VolCNMF
-------

.. autoclass:: mesmerize.viewer.modules.roi_manager_modules.roi_types.VolCNMF
:show-inheritance:
:members: __init__, curve_data, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data, check_visible, zlevel, set_zlevel, zcenter
:members: __init__, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data, check_visible, set_zlevel
:member-order: bysource

CNMFROI
-------

.. autoclass:: mesmerize.viewer.modules.roi_manager_modules.roi_types.CNMFROI
:show-inheritance:
:members: __init__, curve_data, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data
:members: __init__, get_roi_graphics_object, set_roi_graphics_object, reset_color, set_original_color, get_color, set_color, set_text, set_tag, get_tag, get_all_tags, add_to_viewer, remove_from_viewer, to_state, from_state, set_curve_data
:member-order: bysource

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _module_StimulusMapping:
.. _API_StimulusMapping:

Stimulus Mapping
****************
Expand Down
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'sphinxcontrib.images',
]
napoleon_use_param = True
set_type_checking_flag = True
Expand Down
4 changes: 2 additions & 2 deletions docs/source/developer_guide/plots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ The easiest way to create a plot module is by subclassing the :ref:`BasePlotWidg
General Design
==============

This shows how you can design a plot using the :ref:`SpaceMapPlot <API_SpaceMapPlot>` as a simple example. It will generally consist of a class for the main plot area, plot control, and the plot window which contains the controls and plot area.
This shows how you can design a plot using the :ref:`SpaceMapPlot <API_SpaceMap>` as a simple example. It will generally consist of a class for the main plot area, plot control, and the plot window which contains the controls and plot area.

Plot Area
=========

A class which holds the actual plot, could be a matplotlib widget or pyqtgraph plot widget for example. In the :ref:`SpaceMapPlot <API_SpaceMapPlot>` this is simply a subclass of the pyqtgraph matplotlib widget with a few more attributes and a helper method. The `error_label` attribute is simply a QLabel used for displaying a plot error summary and is handled by the `exceptions_label` decorator from :ref:`qdialogs <common-qdialogs>`.
A class which holds the actual plot, could be a matplotlib widget or pyqtgraph plot widget for example. In the :ref:`SpaceMapPlot <API_SpaceMap>` this is simply a subclass of the pyqtgraph matplotlib widget with a few more attributes and a helper method. The `error_label` attribute is simply a QLabel used for displaying a plot error summary and is handled by the `exceptions_label` decorator from :ref:`qdialogs <common-qdialogs>`.

Plot Controls
=============
Expand Down
5 changes: 0 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ Welcome to Mesmerize's documentation!
.. |gitter_badge| image:: https://badges.gitter.im/mesmerize_discussion/community.svg
:target: https://gitter.im/mesmerize_discussion/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge

Docs for older versions
-----------------------
`v0.1 <v0.1/index.html>`_

.. toctree::
:maxdepth: 1
Expand All @@ -39,7 +35,6 @@ Docs for older versions
:caption: Viewer

./user_guides/viewer/overview
./user_guides/convert_meta_data
./user_guides/viewer/add_to_project

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guides/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ROIs
- Yes, just add it to your :ref:`Project Configuration <project-configuration>`

#. Can some samples in my project have ROIs that originate from CNMF(E) and others that are manually drawn?
- Yes, but be aware that you must separate the CNMF(E) and manual data in downstream analysis if you use flowchart nodes that only work with CNMF(E) data, such as :ref:`NormRaw <node_NormRawMinMax>` and :ref:`DetrendDFoF <node_DetrendDFoF>.`
- Yes, but be aware that you may need to separate the CNMF(E) and manual data in downstream analysis if using flowchart nodes that work with data from specific sources.

CNMFE
=====
Expand Down
14 changes: 3 additions & 11 deletions docs/source/user_guides/flowchart/nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ Plot

:class:`Source <mesmerize.pyqtgraphCore.flowchart.library.Display.Plot>`

For information on the plot widget see :ref:`<plot_SimplePlot>`
For information on the plot widget see :ref:`Simple Plot <plot_SimplePlot>`

A simple plot.

Expand Down Expand Up @@ -398,15 +398,6 @@ ScatterPlot

For information on the plot widget see :ref:`Scatter Plot <plot_ScatterPlot>`

.. _node_TimeSeries:

TimeSeries
^^^^^^^^^^

Plot the means along with confidence intervals or standard eviation of numerical arrays representing time series data.

For more information see :ref:`plot_TimeSeries`


--------------------

Expand Down Expand Up @@ -1084,7 +1075,8 @@ KMeans
:class:`Source <mesmerize.pyqtgraphCore.flowchart.library.Clustering.KMeans>`

Basically `sklearn.cluster.KMeans <https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html>`_.



----------------------


Expand Down
6 changes: 3 additions & 3 deletions docs/source/user_guides/flowchart/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Flowchart is based on the `pyqtgraph flowchart widgets <http://www.pyqtgraph

**Flowchart Window**

.. thumbnail:: ./flowchart_overview.png
.. image:: ./flowchart_overview.png

**Add node**: Right click -> Add node -> Choose from selection

Expand Down Expand Up @@ -41,7 +41,7 @@ Almost every node uses a Transmission object for input and output. A Transmissio

**Transmission DataFrame**

The Transmission DataFrame is created from your :ref:`ProjectDataFrame` (or sub-DataFrame) by the :ref:`node_Load_Proj_DF` node. This initial DataFrame will contain the same columns as your Project DataFrame, and a new column named **_RAW_CURVE**. Each element (row) in the **_RAW_CURVE** column is a 1-D numerical array representing a single raw curve extracted from an ROI.
The Transmission DataFrame is created from your :ref:`Project DataFrame <ProjectBrowser>` (or sub-DataFrame) by the :ref:`Load_Proj_DF node <nodeLoadProjDF>`. This initial DataFrame will contain the same columns as your Project DataFrame, and a new column named **_RAW_CURVE**. Each element (row) in the **_RAW_CURVE** column is a 1-D numerical array representing a single raw curve extracted from an ROI.

A new column named **_BLOCK_** is also added which contains the `UUID <https://en.wikipedia.org/wiki/Universally_unique_identifier>`_ for logging the analysis history of this newly created block of DataFrame rows, known as a *data block*. This allows you to merge Transmissions (see :ref:`Merge node <node_Merge>`) and maintain their independent analysis logs prior to the merge.

Expand Down Expand Up @@ -75,7 +75,7 @@ Call ``get_nodes()`` to view a dict of all nodes in the flowchart. You can acces

**Example, directly accessing DataFrame elements through the flowchart console**

.. thumbnail:: ./flowchart_console.png
.. image:: ./flowchart_console.png


.. _TransmissionFiles:
Expand Down
24 changes: 7 additions & 17 deletions docs/source/user_guides/general/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Welcome Window is the first window that you are presented with when you laun

.. seealso:: :ref:`User guide on creating new projects <CreateNewProject>` and :ref:`Consoles <ConsoleOverview>`

.. thumbnail:: ./welcome_window.png
.. image:: ./welcome_window.png

.. _ProjectStructure:

Expand All @@ -35,15 +35,15 @@ Dir Purpose
============= ===================================================================================
dataframes Contains an file storing the project dataframe, root.dfr, and backups.

A new backup is created every time a :ref:`Sample <ProjectSample>` is added to the project.
A new backup is created every time a a new *Sample* is :ref:`added to the project <add-to-project>`.

Restore a backup by renaming it to "root.dfr".

images Contains the image sequences and work environment data for all samples in the project

curves Contains the curves for every sample in the project

batches Used for storing batches used by the :ref:`Batch Manager <BatchManager>` if you wish.
batches Used for storing batches used by the :ref:`Batch Manager <module_BatchManager>` if you wish.

flowcharts Used for storing *.fc* flowchart files that save the layout of nodes in a flowchart.

Expand All @@ -54,14 +54,6 @@ plots Used for storing *.ptrn* interactive plot files.

.. warning:: Do not manually modify the data under the **images** or **curves** directories

.. _ProjectSample:

Project Sample
==============





.. _ConsoleOverview:

Expand Down Expand Up @@ -129,19 +121,17 @@ This window is accessible through the :ref:`Welcome Window <WelcomeWindow>` menu

.. image:: ./system_config_window.png

**Maximum number of threads to use:** The maximum number of threads that Mesmerize is allowed to use, this includes proccesses started by the :ref:`Batch Manager <BatchManager>`, various analysis proccesses in the flowchart, and the viewer as well.
**Maximum number of threads to use:** The maximum number of threads that Mesmerize is allowed to use, this includes proccesses started by the :ref:`Batch Manager <module_BatchManager>`, various analysis proccesses in the flowchart, and the viewer as well.

**Python call:** Many parts of Mesmerize, such as the :ref:`Batch Manager <BatchManager>` use external processes to run a python script. This setting sets which python call should be used. The default setting of "python3" should work for both :ref:`snap <snap_install>` and :ref:`pip <pip_install>` installations unless you have written a custom expansion that uses python2.
**Python call:** Many parts of Mesmerize, such as the :ref:`Batch Manager <module_BatchManager>` use external processes to run a python script. This setting sets which python call should be used. ``python3`` should work for Linux & Mac OSX. We've found that this needs to be set to ``python`` to work within Anaconda environments on Windows.

**Use CUDA:** Use CUDA accerlation if you have a GPU with CUDA cores. Only works with the :ref:`pip installation <pip_install>`, and you must have pycuda and scikit-cuda (as well as the `nvidia CUDA toolkit <https://developer.nvidia.com/cuda-toolkit>`_) installed. In Mesmerize CUDA is currently used only by :ref:`Caiman Motion Correction <module_caiman_motion_correction>`. We plan to expand CUDA support to computationally intensive tasks that are performed by flowchart nodes.
**Use CUDA:** Use CUDA accerlation if you have a GPU with CUDA cores. You must have pycuda and scikit-cuda (as well as the `nvidia CUDA toolkit <https://developer.nvidia.com/cuda-toolkit>`_) installed. CUDA accerlation isn't used much currently.

**Work dir:** Many parts of Mesmerize use a working directory for temporary files. If you have a fast filesystem you can use that for this purpose.

**Pre-run commands (large text entry):** Mesmerize runs some computationally intensive tasks in subprocesses. These commands are run prior to the python script that performs the task.

- If you are using Mesmerize in a virtual environment (such as a :ref:`pip installed <pip_install>` Mesmerize) you will need activate the environment so you must include the line ``source /path_to_venv/bin/activate`` to the pre-run commands

- Simiarly if you are using Mesmerize in an Anaconda environment you will need include commands to activate the environment.
- If you are using Mesmerize in a virtual environment or conda environment you will need activate the environment so you must include the line ``source /path_to_venv/bin/activate`` or ``conda activate <env_name>`` to the pre-run commands.

- If you are using an Intel CPU you should get optimal performance by installing `Math Kernel Library (MKL) <https://software.intel.com/en-us/get-started-with-mkl-for-linux>`_ and including ``export MKL_NUM_THREADS=1`` to the pre-run commands.

Expand Down

0 comments on commit 2827cba

Please sign in to comment.