Skip to content

Commit

Permalink
Merge pull request #218 from TeamEpochGithub/v4.0.0
Browse files Browse the repository at this point in the history
V4.0.0
  • Loading branch information
schobbejak authored Jul 5, 2024
2 parents 4fc7221 + 1bbee31 commit 15ec30f
Show file tree
Hide file tree
Showing 88 changed files with 1,361 additions and 488 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
groups:
python-packages:
patterns:
- "*"
13 changes: 0 additions & 13 deletions .github/workflows/main-branch-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,7 @@ on:
branches: [ "main" ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files

build:

runs-on: ubuntu-latest
container:
image: python:3.11-slim
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Deploy Sphinx documentation to Pages

on:
push:
branches: [ main ] # Branch to trigger deployment

jobs:
pages:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- id: deployment
uses: sphinx-notes/pages@v3
with:
python_version: 3.12
22 changes: 9 additions & 13 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: 3.11

- run: |
pip install build
python -m build
- uses: actions/upload-artifact@v3
- name: Check out repository
uses: actions/checkout@v4.1.6
- name: Install the latest version of Rye
uses: eifinger/setup-rye@v3.0.2
- name: Build the package
run: rye build
- uses: actions/upload-artifact@v4.3.3
with:
path: ./dist

Expand All @@ -31,9 +27,9 @@ jobs:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4.1.7

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1.9.0
with:
packages-dir: artifact/
22 changes: 22 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Static Analysis

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "v*" ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
- name: Set up Python 3.10.14
uses: actions/setup-python@v5.1.0
with:
python-version: 3.10.14
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
79 changes: 17 additions & 62 deletions .github/workflows/version-branch-testing.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,33 @@
name: Version Branch CI/CD

on:
pull_request:
branches: ["v*"]
pull_request:
branches: ["v*"]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files

pytest:
runs-on: ubuntu-latest
container:
image: python:3.11-slim
env:
NODE_VERSION: 20

strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
- name: Check out repository
uses: actions/checkout@v4.1.6
with:
python-version: ${{ matrix.python-version }}

- name: Create virtual environment
run: python -m venv venv

- name: Activate virtual environment
run: |
. venv/bin/activate
- name: Install dependencies
run: |
venv/bin/python -m pip install --upgrade pip
venv/bin/python -m pip install pytest
venv/bin/python -m pip install -r requirements-dev.lock
venv/bin/python -m pip install pytest-cov coverage
fetch-depth: 0
- name: Install the latest version of Rye
uses: eifinger/setup-rye@v3.0.2
- name: Setup the environment
run: rye sync --all-features
- name: Test with pytest
run: |
venv/bin/python -m pytest --cov=epochalyst --cov-branch --cov-fail-under=95 tests
run: rye run pytest --cov=epochalyst --cov-branch --cov-fail-under=95 tests

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: 3.11

- run: |
pip install build
python -m build
- uses: actions/upload-artifact@v3
- name: Check out repository
uses: actions/checkout@v4.1.6
- name: Install the latest version of Rye
uses: eifinger/setup-rye@v3.0.2
- name: Build the package
run: rye build
- uses: actions/upload-artifact@v4.3.3
with:
path: ./dist
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ cython_debug/
data/

# Ignore logs
logging/
wandb/
/logging/
/wandb/

# Ignore zip files
*.zip
Expand Down
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
exclude: ^(external/|venv/|.venv/|tests/|.cache)
ci:
skip: [mypy]
repos:
- repo: local # Remove this when a new version of pre-commit-hooks (>4.6.0) is released
hooks:
Expand Down Expand Up @@ -68,10 +70,10 @@ repos:
hooks:
- id: mypy
additional_dependencies:
- "--extra-index-url=https://download.pytorch.org/whl/cpu"
- numpy==1.26.4
- pandas-stubs>=2.2.2.240514
- matplotlib==3.8.4
- torch==2.3.1
- torch==2.3.1+cpu
- dask==2024.6.2
- typing_extensions==4.9.0
- annotated-types==0.7.0
Expand Down
86 changes: 54 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
![image](./docs/_static/images/logo/Epochalyst_Logo_Dark.png#gh-light-mode-only)
![image](./docs/_static/images/logo/Epochalyst_Logo_Light.png#gh-dark-mode-only)
![image](https://raw.githubusercontent.com/TeamEpochGithub/epochalyst/main/assets/Epochalyst_Logo_Auto.svg)

[![Team Epoch](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2FJeffrey-Lim%2Fepoch-dvdscreensaver%2Fmaster%2Fbadge.json)](https://teamepoch.ai/)
[![PyPI Latest Release](https://img.shields.io/pypi/v/epochalyst.svg)](https://pypi.org/project/epochalyst/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/epochalyst.svg?label=PyPI%20downloads)](https://pypi.org/project/epochalyst/)
[![Python Version](https://img.shields.io/badge/Python-3.10_|_3.11_|_3.12-4584b6.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2NCIgaGVpZ2h0PSI2NCIgdmlld0JveD0iMCAwIDMyIDMyIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9IkEiIHgxPSI4MTEuNTI3IiB5MT0iNTc0Ljg5NSIgeDI9IjY2NS4yNTUiIHkyPSI1NzMuNzMyIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjMzY2YTk2Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMzY3OWIwIi8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgaWQ9IkIiIHgxPSI4NjIuODI0IiB5MT0iNjQyLjE3NiIgeDI9IjU3My4yNzYiIHkyPSI2NDIuMTc2IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZjODM2Ii8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZlODczIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PGcgdHJhbnNmb3JtPSJtYXRyaXgoLjE2MTcgMCAwIC4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9Ik03MjguMTY2IDU0MS41MDVjMC00Ljk3NiAzLjk4OC05IDguOTMtOSA0LjkyMyAwIDguOTMgNC4wMjMgOC45MyA5IDAgNC45Ni00LjAwNiA4Ljk4Mi04LjkzIDguOTgyLTQuOTQgMC04LjkzLTQuMDIzLTguOTMtOC45ODJ6bTUzLjU5IDE0OS43OThjMC00Ljk2IDQuMDA2LTguOTgyIDguOTMtOC45ODIgNC45NCAwIDguOTMgNC4wMjMgOC45MyA4Ljk4MiAwIDQuOTc2LTMuOTg4IDktOC45MyA5LTQuOTIzIDAtOC45My00LjAyMy04LjkzLTl6IiBmaWxsPSIjZmZmIi8+PC9nPjwvc3ZnPg==)](https://www.python.org/downloads/)
[![Rye](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/rye/main/artwork/badge.json)](https://rye-up.com)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/TeamEpochGithub/epochalyst/main.svg)](https://results.pre-commit.ci/latest/github/TeamEpochGithub/epochalyst/main)

Epochalyst is the base for [Team Epoch](https://teamepoch.ai/) competitions.

Expand All @@ -12,59 +17,76 @@ Epochalyst: A fusion of "Epoch" and "Catalyst," this name positions your pipelin

## Installation

Install `epochalyst` via pip:
Install `epochalyst` using [Rye](https://rye.astral.sh/):

```shell
pip install epochalyst
rye add epochalyst
```

Or using [Poetry](https://python-poetry.org/):
Or via pip:

```shell
poetry add epochalyst
pip install epochalyst
```

## Pytest coverage report
### Optional Dependencies

To generate pytest coverage report run
Depending on what data libraries you use, you can install the following optional dependencies:
```shell
rye add epochalyst[numpy,pandas,dask,polars] # Pick one or more of these
```

```python
python -m pytest --cov=epochalyst --cov-branch --cov-report=html:coverage_re
Depending on what type of competition you are participating in, you can install the following optional dependencies:
```shell
rye add epochalyst[image,audio] # Pick one or more of these
```

## Imports
Aside from that, you can install the following optional dependencies:
```shell
rye add epochalyst[onnx,openvino] # Optimizing model inference
```

### Caching
## Pytest coverage report

For caching some imports are only required, these have to be manually installed when needed
To generate pytest coverage report run

- dask >= 2023.12.0 & dask-expr
- pandas >= 1.3.0
- polars
- pyarrow >= 6.0.0 (Read parquet files)
- annotated-types >= 0.6.0
```shell
rye run pytest --cov=epochalyst --cov-branch --cov-report=html:coverage_re
```

### Model
## pre-commit

There is support for using timm models. To be able to do so the user must manually install timm.
- timm >= 0.9.16
This repository uses [pre-commit](https://pre-commit.com/) with [Ruff](https://github.com/astral-sh/ruff)
and [MyPy](https://mypy-lang.org/) hooks for code quality checks and auto-formatting.
To install the pre-commit hooks, run:

### Augmentation
```bash
rye run pre-commit install
```

There is also implementations of augmentations that are not in commonly used packages. Most of these are for time series data but there are implmenetations for CutMix and MixUp for images that can be used in the pipeline. To be able to use these the user must manually install kornia.
To run the pre-commit checks on all files, run:

- kornia >= 0.7.2
```bash
rye run pre-commit run --all-files
```

## Documentation

Documentation is generated using [Sphinx](https://www.sphinx-doc.org/en/master/).
Documentation is generated using [Sphinx](https://www.sphinx-doc.org/en/master/) and can be found [here](https://teamepochgithub.github.io/epochalyst).

To make the documentation, run `make html` with `docs` as the working directory. The documentation can then be found in `docs/_build/html/index.html`.
To make the documentation yourself, run `make html` with `docs` as the working directory.
The documentation can then be found in `docs/_build/html/index.html`.

Here's a short command to make the documentation and open it in the browser:
## Contributors

```shell
cd ./docs/;
./make.bat html; start chrome file://$PWD/_build/html/index.html
cd ../
```
Epochalyst was created by [Team Epoch IV](https://teamepoch.ai/team#iv), based in the [Dream Hall](https://www.tudelft.nl/ddream) of the [Delft University of Technology](https://www.tudelft.nl/).

[![Github Badge](https://img.shields.io/badge/-Emiel_Witting-24292e?style=flat&logo=Github)](https://github.com/EWitting)
[![Github Badge](https://img.shields.io/badge/-Jeffrey_Lim-24292e?style=flat&logo=Github)](https://github.com/Jeffrey-Lim)
[![Github Badge](https://img.shields.io/badge/-Hugo_de_Heer-24292e?style=flat&logo=Github)](https://github.com/hjdeheer)
[![Github Badge](https://img.shields.io/badge/-Jasper_van_Selm-24292e?style=flat&logo=Github)](https://github.com/schobbejak)
[![Github Badge](https://img.shields.io/badge/-Tolga_Kopar-24292e?style=flat&logo=Github)](https://github.com/tolgakopar)
[![Github Badge](https://img.shields.io/badge/-Ariel_Ebersberger-24292e?style=flat&logo=Github)](https://github.com/justanotherariel)
[![Github Badge](https://img.shields.io/badge/-Gregoire_Dumont-24292e?style=flat&logo=Github)](https://github.com/Gregoire-Andre-Dumont)
[![Github Badge](https://img.shields.io/badge/-Kristóf_Sándor-24292e?style=flat&logo=Github)](https://github.com/emherk)
[![Github Badge](https://img.shields.io/badge/-Daniel_De_Dios_Allegue-24292e?style=flat&logo=Github)](https://github.com/daniallegue)
Loading

0 comments on commit 15ec30f

Please sign in to comment.