aind-behavior-video-transformation 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. aind_behavior_video_transformation-0.0.2/.flake8 +6 -0
  2. aind_behavior_video_transformation-0.0.2/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  3. aind_behavior_video_transformation-0.0.2/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  4. aind_behavior_video_transformation-0.0.2/.github/ISSUE_TEMPLATE/user-story.md +27 -0
  5. aind_behavior_video_transformation-0.0.2/.github/workflows/tag_and_publish.yml +132 -0
  6. aind_behavior_video_transformation-0.0.2/.github/workflows/test_and_lint.yml +30 -0
  7. aind_behavior_video_transformation-0.0.2/.gitignore +148 -0
  8. aind_behavior_video_transformation-0.0.2/LICENSE +21 -0
  9. aind_behavior_video_transformation-0.0.2/PKG-INFO +113 -0
  10. aind_behavior_video_transformation-0.0.2/README.md +93 -0
  11. aind_behavior_video_transformation-0.0.2/doc_template/Makefile +20 -0
  12. aind_behavior_video_transformation-0.0.2/doc_template/make.bat +35 -0
  13. aind_behavior_video_transformation-0.0.2/doc_template/source/_static/dark-logo.svg +129 -0
  14. aind_behavior_video_transformation-0.0.2/doc_template/source/_static/favicon.ico +0 -0
  15. aind_behavior_video_transformation-0.0.2/doc_template/source/_static/light-logo.svg +128 -0
  16. aind_behavior_video_transformation-0.0.2/doc_template/source/conf.py +54 -0
  17. aind_behavior_video_transformation-0.0.2/doc_template/source/index.rst +22 -0
  18. aind_behavior_video_transformation-0.0.2/pyproject.toml +70 -0
  19. aind_behavior_video_transformation-0.0.2/scripts/singularity_build.def +12 -0
  20. aind_behavior_video_transformation-0.0.2/setup.cfg +4 -0
  21. aind_behavior_video_transformation-0.0.2/setup.py +4 -0
  22. aind_behavior_video_transformation-0.0.2/src/aind_behavior_video_transformation/__init__.py +3 -0
  23. aind_behavior_video_transformation-0.0.2/src/aind_behavior_video_transformation/transform_videos.py +433 -0
  24. aind_behavior_video_transformation-0.0.2/src/aind_behavior_video_transformation.egg-info/PKG-INFO +113 -0
  25. aind_behavior_video_transformation-0.0.2/src/aind_behavior_video_transformation.egg-info/SOURCES.txt +29 -0
  26. aind_behavior_video_transformation-0.0.2/src/aind_behavior_video_transformation.egg-info/dependency_links.txt +1 -0
  27. aind_behavior_video_transformation-0.0.2/src/aind_behavior_video_transformation.egg-info/requires.txt +10 -0
  28. aind_behavior_video_transformation-0.0.2/src/aind_behavior_video_transformation.egg-info/top_level.txt +1 -0
  29. aind_behavior_video_transformation-0.0.2/tests/__init__.py +1 -0
  30. aind_behavior_video_transformation-0.0.2/tests/test_transform_videos.py +220 -0
  31. aind_behavior_video_transformation-0.0.2/tests/test_video_in_dir/clip.mp4 +0 -0
