Skip to content

Dev 081 #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 102 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
d463d34
chore: make normalization of max of valid regions
Mar 12, 2024
0e7be6c
chore: update processing
Mar 12, 2024
e9f44c0
chore: add validation for test_if_spectrum_has_model_region in Spectr…
Mar 12, 2024
953093a
chore: make default_regions into dict of SpectrumRegionLimits
Mar 12, 2024
5609528
chore: add kwargs to typer cli
Mar 12, 2024
441defc
chore: add split rows to parser
Mar 12, 2024
935d1b6
chore: add loop for plotting of generic models
Mar 12, 2024
60e3024
chore: minor fixes
Mar 12, 2024
c2bb6b2
tests: add model config fixture low_first_order
Mar 12, 2024
a63b320
chore: refactor import export
May 12, 2024
9104a2f
chore: refactor config
May 12, 2024
8dcdc4c
chore: refactor delegating
May 12, 2024
afd40d6
chore: refactor models
May 12, 2024
91a5a9e
tests: update and refactor tests
May 12, 2024
fa4f558
cli: add typer cli commands
May 12, 2024
8431d3d
chore: minor changes
May 12, 2024
da797b5
build: add tomli_w dependency and test marker slow
May 12, 2024
0d4ed32
pre-commit: autoupdate
Nov 24, 2024
313ff24
build: upgrade to py 3.12 only
Jan 26, 2025
57e6da3
update and fix import from files
Jan 26, 2025
130982e
fix(models): update models
Jan 26, 2025
dca0229
fix(all): apply minor fixes
Jan 26, 2025
8a88e77
tests: fix failing tests
Jan 26, 2025
8cb7833
ci: upgrade to py 3.12
Jan 26, 2025
51a26d1
chore: upgrade to py 3.12
Jan 26, 2025
e1d63fb
chore: update RegionNames and typing
Jan 26, 2025
5e5619f
chore: update logger
Jan 26, 2025
56c160a
build: fix pytest coverage addopts
Jan 26, 2025
16c1a1d
docs: update make example
Jan 26, 2025
a8f5a65
logging: update and add tests
Feb 2, 2025
f4310f0
add typer tests and fix logging
Feb 2, 2025
44b6acb
build: use bumpy-my-version for versioning
Feb 2, 2025
a5b209f
chore(imports): refactor and clean up
Feb 9, 2025
ea74179
chore: refactor, clean up and style
Feb 9, 2025
1801316
refactor delegator and fix tests
Feb 9, 2025
1ce5d03
build(pyproject,uv.lock): remove pandas add ruff and uv.lock
Feb 9, 2025
4f72405
chore: refactor to delegators and rm pd deps
Feb 9, 2025
0687508
chore(delegators): fix and refactor main fitting run
Feb 9, 2025
dc7abe0
chore: add docstrings
Feb 9, 2025
0f37a9c
build(docker): update and fix dockerfile, add pre-commit to dev deps
Feb 9, 2025
04e3a9b
build(pre-commit): add uv-pre-commit lock hook
Feb 10, 2025
6a334a5
build(docker): fix docker build and run, refactor version
Feb 10, 2025
ae1d7df
chore: fix typing and tests
Feb 10, 2025
977a229
docs: mv to docs dir and add docker
Feb 10, 2025
43d24b0
dev(justfile): add justfile and commands
Feb 10, 2025
6faee58
chore: clean up
Feb 10, 2025
8eb9a06
ci: update and fix jobs
Feb 10, 2025
7063994
ci: fix yaml and add pre-commit hook
Feb 10, 2025
a643697
build(docker): add non-root user
Feb 10, 2025
25d97cf
chore: fix type of arg
Feb 10, 2025
8786790
config: update paths
Apr 12, 2025
9eebc9d
delegators: update fit runners
Apr 12, 2025
d2dfc0c
exports: fix export
Apr 12, 2025
9bdac04
models: fix fit runner
Apr 12, 2025
c4e9309
processing: fix fit run
Apr 12, 2025
4d5a601
tests: update logging and fix fit result
Apr 12, 2025
ab9105c
just: add pytest group cmd
Apr 12, 2025
9bb337d
imports: fix and refactor
Apr 13, 2025
7f2fcd4
fix and refactor models and processing
Apr 13, 2025
a843a44
fix and refactor exports and config
Apr 13, 2025
03f078f
tests: update and fix
Apr 13, 2025
1ad595b
fix processing of sample data
Apr 13, 2025
928e30a
fix code quality issues
Apr 13, 2025
9b5e3bf
ci: fix codecov
Apr 13, 2025
b10ca1f
build: add coverage
Apr 13, 2025
1055767
ci: add codecov token
Apr 13, 2025
b7bed12
fix export and update tests
Apr 13, 2025
4f00b7e
build: update pytest commands
Apr 13, 2025
d2d723f
ci: update python versions and handle errors
Apr 17, 2025
14d6cbf
ci: use pwsh for pytest on windows
Apr 17, 2025
f6059ef
ci: disable color on win
Apr 17, 2025
1cb9531
ci: disable force color on win
Apr 17, 2025
193e5ca
ci: use ansi2html for win
Apr 18, 2025
8e48a96
build: update py versions >=3.10
Apr 18, 2025
d41b601
ci: use uv
Apr 18, 2025
4b415e8
style: fix Unpack
Apr 18, 2025
e858508
ci: split job for windows
Apr 18, 2025
2431b55
style: fix compat with 310
Apr 18, 2025
86129dc
ci: add ci permissions
Apr 18, 2025
78ac862
style: fix compat with >=311
Apr 18, 2025
23dd918
ci: use uv run in job for windows
Apr 18, 2025
257065c
refactor method run in fit model
Apr 18, 2025
a8cde77
ci: add upload of example artifacts
Apr 18, 2025
d8605f4
ci: add HOME_DIR for upload of artifacts
Apr 18, 2025
1c0e8b7
refactor: clean up
Apr 18, 2025
80eba29
refactor: update spectrum reader
Apr 18, 2025
2fd8d4e
refactor: make file indexer async
Apr 18, 2025
0130ea2
refactor: update index and delegator
Apr 18, 2025
1ae0c8b
build: add attrs
Apr 18, 2025
198cf7f
tests: fix tes
Apr 18, 2025
8d9cafa
refactor: fix compat 310 UTC
Apr 18, 2025
43b8196
refactor import and error handling
Apr 21, 2025
0f1297d
feat(cli): add show command and refactor
Apr 21, 2025
1d2758f
chore: refactor utils
Apr 21, 2025
161028c
chore: fix arg
Apr 21, 2025
77a200d
chore: clean up
Apr 21, 2025
f115170
chore: fix flake issue
Apr 21, 2025
21e18b9
chore: fix flake issue
Apr 21, 2025
b24bd5a
chore: fix flake str issue
Apr 21, 2025
9762473
chore: fix flake str issue
Apr 21, 2025
73ba649
chore: remove multiprocessing
Apr 21, 2025
92054b8
chore: remove \n from f strings
Apr 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.venv/
# Ignore the 'data' and 'output' directories
examples/

