You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflow will upload a Python Package to PyPI when a release is created
2
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+
# This workflow uses actions that are not certified by GitHub.
5
+
# They are provided by a third-party and are governed by
6
+
# separate terms of service, privacy policy, and support
7
+
# documentation.
8
+
9
+
name: Upload Python Package
10
+
11
+
on:
12
+
release:
13
+
types: [published]
14
+
15
+
permissions:
16
+
contents: read
17
+
18
+
jobs:
19
+
release-build:
20
+
runs-on: ubuntu-latest
21
+
22
+
steps:
23
+
- uses: actions/checkout@v4
24
+
25
+
- uses: actions/setup-python@v5
26
+
with:
27
+
python-version: "3.12"
28
+
29
+
- name: Build release distributions
30
+
run: |
31
+
# NOTE: put your own distribution build steps here.
32
+
python -m pip install build
33
+
python -m build
34
+
35
+
- name: Upload distributions
36
+
uses: actions/upload-artifact@v4
37
+
with:
38
+
name: release-dists
39
+
path: dist/
40
+
41
+
pypi-publish:
42
+
runs-on: ubuntu-latest
43
+
needs:
44
+
- release-build
45
+
permissions:
46
+
# IMPORTANT: this permission is mandatory for trusted publishing
47
+
id-token: write
48
+
49
+
# Dedicated environments with protections for publishing are strongly recommended.
50
+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+
environment:
52
+
name: pypi
53
+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+
url: https://pypi.org/project/features-from-dlc/
55
+
#
56
+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+
# ALTERNATIVE: exactly, uncomment the following line instead:
To use the scripts and notebooks, you first need to install some things. If conda is already installed, ignore steps 1-2.
@@ -14,11 +19,6 @@ For more detailed instructions on how to install `conda`, see [this page](https:
14
19
15
20
1. Install [Miniforge](https://conda-forge.org/download/) (choose the latest version for your system) as user, add conda to PATH and make it the default interpreter.
16
21
1. Open a terminal (PowerShell in Windows) and run `conda init`. Restart the terminal.
17
-
1. Download the Source code zip (from Releases on the right), unzip and put it in a relevant location (eg. `~/programs` or whatever).
18
-
1. Browse to this location from the terminal :
19
-
```bash
20
-
cd /path/to/the/smart/location/features-from-dlc
21
-
```
22
22
1. Create a virtual environment named "ffd" :
23
23
```bash
24
24
conda create -n ffd python=3.12
@@ -29,11 +29,13 @@ For more detailed instructions on how to install `conda`, see [this page](https:
29
29
```
30
30
1. Install the package and its dependencies :
31
31
```bash
32
-
pip install .
32
+
pip install features-from-dlc
33
33
```
34
34
35
35
You should be ready to use the scripts and notebooks ! To update, download the new release and perform steps 6 and 7.
36
36
37
+
To use the scripts, see the [Usage](#usage) section.
38
+
37
39
To use the notebooks, two options :
38
40
- Use an IDE with Jupyter notebooks support such as [Visual Studio Code](https://code.visualstudio.com/download). Install the Python and Jupyter extensions (the squared pieces on the left panel). Open the notebook with vscode, on the top right you should be able to selecta kernel : choose "ffd".
39
41
- Use Jupyter directly in its web browser interface : from the terminal, activate the conda environment :`conda activate ffd`, then launch Jupyter :`jupyter lab /path/to/the/notebooks/notebook.ipynb`
@@ -43,7 +45,7 @@ To use the notebooks, two options :
43
45
### Introduction
44
46
This package is meant to be used to compute and display features from DeepLabCut (DLC) tracking files.
45
47
46
-
It will process a bunch of h5 or csv files created by DLC, computing so called "features" that are arbitrarily defined by the user and displaying them in nice graphs :time series with averages and errors, corresponding bar plots that quantifies a change during a specified epoch (typically, an optogenetic stimulation).
48
+
It will process a bunch of h5 or csv files created by DLC, computing so called "features" that are arbitrarily defined by the user and displaying them in nice graphs :time series with averages and errors, corresponding bar plots that quantifies a change during a specified epoch (typically, an optogenetic stimulation), response delays and response rate.
47
49
It is intended to be modular : the main module (`features_from_dlc.py`) merely loads DLC files, computes features, averages them per condition and plots them. So-called configuration files are plugged into it and specifies _how_ the features are computed from the bodyparts tracked in DLC.
48
50
Anyone can write its own configuration file to compute any required features (such as speed, body angle, jaw opening, you name it), as long as the original syntax is respected.
49
51
@@ -70,7 +72,7 @@ Note that after installation, the `features_from_dlc` package is installed insid
70
72
It's easier to use as conda is nicely integrated and it is made easy to switch between environments.
71
73
1. Install [vscode](https://code.visualstudio.com/download) (it does not require admin rights).
72
74
1. Install Python extension (squared pieces in the left panel).
73
-
1. Open the `scripts/ffd_quantify.py` script. In the bottom right corner, you should see a "conda" entry : click on it and selectthe ffd conda environment. To run the script, click on the Play item on the top right.
75
+
1. Open the `scripts/ffd_quantify.py` script. In the bottom right corner, you should see a "conda" entry : click on it and selectthe ffd conda environment. To run the script, click on the Play icon on the top right.
74
76
75
77
#### Requirements
76
78
You need to have tracked your video clips with DeepLabCut and saved the output files (either .h5 or .csv files). One file corresponds to one and only one trial, so you might need to split your original videos into several short clips around the stimulation onsets and offsets beforehand. This can be done with [`videocutter` program](https://github.com/TeamNCMC/videocutter). All files analyzed together must :
0 commit comments