@@ -0,0 +1,6 @@
1
+ [flake8]
2
+ exclude =
3
+ .git,
4
+ __pycache__,
5
+ build
6
+ max-complexity = 10
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: User story
3
+ about: This template provides a basic structure for user story issues.
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ # User story
11
+ As a ..., I want to ..., so I can ...
12
+
13
+ *Ideally, this is in the issue title, but if not, you can put it here. If so, delete this section.*
14
+
15
+ # Acceptance criteria
16
+ - [ ] This is something that can be verified to show that this user story is satisfied.
17
+
18
+ # Sprint Ready Checklist
19
+ - [ ] 1. Acceptance criteria defined
20
+ - [ ] 2. Team understands acceptance criteria
21
+ - [ ] 3. Team has defined solution / steps to satisfy acceptance criteria
22
+ - [ ] 4. Acceptance criteria is verifiable / testable
23
+ - [ ] 5. External / 3rd Party dependencies identified
24
+ - [ ] 6. Ticket is prioritized and sized
25
+
26
+ # Notes
27
+ *Add any helpful notes here.*
@@ -0,0 +1,132 @@
1
+ name: Tag and publish
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ jobs:
7
+ update_badges:
8
+ runs-on: ubuntu-latest
9
+ continue-on-error: true
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ with:
13
+ ref: ${{ env.DEFAULT_BRANCH }}
14
+ fetch-depth: 0
15
+ token: ${{ secrets.SERVICE_TOKEN }}
16
+ - uses: FedericoCarboni/setup-ffmpeg@v3
17
+ id: setup-ffmpeg
18
+ with:
19
+ ffmpeg-version: release
20
+ - name: Set up Python 3.10
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: '3.10'
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install -e .[dev] --no-cache-dir
27
+ - name: Get Python version and Update README.md
28
+ run: |
29
+ python_version=$(grep "requires-python" pyproject.toml | grep -o ">=[^\"]*")
30
+ python_badge=$(grep -o 'python-[^)]*' README.md)
31
+ new_python_badge="python-$python_version-blue?logo=python"
32
+ sed -i "s/$python_badge/$new_python_badge/g" README.md
33
+ - name: Get interrogate values and Update README.md
34
+ run: |
35
+ interrogate_val=$(interrogate . | grep -o 'actual: [0-9]*\.[0-9]*' | awk '{print $2}')
36
+ interrogate_badge=$(grep -o 'interrogate-[^)]*' README.md)
37
+ if (( $(echo "$interrogate_val >= 90.00" | bc -l) )); then
38
+ new_interrogate_badge="interrogate-$interrogate_val%25-brightgreen"
39
+ elif (( $(echo "$interrogate_val < 80.00" | bc -l) )); then
40
+ new_interrogate_badge="interrogate-$interrogate_val%25-red"
41
+ else
42
+ new_interrogate_badge="interrogate-$interrogate_val%25-yellow"
43
+ fi
44
+ sed -i "s/$interrogate_badge/$new_interrogate_badge/g" README.md
45
+ - name: Get Coverage values and Update README.md
46
+ run: |
47
+ coverage run -m unittest discover
48
+ coverage_val=$(coverage report | grep "^TOTAL" | grep -o '[0-9]\+%' | grep -o '[0-9]\+')
49
+ coverage_badge=$(grep -o "coverage-[^?]*" README.md)
50
+ if (( $(echo "$coverage_val >= 90.00" | bc -l) )); then
51
+ new_coverage_badge="coverage-$coverage_val%25-brightgreen"
52
+ elif (( $(echo "$coverage_val < 80.00" | bc -l) )); then
53
+ new_coverage_badge="coverage-$coverage_val%25-red"
54
+ else
55
+ new_coverage_badge="coverage-$coverage_val%25-yellow"
56
+ fi
57
+ sed -i "s/$coverage_badge/$new_coverage_badge/g" README.md
58
+ - name: Commit changes
59
+ uses: EndBug/add-and-commit@v9
60
+ with:
61
+ default_author: github_actions
62
+ message: "ci: update badges [skip actions]"
63
+ add: '["README.md"]'
64
+ tag:
65
+ needs: update_badges
66
+ uses: AllenNeuralDynamics/aind-github-actions/.github/workflows/tag.yml@main
67
+ secrets:
68
+ SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }}
69
+ publish:
70
+ runs-on: ubuntu-latest
71
+ env:
72
+ GO_VERSION: '1.14.12'
73
+ GO_OS: 'linux'
74
+ GO_ARCH: 'amd64'
75
+ SINGULARITY_VERSION: '3.7.0'
76
+ needs: tag
77
+ steps:
78
+ - uses: actions/checkout@v3
79
+ - name: Pull latest changes
80
+ run: git pull --ff-only origin main
81
+ - name: Install dependencies
82
+ run: |
83
+ sudo apt-get update && sudo apt-get install -y \
84
+ build-essential \
85
+ libssl-dev \
86
+ uuid-dev \
87
+ libgpgme11-dev \
88
+ squashfs-tools \
89
+ libseccomp-dev \
90
+ wget \
91
+ pkg-config \
92
+ procps
93
+ - name: Install GO
94
+ run: |
95
+ wget https://dl.google.com/go/go$GO_VERSION.$GO_OS-$GO_ARCH.tar.gz
96
+ sudo tar -C /usr/local -xzvf go$GO_VERSION.$GO_OS-$GO_ARCH.tar.gz
97
+ sudo rm go$GO_VERSION.$GO_OS-$GO_ARCH.tar.gz
98
+ echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/profile
99
+ - name: Install Singularity
100
+ run: |
101
+ cd ..
102
+ wget https://github.com/hpcng/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-${SINGULARITY_VERSION}.tar.gz
103
+ sudo tar -xzf singularity-${SINGULARITY_VERSION}.tar.gz
104
+ sudo rm singularity-${SINGULARITY_VERSION}.tar.gz
105
+ echo "Finished installing binaries"
106
+ export PATH=$PATH:/usr/local/go/bin
107
+ cd singularity
108
+ sudo ./mconfig --without-suid
109
+ sudo make -C ./builddir
110
+ sudo make -C ./builddir install
111
+ - name: Build sif container
112
+ run: |
113
+ mkdir build
114
+ sudo singularity build build/container.sif scripts/singularity_build.def
115
+ - name: Login and Deploy Container
116
+ run: |
117
+ echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
118
+ singularity push build/container.sif oras://ghcr.io/${GITHUB_REPOSITORY}:${{ needs.tag.outputs.new_version }}
119
+ singularity push build/container.sif oras://ghcr.io/${GITHUB_REPOSITORY}:latest
120
+ - name: Set up Python 3.10
121
+ uses: actions/setup-python@v5
122
+ with:
123
+ python-version: '3.10'
124
+ - name: Install dependencies
125
+ run: |
126
+ pip install --upgrade setuptools wheel twine build
127
+ python -m build
128
+ twine check dist/*
129
+ - name: Publish on PyPI
130
+ uses: pypa/gh-action-pypi-publish@release/v1
131
+ with:
132
+ password: ${{ secrets.AIND_PYPI_TOKEN }}
@@ -0,0 +1,30 @@
1
+ name: Lint and run tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ ci:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ python-version: [ '3.10', '3.11', '3.12', '3.13' ]
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: FedericoCarboni/setup-ffmpeg@v3
17
+ id: setup-ffmpeg
18
+ with:
19
+ ffmpeg-version: release
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install -e .[dev]
27
+ - name: Run linter checks
28
+ run: flake8 . && interrogate --verbose .
29
+ - name: Run tests and coverage
30
+ run: coverage run -m unittest discover && coverage report
@@ -0,0 +1,148 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ # PyCharm
132
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
133
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
134
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
135
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
136
+ .idea/
137
+
138
+ # MacOs
139
+ **/.DS_Store
140
+
141
+ # Videos
142
+ *.mp4
143
+ *.mov
144
+ *.avi
145
+ *.wmv
146
+ *.flv
147
+ *.mkv
148
+ *.webm
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Allen Institute for Neural Dynamics
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.1
2
+ Name: aind-behavior-video-transformation
3
+ Version: 0.0.2
4
+ Summary: Handles behavior modality folder
5
+ Author: Allen Institute for Neural Dynamics
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: aind-data-transformation>=0.1.0
12
+ Provides-Extra: dev
13
+ Requires-Dist: black; extra == "dev"
14
+ Requires-Dist: coverage; extra == "dev"
15
+ Requires-Dist: flake8; extra == "dev"
16
+ Requires-Dist: interrogate; extra == "dev"
17
+ Requires-Dist: isort; extra == "dev"
18
+ Requires-Dist: Sphinx; extra == "dev"
19
+ Requires-Dist: furo; extra == "dev"
20
+
21
+ # aind-behavior-video-transformation
22
+
23
+ [![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
24
+ ![Code Style](https://img.shields.io/badge/code%20style-black-black)
25
+ [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
26
+ ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
27
+ ![Coverage](https://img.shields.io/badge/coverage-97%25-brightgreen?logo=codecov)
28
+ ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
29
+
30
+
31
+
32
+ ## Usage
33
+ - The BehaviorVideoJob.run_job method in the transform_videos should be the primary method to call for processing video files.
34
+ - On a merge to main, this package will be published as a singularity container, which can easily be run on a SLURM cluster.
35
+
36
+ ## Development
37
+
38
+ To develop the code, run
39
+ ```bash
40
+ pip install -e .[dev]
41
+ ```
42
+
43
+ ## Contributing
44
+
45
+ ### Linters and testing
46
+
47
+ There are several libraries used to run linters, check documentation, and run tests.
48
+
49
+ - Please test your changes using the **coverage** library, which will run the tests and log a coverage report:
50
+
51
+ ```bash
52
+ coverage run -m unittest discover && coverage report
53
+ ```
54
+
55
+ - Use **interrogate** to check that modules, methods, etc. have been documented thoroughly:
56
+
57
+ ```bash
58
+ interrogate .
59
+ ```
60
+
61
+ - Use **flake8** to check that code is up to standards (no unused imports, etc.):
62
+ ```bash
63
+ flake8 .
64
+ ```
65
+
66
+ - Use **black** to automatically format the code into PEP standards:
67
+ ```bash
68
+ black .
69
+ ```
70
+
71
+ - Use **isort** to automatically sort import statements:
72
+ ```bash
73
+ isort .
74
+ ```
75
+
76
+ ### Pull requests
77
+
78
+ For internal members, please create a branch. For external members, please fork the repository and open a pull request from the fork. We'll primarily use [Angular](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit) style for commit messages. Roughly, they should follow the pattern:
79
+ ```text
80
+ <type>(<scope>): <short summary>
81
+ ```
82
+
83
+ where scope (optional) describes the packages affected by the code changes and type (mandatory) is one of:
84
+
85
+ - **build**: Changes that affect build tools or external dependencies (example scopes: pyproject.toml, setup.py)
86
+ - **ci**: Changes to our CI configuration files and scripts (examples: .github/workflows/ci.yml)
87
+ - **docs**: Documentation only changes
88
+ - **feat**: A new feature
89
+ - **fix**: A bugfix
90
+ - **perf**: A code change that improves performance
91
+ - **refactor**: A code change that neither fixes a bug nor adds a feature
92
+ - **test**: Adding missing tests or correcting existing tests
93
+
94
+ ### Semantic Release
95
+
96
+ The table below, from [semantic release](https://github.com/semantic-release/semantic-release), shows which commit message gets you which release type when `semantic-release` runs (using the default configuration):
97
+
98
+ | Commit message | Release type |
99
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
100
+ | `fix(pencil): stop graphite breaking when too much pressure applied` | ~~Patch~~ Fix Release, Default release |
101
+ | `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
102
+ | `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release <br /> (Note that the `BREAKING CHANGE: ` token must be in the footer of the commit) |
103
+
104
+ ### Documentation
105
+ To generate the rst files source files for documentation, run
106
+ ```bash
107
+ sphinx-apidoc -o doc_template/source/ src
108
+ ```
109
+ Then to create the documentation HTML files, run
110
+ ```bash
111
+ sphinx-build -b html doc_template/source/ doc_template/build/html
112
+ ```
113
+ More info on sphinx installation can be found [here](https://www.sphinx-doc.org/en/master/usage/installation.html).
@@ -0,0 +1,93 @@
1
+ # aind-behavior-video-transformation
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE)
4
+ ![Code Style](https://img.shields.io/badge/code%20style-black-black)
5
+ [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
6
+ ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
7
+ ![Coverage](https://img.shields.io/badge/coverage-97%25-brightgreen?logo=codecov)
8
+ ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
9
+
10
+
11
+
12
+ ## Usage
13
+ - The BehaviorVideoJob.run_job method in the transform_videos should be the primary method to call for processing video files.
14
+ - On a merge to main, this package will be published as a singularity container, which can easily be run on a SLURM cluster.
15
+
16
+ ## Development
17
+
18
+ To develop the code, run
19
+ ```bash
20
+ pip install -e .[dev]
21
+ ```
22
+
23
+ ## Contributing
24
+
25
+ ### Linters and testing
26
+
27
+ There are several libraries used to run linters, check documentation, and run tests.
28
+
29
+ - Please test your changes using the **coverage** library, which will run the tests and log a coverage report:
30
+
31
+ ```bash
32
+ coverage run -m unittest discover && coverage report
33
+ ```
34
+
35
+ - Use **interrogate** to check that modules, methods, etc. have been documented thoroughly:
36
+
37
+ ```bash
38
+ interrogate .
39
+ ```
40
+
41
+ - Use **flake8** to check that code is up to standards (no unused imports, etc.):
42
+ ```bash
43
+ flake8 .
44
+ ```
45
+
46
+ - Use **black** to automatically format the code into PEP standards:
47
+ ```bash
48
+ black .
49
+ ```
50
+
51
+ - Use **isort** to automatically sort import statements:
52
+ ```bash
53
+ isort .
54
+ ```
55
+
56
+ ### Pull requests
57
+
58
+ For internal members, please create a branch. For external members, please fork the repository and open a pull request from the fork. We'll primarily use [Angular](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit) style for commit messages. Roughly, they should follow the pattern:
59
+ ```text
60
+ <type>(<scope>): <short summary>
61
+ ```
62
+
63
+ where scope (optional) describes the packages affected by the code changes and type (mandatory) is one of:
64
+
65
+ - **build**: Changes that affect build tools or external dependencies (example scopes: pyproject.toml, setup.py)
66
+ - **ci**: Changes to our CI configuration files and scripts (examples: .github/workflows/ci.yml)
67
+ - **docs**: Documentation only changes
68
+ - **feat**: A new feature
69
+ - **fix**: A bugfix
70
+ - **perf**: A code change that improves performance
71
+ - **refactor**: A code change that neither fixes a bug nor adds a feature
72
+ - **test**: Adding missing tests or correcting existing tests
73
+
74
+ ### Semantic Release
75
+
76
+ The table below, from [semantic release](https://github.com/semantic-release/semantic-release), shows which commit message gets you which release type when `semantic-release` runs (using the default configuration):
77
+
78
+ | Commit message | Release type |
79
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
80
+ | `fix(pencil): stop graphite breaking when too much pressure applied` | ~~Patch~~ Fix Release, Default release |
81
+ | `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
82
+ | `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release <br /> (Note that the `BREAKING CHANGE: ` token must be in the footer of the commit) |
83
+
84
+ ### Documentation
85
+ To generate the rst files source files for documentation, run
86
+ ```bash
87
+ sphinx-apidoc -o doc_template/source/ src
88
+ ```
89
+ Then to create the documentation HTML files, run
90
+ ```bash
91
+ sphinx-build -b html doc_template/source/ doc_template/build/html
92
+ ```
93
+ More info on sphinx installation can be found [here](https://www.sphinx-doc.org/en/master/usage/installation.html).
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)