Skip to content

Commit

Permalink
Merge pull request #7 from h-0-0/h-0-0-dev
Browse files Browse the repository at this point in the history
Refining badge
  • Loading branch information
h-0-0 authored Nov 27, 2023
2 parents e3eb8f6 + 6882a2c commit 2186abc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,37 @@ jobs:
- name: Test with pytest and create coverage report
run: |
pytest --cov-report term-missing --cov=src tests/ > coverage_report.txt
cd $GITHUB_WORKSPACE
pwd
coverage run --module pytest --verbose && coverage report --show-missing > coverage_report.txt
- name: Extract coverage percentage
id: extract-coverage
run: |
pwd
ls
less coverage_report.txt
COVERAGE_PERCENTAGE=$(grep -oP 'TOTAL.*?\K\d+(?=%)' coverage_report.txt)
echo "::set-output name=coverage::$COVERAGE_PERCENTAGE"
- name: Determine badge color
id: determine-color
run: |
echo "COVERAGE=${{ steps.extract-coverage.outputs.coverage }}"
if [ $(echo "${{ steps.extract-coverage.outputs.coverage }} < 70" | bc -l) -eq 1 ]; then
echo "::set-output name=color::red"
elif [ $(echo "${{ steps.extract-coverage.outputs.coverage }} < 90" | bc -l) -eq 1 ]; then
echo "::set-output name=color::yellow"
else
echo "::set-output name=color::green"
fi
- name: Create Coverage Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: 4aa01e058fee448070c587f6967037e4
filename: CodeCovSlune.json # Use test.svg if you want to use the SVG mode.
label: CodeCov
message: "Coverage: ${{ steps.extract-coverage.outputs.coverage }}%"
color: orange
label: Coverage
message: "${{ steps.extract-coverage.outputs.coverage }}%"
color: ${{ steps.determine-color.outputs.color }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,8 @@ cython_debug/
#.idea/

# Don't include vs code settings
.vscode
.vscode

# Don't include coverage reports
.coverage
coverage_report*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


# slune (= slurm + tune!)
A super simplistic way to perform hyperparameter tuning (or more generally launch jobs and save results) on a cluster using SLURM. Takes advantage of the fact that lots of jobs (including hyperparameter tuning) are embarrassingly parallel! With slune you can divide your compute into lots of separately scheduled jobs meaning that each small job can get running on your cluster more quickly, speeding up your workflow! Often significantly!
A super simplistic python package for performing hyperparameter tuning (or more generally launching jobs and saving results) on a cluster using SLURM. Takes advantage of the fact that lots of jobs (including hyperparameter tuning) are embarrassingly parallel! With slune you can divide your compute into lots of separately scheduled jobs meaning that each small job can get running on your cluster more quickly, speeding up your workflow! Often significantly!

Slune is super-easy to use! We have helper functions which can execute everything you need done for you. Letting you speed up your work without wasting time.

Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ addopts = "-ra -q"
python_classes = ["Test", "Describe"]
python_functions = ["test_", "it_", "and_", "but_", "they_"]
python_files = ["test_*.py",]
testpaths = ["tests", "integration"]
testpaths = ["tests", "integration"]

[tool.coverage.run]
source = ["src/slune"] # Adjust this to match your package source path
branch = true
omit = ["tests/*", "integration/*"] # Adjust as needed

0 comments on commit 2186abc

Please sign in to comment.