Skip to content

Commit

Permalink
introducing data model blast
Browse files Browse the repository at this point in the history
wip

wip

cleanup
  • Loading branch information
Marius Isken authored and miili committed Apr 6, 2023
1 parent b55cf26 commit 7ead6d6
Show file tree
Hide file tree
Showing 18 changed files with 883 additions and 245 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
manylinux: auto
command: build
args: --release --sdist -o dist --find-interpreter --ignore-rust-version
args: --release --sdist -o dist --find-interpreter

- name: Upload wheels
uses: actions/upload-artifact@v3
Expand All @@ -31,7 +31,7 @@ jobs:
- uses: PyO3/maturin-action@v1
with:
command: build
args: --release -o dist --find-interpreter --ignore-rust-version
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand Down
37 changes: 22 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
args: [--profile, black]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.0.260"
hooks:
- id: ruff
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,30 @@ pip install maturin
maturin build
```

## Contribution
### Development

Contribution and merge requests by the community are welcome!
Local development through pip or maturin.

```sh
cd lightguide
pip3 install .[dev]
```

or

```sh
cd lightguide
maturin develop
```

The project utilizes pre-commit for clean commits, install the hooks via:

```sh
pre-commit install
```

## License

Contribution and merge requests by the community are welcome!

Lightguide was written by Marius Paul Isken and is licensed under the GNU GENERAL PUBLIC LICENSE v3.
17 changes: 8 additions & 9 deletions lightguide/afk_filter_python.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
from __future__ import annotations

from functools import lru_cache
from pathlib import Path

import numpy as np
import numpy.typing as npt


@lru_cache
def triangular_taper_python(size: int, plateau: int) -> npt.NDArray:

def triangular_taper_python(size: int, plateau: int) -> np.ndarray:
if plateau > size:
raise ValueError("Plateau cannot be larger than size.")
if size % 2 or plateau % 2:
Expand All @@ -24,16 +21,18 @@ def triangular_taper_python(size: int, plateau: int) -> npt.NDArray:


def afk_filter_python(
data: npt.NDArray,
data: np.ndarray,
window_size: int = 32,
overlap: int = 14,
exponent: float = 0.3,
normalize_power: bool = False,
) -> npt.NDArray:
if np.log2(window_size) % 1.0 or window_size < 4:
raise ValueError("window_size has to be pow(2) and > 4.")
) -> np.ndarray:
if np.log2(window_size) % 1 or window_size < 4:
raise ValueError(f"Window size {window_size} be pow(2) and > 4.")
if overlap > window_size / 2 - 1:
raise ValueError("Overlap is too large. Maximum overlap: window_size / 2 - 1.")
raise ValueError(
f"Overlap {overlap} is too large. Maximum overlap: window_size / 2 - 1."
)

window_stride = window_size - overlap
window_non_overlap = window_size - 2 * overlap
Expand Down
Loading

0 comments on commit 7ead6d6

Please sign in to comment.