Added Apache License reference comments to source files + CI bash script check
Several sbi source-code files were found missing the disclaimer of sbi's Apache Licence.
# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
This PR simply adds these two commented lines at the very start of all python files who were missing them, specifically all python files under tests/ and sbi/ directories.
I hope opening a PR directly rather than passing through an Issue was the right choice, as the modifications are trivial.
I also assume this was a desired feature: if there was a specific reason why these files did not report those two commented lines, I can close the PR without affecting the codebase.
I've also run a [fast, CPU-only] pytest locally to double-check everything is still working. No fails arised (except of expected fails XFAIL).
Edit: Furthermore, a bash script, which checks if effectively these two lines are reported as headers of all python files, was inserted in the CI workflow for GitHub. The script run just before setting up Python for pytests (took here as reference as advised by @michaeldeistler ).
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Please upload report for BASE (
main@196c106). Learn more about missing BASE report. Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1599 +/- ##
=======================================
Coverage ? 82.27%
=======================================
Files ? 134
Lines ? 10756
Branches ? 0
=======================================
Hits ? 8849
Misses ? 1907
Partials ? 0
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 82.27% <ø> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| sbi/__init__.py | 100.00% <ø> (ø) |
|
| sbi/analysis/__init__.py | 100.00% <ø> (ø) |
|
| sbi/diagnostics/__init__.py | 100.00% <ø> (ø) |
|
| sbi/diagnostics/tarp.py | 81.81% <ø> (ø) |
|
| sbi/inference/__init__.py | 100.00% <ø> (ø) |
|
| sbi/inference/abc/__init__.py | 100.00% <ø> (ø) |
|
| sbi/inference/posteriors/__init__.py | 100.00% <ø> (ø) |
|
| sbi/inference/potentials/__init__.py | 100.00% <ø> (ø) |
|
| .../inference/potentials/posterior_based_potential.py | 84.00% <ø> (ø) |
|
| sbi/inference/potentials/score_fn_iid.py | 88.62% <ø> (ø) |
|
| ... and 36 more |
Cool! We could also have a github workflow that checks this, as, for example, here.
Cool! We could also have a github workflow that checks this, as, for example, here.
@nMaax would you be up for adding something like this to the sbi CI workflow, or create an issue for it?
@janfb yep sure :+1:, will do it asap when I am able to open my laptop, so most probably this evening or tomorrow
Hi @janfb sorry for responding so late, found just now tho the task was actually fast to solve. Hope it is ok now, let me know! :)