From e92fa62166ebe07cbab790c9185a65ac7d144d80 Mon Sep 17 00:00:00 2001 From: themattinthehatt Date: Sun, 3 Dec 2023 12:34:40 -0500 Subject: [PATCH] [docs] installation --- README.md | 37 ++---------------- docs/README.md | 1 + docs/conf.py | 4 ++ docs/index.rst | 13 +++++++ docs/source/installation.rst | 75 +++++++++++++++++++++++++++++++++++- setup.py | 26 ++++++++++++- 6 files changed, 119 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index c72e94d..7995e1e 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,13 @@ [![Documentation Status](https://readthedocs.org/projects/daart/badge/?version=latest)](https://daart.readthedocs.io/en/latest/?badge=latest) [![DOI](https://zenodo.org/badge/334987729.svg)](https://zenodo.org/badge/latestdoi/334987729) -A collection of tools for the discrete classification of animal behaviors using low-dimensional representations of videos (such as skeletons provided by tracking algorithms). Our approach combines strong supervision, weak supervision, and self-supervision to improve model performance. See the preprint [here](https://www.biorxiv.org/content/10.1101/2021.06.16.448685v1) for more details. This repo currently supports fitting the -following types of base models on behavioral time series data: +A collection of tools for the discrete classification of animal behaviors using low-dimensional representations of videos (such as skeletons provided by tracking algorithms). Our approach combines strong supervision, weak supervision, and self-supervision to improve model performance. See the preprint [here](https://www.biorxiv.org/content/10.1101/2021.06.16.448685v1) for more details. This repo currently supports fitting the following types of base models on behavioral time series data: * Dense MLP network with initial 1D convolutional layer * RNNs - both LSTMs and GRUs * Temporal Convolutional Networks (TCNs) +See the [documentation](https://daart.readthedocs.io/) to get started! + If you use daart in your analysis of behavioral data, please cite our preprint! @inproceedings{whiteway2021semi, @@ -21,39 +22,7 @@ If you use daart in your analysis of behavioral data, please cite our preprint! ## Installation -First you'll have to install the `git` package in order to access the code on github. Follow the -directions [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) -for your specific OS. -Then, in the command line, navigate to where you'd like to install the `daart` package and move -into that directory: -``` -$: git clone https://github.com/themattinthehatt/daart -$: cd daart -``` - -Next, follow the directions -[here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/) -to install the `conda` package for managing development environments. -Then, create a conda environment: - -``` -$: conda create --name=daart python=3.6 -$: conda activate daart -(daart) $: pip install -r requirements.txt -``` - -To make the package modules visible to the python interpreter, locally run pip -install from inside the main `daart` directory: - -``` -(daart) $: pip install -e . -``` -To be able to use this environment for jupyter notebooks: - -``` -(daart) $: python -m ipykernel install --user --name daart -``` ## Getting started diff --git a/docs/README.md b/docs/README.md index 07c96ba..1d3e3c4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -72,6 +72,7 @@ extensions = [ 'sphinx.ext.napoleon', # parsing of different docstring styles 'sphinx_automodapi.automodapi', 'sphinx_copybutton', # add copy button to code blocks + 'sphinx_rtd_dark_mode', ] ``` diff --git a/docs/conf.py b/docs/conf.py index 40287bc..6aadf21 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,6 +28,7 @@ 'sphinx.ext.napoleon', # parsing of different docstring styles 'sphinx_automodapi.automodapi', 'sphinx_copybutton', # add copy button to code blocks + 'sphinx_rtd_dark_mode', ] templates_path = ['_templates'] @@ -40,6 +41,9 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_static_path = ['_static'] +# user starts in dark mode +default_dark_mode = True + # document constructors def skip(app, what, name, obj, skip, options): diff --git a/docs/index.rst b/docs/index.rst index 6644357..a8a42a1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,6 +6,19 @@ Welcome to daart's documentation! ================================= +The ``daart`` package is a collection of tools for the discrete classification of animal behaviors +using low-dimensional representations of videos (such as skeletons provided by tracking algorithms). +``daart`` combines strong supervision, weak supervision, and self-supervision to improve model +performance. +See the `preprint `_ for more details. + +This repo currently supports fitting the following types of base models on behavioral time series +data: + +* dense MLP network with initial 1D convolutional layer +* RNNs - both LSTMs and GRUs +* temporal convolutional networks (TCNs) + .. toctree:: :maxdepth: 2 :caption: Contents: diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 59a38de..b3bd81c 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -1,4 +1,77 @@ Installation ============ -TODO +First you'll have to install the ``git`` package in order to access the code on github. +Follow the +`git installion instructions `_ +for your specific OS. + +**Install ffmpeg** + +First, check to see you have ``ffmpeg`` installed by typing the following into the terminal: + +.. code-block:: console + + ffmpeg -version + +If not, install: + +.. code-block:: console + + sudo apt install ffmpeg + +**Set up a conda environment** + +Next, follow the +`conda installation instructions `_ +to install the ``conda`` package for managing development environments. +Then, create a conda environment: + +.. code-block:: console + + conda create --name daart python=3.6 + +Active the new environment: + +.. code-block:: console + + conda activate daart + +**Install daart** + +.. note:: + + Make sure your conda environment is activated during the following steps. + +1. Move into the directory where you want to place the repository folder, and download it from + github. + + .. code-block:: console + + git clone https://github.com/themattinthehatt/daart + +2. Move into the newly created folder: + + .. code-block:: console + + cd daart + + and install the package and all dependencies: + + .. code-block:: + + pip install -e . + +3. Verify that all the unit tests are passing on your machine by running + + .. code-block:: console + + pytest + + The tests will take a minute or two to run. + +4. To be able to use this environment for jupyter notebooks: + + .. code-block:: console + + python -m ipykernel install --user --name daart diff --git a/setup.py b/setup.py index d78905a..9d60203 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,32 @@ from distutils.core import setup -VERSION = '1.0.1' +VERSION = '1.0.2' # add the README.md file to the long_description with open('README.md', 'r') as fh: long_description = fh.read() +install_requires = [ + 'h5py', + 'ipykernel', + 'jupyter', + 'matplotlib', + 'numpy', + 'opencv-python', + 'pandas', + 'pytest', + 'pyyaml', + 'scikit-learn', + 'scipy>=1.2.0', + 'seaborn', + 'tables', + 'test-tube', + 'torch==1.8.0', + 'tqdm', + 'typeguard', +] + extras_require = { 'dev': { 'sphinx', @@ -16,6 +36,7 @@ 'sphinx-copybutton', } } + setup( name='daart', packages=['daart'], @@ -26,6 +47,7 @@ author='matt whiteway', author_email='', url='http://www.github.com/themattinthehatt/daart', + install_requires=install_requires, extras_require=extras_require, - keywords=['machine learning', 'action segmentation', 'computer_vision'], + keywords=['machine learning', 'action segmentation', 'computer vision'], )