Skip to content

Commit

Permalink
Merge pull request #24 from ynput/release/0.1.0
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
tweak-wtf authored Jul 19, 2024
2 parents c3839d4 + 5a41ed0 commit d99a333
Show file tree
Hide file tree
Showing 41 changed files with 1,954 additions and 568 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: documentation

on:
push:
branches: ["main"]
pull_request:
branches: ["main", "develop"]

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- uses: abatilo/actions-poetry@v2
- uses: conda-incubator/[email protected]
- name: Install dependencies
run: |
poetry install
- name: Install pandoc
shell: bash -el {0}
run: |
conda install pandoc
- name: Convert Readme to rst
shell: bash -el {0}
run: |
pandoc ./README.md -o ./docs/README.rst
- name: Sphinx build
run: |
poetry run sphinx-build ./docs ./docs/_build
- name: Deploy to GitHub Pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v4
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/
force_orphan: true
72 changes: 72 additions & 0 deletions .github/workflows/run_all_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: run all tests

on:
pull_request:
branches: ["main", "develop"]

jobs:
full_test_suite:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: restore poetry cache
uses: actions/cache@v4
id: restore-poetry
with:
path: .poetry
key: ${{ runner.os }}-poetry

- name: restore poetry lock file
uses: actions/cache@v4
id: restore-poetry-lockfile
with:
path: poetry.lock
key: ${{ runner.os }}-poetry-lockfile

- name: restore vendor cache
uses: actions/cache@v4
id: restore-vendor
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: install LabLib
run: |
.\start.ps1 install
- name: get dependencies
if: steps.restore-vendor.outputs.cache-hit != 'true'
run: |
.\start.ps1 get-dependencies
- name: run all tests
run: |
.\start.ps1 test
- name: save vendor dependencies cache
if: steps.restore-vendor.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
id: cache-vendor
with:
path: vendor
key: ${{ runner.os }}-vendor

- name: save poetry cache
if: steps.restore-poetry.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
id: cache-poetry
with:
path: .poetry
key: ${{ runner.os }}-poetry

- name: save poetry lock file
if: steps.restore-poetry-lockfile.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
id: cache-poetry-lockfile
with:
path: poetry.lock
key: ${{ runner.os }}-poetry
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ results/
.python-version

