Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1574 commits
Select commit Hold shift + click to select a range
c863c54
refactor: use union operator
JoshLoecker Dec 2, 2024
1527f18
refactor: add new function for converting genomic data
JoshLoecker Dec 2, 2024
07d6291
feat: move algorithm options from create context specific
JoshLoecker Dec 2, 2024
d5dfdc0
style: use logger instead of print
JoshLoecker Dec 2, 2024
bf072d7
refactor: remove duplicate import
JoshLoecker Dec 2, 2024
b5998bf
feat: import pipeline components
JoshLoecker Dec 2, 2024
1495fc8
style: use algorith object not strings
JoshLoecker Dec 2, 2024
73f36d7
fix: collect any csv file under preparation method for context
JoshLoecker Dec 2, 2024
96bf940
style: ruff formatting
JoshLoecker Dec 2, 2024
d1e5c3a
fix: convert to string before using string operations
JoshLoecker Dec 2, 2024
991a8c2
fix: make directory before writing
JoshLoecker Dec 2, 2024
c32b32d
fix: properly check that items exist before using
JoshLoecker Dec 2, 2024
951964c
fix: unravel nested lists
JoshLoecker Dec 2, 2024
fdc41a4
fix: proper import sorting and usage
JoshLoecker Dec 2, 2024
52a6b1f
refactor: move algorithm to utils
JoshLoecker Dec 2, 2024
500bf91
style: proper docstrings
JoshLoecker Dec 2, 2024
6a1262a
style: ruff formatting; remove unused variables
JoshLoecker Dec 2, 2024
49c5e49
refactor: proper error message
JoshLoecker Dec 2, 2024
b775798
refactor: proper usage of `Algorithm`
JoshLoecker Dec 2, 2024
82ce985
style: ruff formatting & linting
JoshLoecker Dec 2, 2024
52c9436
style: ruff formatting & linting; proper docstrings
JoshLoecker Dec 2, 2024
ca4581a
fix: proper usage of enum object; async usage
JoshLoecker Dec 2, 2024
a92059c
style: proper docstring; added additional directories
JoshLoecker Dec 2, 2024
a7612d1
style: ruff formatting
JoshLoecker Dec 2, 2024
8f5c58e
style: ruff import formatting
JoshLoecker Dec 2, 2024
b0ab689
style: proper docstring usage
JoshLoecker Dec 2, 2024
24e40e3
style: rename private classes and functions; use loguru
JoshLoecker Dec 2, 2024
a7486bd
refactor: remove unused arguments
JoshLoecker Dec 2, 2024
74c4838
feat: reading h5ad files for single-cell analysis
JoshLoecker Dec 2, 2024
1cd7414
style: do not iterate through unnecessary items; ruff formatting
JoshLoecker Dec 2, 2024
75aeb48
feat: dynamic multiprocessing for large files
JoshLoecker Dec 2, 2024
8b78acb
style: ruff formatting
JoshLoecker Dec 2, 2024
74ed039
style: fix imports
JoshLoecker Dec 2, 2024
2549392
fix: invalid collection of command line items
JoshLoecker Dec 2, 2024
ba73b8e
style: proper docstrings; ruff formatting
JoshLoecker Dec 2, 2024
3c055bb
style: fix imports
JoshLoecker Dec 2, 2024
2aadb77
fix: proper return type; pathlib usage; ruff formatting
JoshLoecker Dec 2, 2024
1eb306f
fix: proper return type; pathlib usage; ruff formatting
JoshLoecker Dec 2, 2024
6f0448e
feat: use biothings for data conversion
JoshLoecker Dec 2, 2024
754e3ad
style: format code, Jupyter Notebook(s), and Python imports with `ruff`
JoshLoecker Dec 2, 2024
4e5c0cc
refactor: create more structured file
JoshLoecker Dec 2, 2024
8cfb92f
feat: merge ci items into a single workflow
JoshLoecker Dec 3, 2024
05489a7
Merge remote-tracking branch 'origin/purge_r' into purge_r
JoshLoecker Dec 3, 2024
aa51c69
feat: expand usable python versions
JoshLoecker Dec 3, 2024
a271c93
fix: do not allow 3.13 because gurobi only supports up to 3.12
JoshLoecker Dec 3, 2024
84c4512
fix: ruff linting fixes
JoshLoecker Dec 3, 2024
b287a07
feat: add pytest-cov
JoshLoecker Dec 3, 2024
55847f0
feat: added migrations file to coerce data into correct format
JoshLoecker Dec 3, 2024
7f723fd
fix: use proper header
JoshLoecker Dec 4, 2024
7a2fec6
fix: install fixed dependency version of troppo and cobamp
JoshLoecker Dec 4, 2024
7cb2389
refactor!: add taxon id as command line argument to required files
JoshLoecker Dec 4, 2024
51ffd1a
refactor: add hypothesis cache to gitignore
JoshLoecker Dec 4, 2024
26400a7
refactor: do not require recon algorithm
JoshLoecker Dec 4, 2024
9a42973
style: use proper docstrings; ruff formatting; type hints
JoshLoecker Dec 4, 2024
0b9cfc3
fix: proper collection of data files
JoshLoecker Dec 4, 2024
a4b0071
style: function rename
JoshLoecker Dec 4, 2024
53b9d7d
refactor: import types; rename functions
JoshLoecker Dec 4, 2024
731ea74
refactor: import types; use `match` when applicable
JoshLoecker Dec 4, 2024
dcba537
fix: import statements; proper async usage
JoshLoecker Dec 4, 2024
58b62ad
refactor: use proper imports; introduce data migration functions
JoshLoecker Dec 4, 2024
dc2deb0
refactor: remove unused imports; use `match` where applicable
JoshLoecker Dec 4, 2024
87d5ce6
refactor!: do not require input format
JoshLoecker Dec 4, 2024
ccb3ce4
revert: only unit test 3.10 as that is what we require
JoshLoecker Dec 4, 2024
3da630b
fix: remove numpy dependency; update uv action
JoshLoecker Dec 4, 2024
afc55b8
fix: ruff linting errors
JoshLoecker Dec 4, 2024
8cc5fb1
style: format code, Jupyter Notebook(s), and Python imports with `ruff`
JoshLoecker Dec 4, 2024
dffc8b1
fix: ignore errors on files not yet ready for linting
JoshLoecker Dec 4, 2024
f808a55
Merge remote-tracking branch 'origin/purge_r' into purge_r
JoshLoecker Dec 4, 2024
3dd58bd
Merge pull request #187 from HelikarLab/purge_r
JoshLoecker Dec 4, 2024
b9ca5f9
feat: initial work to remove hardcoded filepaths
JoshLoecker Dec 5, 2024
a7617ca
chore(deps): bump astral-sh/setup-uv from 3 to 4
dependabot[bot] Dec 5, 2024
d6cb978
chore(deps): bump astral-sh/ruff-action from 1 to 2
dependabot[bot] Dec 5, 2024
983ee48
fix: do not make Solver private
JoshLoecker Dec 5, 2024
c356673
Merge pull request #191 from HelikarLab/fix-cc-integration
JoshLoecker Dec 5, 2024
c62ff0d
refactor: allow formatting of jupyter notebooks
JoshLoecker Dec 7, 2024
c3a6356
refactor: rename
JoshLoecker Dec 7, 2024
ac400ee
refactor: import required libraries
JoshLoecker Dec 7, 2024
f98d26b
refactor: remove unused arguments dataclass
JoshLoecker Dec 7, 2024
243bdea
refactor: remove unused cli argument parsing
JoshLoecker Dec 7, 2024
0b6cfab
fix: get correct column name
JoshLoecker Dec 7, 2024
141eee8
refactor: pythonic approach to merging dataframes
JoshLoecker Dec 7, 2024
e9ca88c
style: variable renaming
JoshLoecker Dec 7, 2024
c4ba4ea
style: ruff formatting
JoshLoecker Dec 7, 2024
0408464
✨ feat: added gitmoji
JoshLoecker Dec 7, 2024
0b7f6dc
♻️ refactor: remove commitizen
JoshLoecker Dec 7, 2024
3e0301f
🎨 style: change variable names
JoshLoecker Dec 7, 2024
f8d2d5f
🎨 style: sort dependencies
JoshLoecker Dec 7, 2024
629715f
➕ dep-add: add interactive optional dependencies
JoshLoecker Dec 7, 2024
c0853b5
➕ dep-add: add commitizen and conventional gitmoji
JoshLoecker Dec 7, 2024
727a32f
♻️ refactor: accept file paths instead of dataframes
JoshLoecker Dec 9, 2024
a2a4cac
📝 docs: update documentation
JoshLoecker Dec 9, 2024
88af6e6
♻️ refactor: accept integers only for taxon IDs
JoshLoecker Dec 9, 2024
3723423
♻️ refactor: pythonic approach to calculating size
JoshLoecker Dec 9, 2024
efe6549
♻️ refactor: accept integer for taxon id
JoshLoecker Dec 9, 2024
03de28a
♻️ refactor: more concise method of creating matrix
JoshLoecker Dec 9, 2024
82c5d15
♻️ refactor: remove command line interface
JoshLoecker Dec 9, 2024
fb2a5c8
♻️ refactor: define specific input/output file paths
JoshLoecker Dec 9, 2024
2d829fa
♻️ refactor: remove unnecessary code
JoshLoecker Dec 9, 2024
9435f23
♻️ refactor: allow processing specific filepaths
JoshLoecker Dec 9, 2024
9e2ab78
feat: use commitizen for conventional commits
JoshLoecker Dec 9, 2024
a1e813a
feat: update unit tests for rnaseq_preprocess
JoshLoecker Dec 9, 2024
918862c
feat: allow long lines in jupyter notebook
JoshLoecker Dec 9, 2024
312a7dd
style: ruff formatting
JoshLoecker Dec 9, 2024
8b1b606
fix: ignore F811
JoshLoecker Dec 9, 2024
a1f3096
fix: duplicate noqa directive
JoshLoecker Dec 9, 2024
8096c45
refactor: remove unused testing file
JoshLoecker Dec 9, 2024
863a450
test: update tests based on changes
JoshLoecker Dec 9, 2024
6d2f7c7
fix: do not use asyncio.gather
JoshLoecker Dec 9, 2024
3fcc34f
Merge pull request #192 from HelikarLab/remove-hardcoded-paths/rnaseq…
JoshLoecker Dec 9, 2024
6f83fcd
fix: use proper type
JoshLoecker Dec 9, 2024
7cc15f8
refactor: remove dependency on Config
JoshLoecker Dec 9, 2024
b5906af
style: ruff formatting
JoshLoecker Dec 9, 2024
61ed96f
refactor: require output filepath for CPM
JoshLoecker Dec 9, 2024
c2b3b41
style: log message for calcualted genes
JoshLoecker Dec 9, 2024
479f516
Merge branch 'main' into remove-hardcoded-paths/rnaseq
JoshLoecker Dec 9, 2024
9062296
Merge branch 'develop' into remove-hardcoded-paths/rnaseq
JoshLoecker Dec 9, 2024
b1db51c
Merge pull request #193 from HelikarLab/remove-hardcoded-paths/rnaseq
JoshLoecker Dec 9, 2024
a84610c
Merge branch 'main' of github.com:HelikarLab/COMO into develop
JoshLoecker Dec 9, 2024
ff70eae
Merge pull request #190 from HelikarLab/dependabot/github_actions/ast…
JoshLoecker Dec 9, 2024
3571b94
Merge pull request #189 from HelikarLab/dependabot/github_actions/ast…
JoshLoecker Dec 9, 2024
988615a
Merge branch 'develop' of github.com:HelikarLab/COMO into develop
JoshLoecker Dec 9, 2024
20eebc7
feat: add boundary column
JoshLoecker Dec 9, 2024
b526a9e
fix: allow new boundary column
JoshLoecker Dec 9, 2024
f356184
Merge pull request #196 from HelikarLab/hotfix
JoshLoecker Dec 9, 2024
b77cd80
feat: write zFPKM graphs
JoshLoecker Dec 9, 2024
e9e530b
Merge pull request #197 from HelikarLab/hotfix
JoshLoecker Dec 9, 2024
b3502c1
refactor: remove rnaseq.py
JoshLoecker Dec 9, 2024
4623d10
refactor: import items from rnaseq.py
JoshLoecker Dec 9, 2024
240b5e3
refactor: remove command line usage
JoshLoecker Dec 9, 2024
477b82a
refactor: add classes for rna processing
JoshLoecker Dec 9, 2024
083b9c7
feat: added k_over_a calculation
JoshLoecker Dec 9, 2024
1441004
feat: added genefilter function
JoshLoecker Dec 9, 2024
c966536
refactor: create separate read_counts matrix
JoshLoecker Dec 9, 2024
6c7dc0b
feat: bring zfpkm_filter from rnaseq.py
JoshLoecker Dec 9, 2024
63f219c
feat: added matrix builder
JoshLoecker Dec 9, 2024
60a1597
feat: added tpm calculation
JoshLoecker Dec 9, 2024
aaa54f3
feat: added fpkm calculation
JoshLoecker Dec 9, 2024
9ac12c4
feat: added zfpkm transformation and calculation
JoshLoecker Dec 9, 2024
ec41d96
feat: added zfpkm plotting
JoshLoecker Dec 9, 2024
a8c366f
feat: aded calculate z score
JoshLoecker Dec 9, 2024
b7d1eff
feat: added cpm filtering
JoshLoecker Dec 9, 2024
462b13c
feat: added tpm quantile filtering
JoshLoecker Dec 9, 2024
14f1920
feat: added root filtering logic
JoshLoecker Dec 9, 2024
211626a
feat: added logic for performing statistical tests
JoshLoecker Dec 9, 2024
f761080
feat: create metadata df
JoshLoecker Dec 9, 2024
52a871a
refactor: allow passing specific filepaths
JoshLoecker Dec 9, 2024
080e82b
refactor: rename variable names for easier reuse
JoshLoecker Dec 9, 2024
6af7049
fix: use better column names
JoshLoecker Dec 9, 2024
9059e55
fix: match new column names
JoshLoecker Dec 9, 2024
350d757
Merge branch 'main' into hotfix
JoshLoecker Dec 9, 2024
fbb3ac9
Merge pull request #198 from HelikarLab/hotfix
JoshLoecker Dec 9, 2024
991f1e2
style: update log message, more pythonic code
JoshLoecker Dec 10, 2024
e74e588
style: variable rename
JoshLoecker Dec 10, 2024
d217b63
feat: update to match new approach
JoshLoecker Dec 10, 2024
056d221
chore(deps): bump astral-sh/setup-uv from 3 to 4
dependabot[bot] Dec 10, 2024
55addcf
chore(deps): bump astral-sh/ruff-action from 1 to 2
dependabot[bot] Dec 10, 2024
770160b
fix: set solver using cobra configuration
JoshLoecker Dec 10, 2024
abbf3ef
revert: use mrna instead of polya
JoshLoecker Dec 10, 2024
b5e88cd
refactor: check files returned
JoshLoecker Dec 10, 2024
a7b156f
feat: allow specifying specific directories
JoshLoecker Dec 10, 2024
f3b0705
style: use more descriptive variable names
JoshLoecker Dec 10, 2024
19e9982
refactor: use early continue
JoshLoecker Dec 10, 2024
6889946
style: update warning messages
JoshLoecker Dec 10, 2024
3c557d8
style: rename variables
JoshLoecker Dec 10, 2024
4f20a0f
refactor: move filtering technique to types
JoshLoecker Dec 10, 2024
6753b0e
fix: do not use more cores than necessary
JoshLoecker Dec 10, 2024
37ec16f
fix: set cobra solver earlier
JoshLoecker Dec 10, 2024
fb39d19
refactor: remove troppo and cobamp for CC testing
JoshLoecker Dec 10, 2024
ac8732f
chore: bump version
JoshLoecker Dec 11, 2024
8a8c1c7
chore: bump version
JoshLoecker Dec 11, 2024
1a0ba24
revert: require troppo and cobamp
JoshLoecker Dec 11, 2024
471231f
revert: install troppo and cobamp from modified repo
JoshLoecker Dec 11, 2024
8d0d4f0
feat: set troppo solver
JoshLoecker Dec 11, 2024
3a08826
fix: provide solver to imat build function
JoshLoecker Dec 11, 2024
d3b919b
fix: temporarily install troppo from develop
JoshLoecker Dec 11, 2024
0c7bc57
fix: install from branch
JoshLoecker Dec 11, 2024
935f532
refactor: install troppo/cobamp from github
JoshLoecker Dec 11, 2024
932ced9
fix: use proper installation for troppo/cobamp
JoshLoecker Dec 11, 2024
10274ce
fix: use correct branch for cobamp
JoshLoecker Dec 11, 2024
7343ddf
chore: reset troppo branch
JoshLoecker Dec 11, 2024
925791b
fix: solver must be uppercase
JoshLoecker Dec 11, 2024
d595881
chore: remove print
JoshLoecker Dec 11, 2024
b88f043
chore: fix typo
JoshLoecker Dec 11, 2024
dc5f71a
Merge pull request #202 from HelikarLab/fix/troppo-cobamp-requirement
JoshLoecker Dec 11, 2024
a59fb97
Merge pull request #201 from HelikarLab/dependabot/github_actions/ast…
JoshLoecker Dec 11, 2024
50be093
Merge pull request #200 from HelikarLab/dependabot/github_actions/ast…
JoshLoecker Dec 11, 2024
cb732c1
chore: bump version
JoshLoecker Dec 11, 2024
5d45105
Merge pull request #203 from HelikarLab/hotfix
JoshLoecker Dec 11, 2024
3ea5056
Merge branch 'main' into develop
JoshLoecker Dec 11, 2024
78596db
Merge branch 'main' into develop
JoshLoecker Dec 11, 2024
647d41b
chore: merge dependabot updates into hotfix
JoshLoecker Dec 11, 2024
9646f49
Merge branch 'main' into hotfix
JoshLoecker Dec 11, 2024
676055c
Merge pull request #204 from HelikarLab/hotfix
JoshLoecker Dec 11, 2024
956e4ed
Merge branch 'develop' into remove-hardcoded-paths/rnaseq-gen
JoshLoecker Dec 11, 2024
0c359d2
fix: use parenthesis to validate calculations
JoshLoecker Dec 11, 2024
ec95370
refactor: ignore missing variables for now
JoshLoecker Dec 11, 2024
4d5092a
chore: ignore complex function
JoshLoecker Dec 11, 2024
3105071
Merge pull request #199 from HelikarLab/remove-hardcoded-paths/rnaseq…
JoshLoecker Dec 11, 2024
090d0ad
chore: remove unused imports
JoshLoecker Dec 11, 2024
c0326d9
refactor: remove command line interface
JoshLoecker Dec 11, 2024
c7a47e8
feat: process input data more pythonically
JoshLoecker Dec 11, 2024
dd75e06
refactor: do not use hardcoded filepaths
JoshLoecker Dec 11, 2024
ca2f383
chore: ruff formatting
JoshLoecker Dec 11, 2024
226f0d4
style: use better variable name & reorganize
JoshLoecker Dec 11, 2024
160dbe3
feat: process the provided file paths
JoshLoecker Dec 11, 2024
001222f
feat: write to provided filepath
JoshLoecker Dec 11, 2024
2a155d5
refactor: remove hardcoded filepaths
JoshLoecker Dec 11, 2024
cac137a
refactor: pythonic approach to processing
JoshLoecker Dec 11, 2024
d294cb0
fix: arguments to write data
JoshLoecker Dec 11, 2024
b349207
Merge pull request #205 from HelikarLab/remove-hardcoded-paths/proteo…
JoshLoecker Dec 11, 2024
f9e4dc9
Merge branch 'main' of github.com:HelikarLab/COMO into remove-hardcod…
JoshLoecker Dec 11, 2024
92d80eb
feat: allow specifiying files to process
JoshLoecker Dec 11, 2024
47fa7f3
fix: no longer require rna processing type
JoshLoecker Dec 11, 2024
5b4f3ae
Merge pull request #206 from HelikarLab/remove-hardcoded-paths/proteo…
JoshLoecker Dec 11, 2024
a10e7c9
Merge branch 'main' into develop
JoshLoecker Dec 11, 2024
50ac75a
Merge branch 'main' into develop
JoshLoecker Dec 11, 2024
f1753c7
feat: add gurobi as an optional dependency
JoshLoecker Dec 12, 2024
fa9b5e8
Revert mistaken merge (#209)
JoshLoecker Dec 13, 2024
4bc39c1
chore(deps): bump astral-sh/ruff-action from 2 to 3 (#213)
dependabot[bot] Jan 6, 2025
9187e17
chore(deps): bump astral-sh/setup-uv from 4 to 5
dependabot[bot] Jan 6, 2025
0c7592c
Merge pull request #212 from HelikarLab/dependabot/github_actions/ast…
JoshLoecker Jan 6, 2025
f4ebd32
Fix ruff linting errors (#218)
JoshLoecker Oct 2, 2025
8685215
hotfix: log full name of directory if not found (#225)
JoshLoecker Oct 2, 2025
76ccad4
Fix Single Cell Processing (#214)
JoshLoecker Oct 2, 2025
1df8f39
Fix RNA-seq Processing and Boolean Activity Determination (#227)
JoshLoecker Oct 6, 2025
3fc42df
Fix imat build (#233)
JoshLoecker Oct 7, 2025
9597584
refactor: build a `FisherExactTest` object for validating tests
JoshLoecker Oct 7, 2025
32d7b80
feat: added log statement and hint to user that an empty dataframe in…
JoshLoecker Oct 9, 2025
e70980b
fix: do not drop na values; keep as much data as possible
JoshLoecker Oct 23, 2025
4a44590
fix: allow empty genomic values
JoshLoecker Oct 23, 2025
f097305
Cobra Types (#237)
JoshLoecker Nov 3, 2025
0df0142
Fix zFPKM Calculations (#238)
JoshLoecker Nov 3, 2025
bbb1187
Add Core zFPKM Tests (#239)
JoshLoecker Nov 3, 2025
e200897
Merge remote-tracking branch 'origin/develop' into develop
JoshLoecker Nov 3, 2025
ef5f7b3
chore: remove print statement
JoshLoecker Nov 3, 2025
500fc70
Fix FPKM calcualtion (#242)
JoshLoecker Feb 10, 2026
6e632c1
ScanPy Normalization (#243)
JoshLoecker Feb 10, 2026
5de7db0
Update Example Data (#244)
JoshLoecker Feb 10, 2026
d9601c7
Remove zFPKM (#245)
JoshLoecker Feb 10, 2026
aec97d8
Use `raise` instead of `log_and_raise` function (#247)
JoshLoecker Feb 12, 2026
36d1b1c
Update metadata files (#248)
JoshLoecker Mar 6, 2026
1bd400d
Remove `_log_and_raise_error` (#249)
JoshLoecker Mar 6, 2026
407219f
Refactor Pipelines (#251)
JoshLoecker Mar 6, 2026
6439d02
chore: remove unused code
JoshLoecker Mar 6, 2026
a5249ea
style: ruff formatting
JoshLoecker Mar 6, 2026
0a929b6
style: ruff formatting
JoshLoecker Mar 6, 2026
cac1c5c
chore: import required modules
JoshLoecker Mar 6, 2026
1b61e4e
refactor: enhance model validation functions and streamline glucose-r…
JoshLoecker Mar 6, 2026
ed45ea5
Merge branch 'main' of github.com:HelikarLab/COMO
JoshLoecker Mar 6, 2026
d46a136
feat: Merge branch 'main' into v2
JoshLoecker Mar 6, 2026
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
16 changes: 16 additions & 0 deletions .githooks/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -e

# Detect if COMO.ipynb exists in non-pushed git history
# If it does, clear its cell outputs before committing
NOTEBOOK="main/COMO.ipynb"
if git diff-tree --no-commit-id --name-only -r HEAD | grep -q "^$NOTEBOOK$"; then
jupyter-nbconvert --clear-output --inplace "$NOTEBOOK"

# re-commit if the notebook was changed
if ! git diff --quiet "$NOTEBOOK"; then
git add "$NOTEBOOK"
git commit -m "Clear outputs from jupyter notebook"
fi
fi
21 changes: 21 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e

# Run `ruff check` only on staged files
files=$(git diff --cached --name-only --diff-filter=ACM | grep '\.py$')
if [ -z "$files" ]; then
exit 0
fi
ruff check --no-fix "$files"
status=$?
if [ $status -ne 0 ]; then
echo "Ruff found issues. Commit aborted."
exit 1
fi

# If `ruff check` is good, then format all staged files
ruff check --fix --select I "$files"
ruff format "$files"


exit 0
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "hotfix"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
5 changes: 4 additions & 1 deletion .github/workflows/container_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ env:

jobs:
build-and-push-image:
# IMPORTANT: Only run the publish job when a tag starting with 'v' is pushed
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

name: Build and Push Docker Image
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
Expand Down
55 changes: 2 additions & 53 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,11 @@ on:
workflow_dispatch:

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Create Virtual Environment
run: uv venv

- name: Install Jupyter
run: uv pip install jupyter nbconvert

- name: Strip Notebook Output
run: uv run jupyter nbconvert --clear-output --inplace "main/COMO.ipynb"

- name: Format Python Imports
uses: astral-sh/ruff-action@v3
with:
args: "check --fix --select I"

- name: Format code
uses: astral-sh/ruff-action@v3
with:
args: "format"

- name: Format Notebook
uses: astral-sh/ruff-action@v3
with:
args: "format main/COMO.ipynb"

- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: format code, Jupyter Notebook(s), and Python imports with `ruff`"
file_pattern: "main/como/*.py"


lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check Lint
uses: astral-sh/ruff-action@v3
with:
args: "check --no-fix --verbose"

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ]
python-version: [ "3.11", "3.12", "3.13" ]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -78,7 +27,7 @@ jobs:
run: uv sync --python "${{ matrix.python-version }}" --all-extras --dev

- name: Run tests
run: uv run --python "${{ matrix.python-version }}" pytest --cov --junitxml=junit.xml -o junit_family=legacy
run: uv run --python "${{ matrix.python-version }}" pytest

- name: Cache Clear
run: uv cache prune --ci
92 changes: 92 additions & 0 deletions .github/workflows/pypackage_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build and publish python package

on:
push:
tags:
- "*"

# Define permissions needed for the workflow GITHUB_TOKEN
permissions:
contents: read # Allow checkout
packages: write # Allow publishing to GitHub Packages


jobs:
build:
strategy:
matrix:
operating-system: [macos-latest, ubuntu-latest, windows-latest]
python-version: [ 3.10, 3.11, 3.12, 3.13 ]

name: Build Python Package (${{ matrix.operating-system }}, Python ${{ matrix.python-version }})
runs-on: ${{ matrix.operating-system }}

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

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

- name: Install Hatch
run: pip install hatch

- name: Build distributions
run: hatch build # Uses pyproject.toml to build sdist and wheel into dist/

- name: Upload distributions artifact
uses: actions/upload-artifact@v4 # Action to save artifacts between jobs
with:
name: como-distribution-package-${{ matrix.operating-system }}-${{ matrix.python-version }} # Name for the artifact
path: dist/ # Path to the directory to upload

publish:
strategy:
matrix:
python-version: [ 3.10, 3.11, 3.12, 3.13 ]
operating-system: [macos-latest, windows-latest, ubuntu-latest]

name: Publish to GitHub Packages
runs-on: ubuntu-latest
needs: build # Depends on the build job succeeding

# IMPORTANT: Only run the publish job when a tag starting with 'v' is pushed
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')


permissions: # Explicit permissions needed for this job
packages: write # Required to write to GitHub Packages registry
contents: read # Needed if accessing repo content (e.g., for download artifact)

steps:
- name: Download distributions artifact
uses: actions/download-artifact@v4 # Action to retrieve artifacts from previous job.
with:
name: como-distribution-package-${{ matrix.operating-system }}-${{ matrix.python-version }}
path: dist/

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

- name: Install Twine
run: pip install twine

- name: Publish package to GitHub Packages
env:
# Use __token__ as username and the automatically generated GITHUB_TOKEN as password
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Uploading to GitHub Packages for repository: ${{ github.repository }}"
# Construct the repository URL dynamically using the repository owner
TWINE_REPOSITORY_URL="https://pypi.pkg.github.com/${{ github.repository_owner }}"
python -m twine upload --verbose --repository-url ${TWINE_REPOSITORY_URL} dist/*



10 changes: 4 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/opensource-nepal/commitlint
rev: v1.2.0
- repo: https://github.com/commitizen-tools/commitizen
rev: master
hooks:
- id: commitlint
name: Commit Lint
- id: commitizen
stages: [ commit-msg ]
Loading