# Ignore Python bytecode files and cache directories
*.pyc
*.pyo
__pycache__/

# Ignore any other unnecessary files (e.g., logs, test outputs)
*.log
*.bak
*.swp

# Optionally, ignore other common file types you don't want in the image
*.git
*.gitignore
128 changes: 85 additions & 43 deletions .github/workflows/build-test-codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Lint Build Test Codecov

on:
Expand All @@ -11,50 +8,95 @@

jobs:

build:
# Main Build Job
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [3.11]
os: [ ubuntu-latest, macos-latest ]
python-version: [ '3.10', '3.11', '3.12', '3.13' ] # Add multiple Python versions for testing

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Verify uv installation
run: |
uv --version || echo "uv installation failed"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install the project
run: |
uv sync --all-extras --dev || echo "Dependency installation failed"

- name: Lint with flake8
run: |
uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

- name: Run tests and generate coverage report
run: |
uv run pytest --verbose --cov --cov-report=xml --cov-report=term-missing || echo "Tests failed"

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false # Don't fail CI if Codecov upload fails
token: ${{ secrets.CODECOV_TOKEN }}

- name: Run examples
run: |
uv run raman_fitting run examples

# Separate Windows Job
windows:
runs-on: windows-latest
continue-on-error: true # Allow this job to fail without failing the whole workflow
strategy:
fail-fast: true
matrix:
python-version: [ '3.13' ] # Add multiple Python versions for testing

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python3 -m pip install -U pip
python3 -m pip install -U build
python3 -m pip install flake8

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=140 --statistics

- name: Build wheels
run: |
python3 -m build
# install the package in editable mode for the coverage report
python3 -m pip install -e .["pytest"]

- name: Generate coverage report
run: |
pytest --cov --cov-report=xml --cov-report=term-missing
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1

- name: raman_fitting run examples


run: |
raman_fitting run examples
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Verify uv installation
run: |
uv --version || echo "uv installation failed"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install the project
run: |
uv sync --all-extras --dev || echo "Dependency installation failed"

- name: Run Windows-specific tests
run: |
uv pip install ansi2html
echo "from ansi2html.parser import Ansi2HTMLParser; import sys; sys.stdout.write(Ansi2HTMLParser().parse(input()))" > strip_ansi.py
uv run pytest --capture=sys --tb=short | python strip_ansi.py

- name: Run examples
run: |
uv run raman_fitting run examples
17 changes: 0 additions & 17 deletions .github/workflows/github-actions-demo.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test-release-candidate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.11"]
python-version: ["3.12"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upload-to-testpypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow

- name: Set up python 3.11
- name: Set up python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12

# Installs and upgrades pip, installs other dependencies and installs the package from pyproject.toml
- name: Installs and upgrades pip and installs other dependencies
Expand Down
139 changes: 1 addition & 138 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,138 +1 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
testresults.xml

*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
env*/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# VS code project settings
.vscode

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# pycharm
.todo/

# datafiles and results
**/results/*
tests/test_results/**

/*.csv
/*.zip
#/*.txt
/*.xlsx

# local configuration settings
local_config.py

# all logs
logs/

# trained models (will be created in CI)
/*.pkl

# extra tox files
tox.ini.bak
tox-generated.ini

# Generated by setuptools-scm
*/*/_version.py
src/raman_fitting/_version.py
12 changes: 9 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# Temporary disabling hooks: SKIP=flake8 git commit -m "foo"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-added-large-files
name: Check for files larger than 5 MB
args: [ "--maxkb=5120" ]
Expand All @@ -15,14 +16,19 @@ repos:
name: Check for trailing whitespaces (auto-fixes)
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.2
rev: v0.8.0
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.2
rev: v8.21.2
hooks:
- id: gitleaks
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.5.29
hooks:
- id: uv-lock
Loading
Loading