test_results/
docs/_build/
53 changes: 13 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# LabLib
![](https://img.shields.io/badge/os-windows-blue)
[![run all tests](https://github.com/ynput/LabLib/actions/workflows/run_all_tests.yml/badge.svg)](https://github.com/ynput/LabLib/actions/workflows/run_all_tests.yml)
[![documentation](https://github.com/ynput/LabLib/actions/workflows/documentation.yml/badge.svg)](https://github.com/ynput/LabLib/actions/workflows/documentation.yml)

Generate intermediate sequences for VFX processing using OIIO and FFMPEG!

Expand All @@ -10,9 +13,6 @@ This module aims to help by providing helper classes and functions to:
- Create correctly formed OIIO commandline strings automatically.
- Render out frames with Color and Repositioning baked in using oiiotool

**DISCLAIMER**
This is still a wip, and it's currently missing a lot of functionality.
Use at your own risk!

## Instructions
The core functionality relies on using **Processors** and **Operators** to compute the correct commandline parameters.
Expand All @@ -23,45 +23,18 @@ The core functionality relies on using **Processors** and **Operators** to compu

**Renderers** take care of returning the fully formed commanline command and executing it.

Please see the sample `tests/test_run.py` for an usage example.
## Installation
LabLib requires `python-3.9` and uses `poetry` for managing its dependencies.

---
It's encouraged to use the provided PowerShell script to install and download the binaries for [oiiotool](https://www.patreon.com/posts/openimageio-oiio-63609827), [ffmpeg](https://github.com/GyanD/codexffmpeg/releases/tag/7.0.1), the [OCIO Color Configs](https://github.com/colour-science/OpenColorIO-Configs/releases/tag/v1.2) and the font [Source Code Pro](https://fontsource.org/fonts/source-code-pro) which is used in tests.

## Testing
Please see `tests/test_run.py` globals for dependent binary locations.
- clone this repo
- `.\start.ps1 install`
- `.\start.ps1 get-dependencies`

- `poetry install`
- `poetry run pytest`
### Testing
You can run the full suite with `.\start.ps1 test` or to run custom `pytest` commands make sure to be in the cloned repository's directory and run `poetry run pytest [ARGS]`.


### Features (Planned and Done)

- [x] Repo Processor
- [x] Color Processor
- [x] Slate Processor
- [ ] Burnins Processor
- [ ] FFMPEG final compression to format
- [ ] Settings and presets from json
- [ ] Commandline parser
- [ ] QT gui (will probably never happen)

### Dev Features

- [x] Type Hints
- [ ] Docstrings
- [ ] Documentation
- [ ] Tests (probably will never happen)

---

### Required Dependencies
- Python >= 3.7 (but keep in mind that otio and ocio wheels need to be built for >= 3.11)
- [Download OIIO](https://www.patreon.com/posts/openimageio-oiio-53939451)
- [Download FFMPEG](https://www.ffmpeg.org/download.html)
- [Download OCIO Configs](https://github.com/imageworks/OpenColorIO-Configs)
- Install PyOpenColorIO: `pip install opencolorio`
- Install OpenTimelineIO: `pip install opentimelineio`
- Install Selenium: `pip install selenium`

or even better just `pip install requirements.txt` in your own virtual environment!

## Contributing
The best way to contribute to LabLib currently is to write extensive test cases for all modules. But also sharing your thoughts and ideas on the [Discussions Page](https://github.com/ynput/LabLib/discussions) really helps to keep this project going 💞
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
71 changes: 71 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
LabLib
======

Generate intermediate sequences for VFX processing using OIIO and
FFMPEG!

This module aims to help by providing helper classes and functions to: -
Get basic info from videos and images using iinfo and ffprobe as a
fallback. - Read and parse effect json outputted by
`AYON/Openpype <https://github.com/ynput>`__ for pipeline automation. -
Create a custom OCIO config file for direct use. - Create OIIO and
FFMPEG matrix values to be used in filters for repositioning. - Create
correctly formed OIIO commandline strings automatically. - Render out
frames with Color and Repositioning baked in using oiiotool

**DISCLAIMER** This is still a wip, and it’s currently missing a lot of
functionality. Use at your own risk!

Instructions
------------

The core functionality relies on using **Processors** and **Operators**
to compute the correct commandline parameters.

**Operators** are single operation classes that hold your operation
parameters (translation, luts, cdls etc.)

**Processors** (usually classes such as ``ColorTransformProcessor``)
compute **Operators** chains together. They can be fed ordered lists of
dicts (with same name attributes as Operator classes) or ordered lists
of **Operators** objects, or one at a time for secondary processing
between the chained operations. On compute they return their relevant
section of commandline flags to be passed to oiio.

**Renderers** take care of returning the fully formed commanline command
and executing it.

Installation
------------

LabLib requires ``python-3.9`` and uses ``poetry`` for managing its
dependencies.

It’s encouraged to use the provided PowerShell script to install and
download the binaries for
`oiiotool <https://www.patreon.com/posts/openimageio-oiio-63609827>`__,
`ffmpeg <https://github.com/GyanD/codexffmpeg/releases/tag/7.0.1>`__,
the `OCIO Color
Configs <https://github.com/colour-science/OpenColorIO-Configs/releases/tag/v1.2>`__
and the font `Source Code
Pro <https://fontsource.org/fonts/source-code-pro>`__ which is used in
tests.

- clone this repo
- ``.\start.ps1 install``
- ``.\start.ps1 get-dependencies``

Testing
~~~~~~~

You can run the full suite with ``.\start.ps1 test`` or to run custom
``pytest`` commands make sure to be in the cloned repository’s directory
and run ``poetry run pytest [ARGS]``.

Contributing
------------

The best way to contribute to LabLib currently is to write extensive
test cases for all modules. But also sharing your thoughts and ideas on
the `Discussions Page <https://github.com/ynput/LabLib/discussions>`__
really helps to keep this project going 💞
22 changes: 22 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import lablib

project = "LabLib"
copyright = "2024, maxpareschi, jakubjezek001, doerp"
author = lablib.__author__
release = lablib.__version__

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx_copybutton",
]
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

html_theme = "furo"

todo_include_todos = True

autodoc_typehints = "none"
5 changes: 5 additions & 0 deletions docs/generators.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Generators
==========

.. automodule:: lablib.generators
:members:
15 changes: 15 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Welcome to LabLib's documentation!
==================================
.. toctree::
:maxdepth: 1

📚 README <README>
modules


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
5 changes: 5 additions & 0 deletions docs/lib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Lib
===

.. automodule:: lablib.lib
:members:
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
13 changes: 13 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
⚙️ Module Documentation
=======================

This page contains auto-generated documentation for all exposed modules.

.. toctree::
:maxdepth: 2

lib
operators
generators
processors
renderers
5 changes: 5 additions & 0 deletions docs/operators.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Operators
=========

.. automodule:: lablib.operators
:members:
Loading

0 comments on commit d99a333

Please sign in to comment.