calpit 0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. calpit-0.1/.copier-answers.yml +24 -0
  2. calpit-0.1/.git_archival.txt +4 -0
  3. calpit-0.1/.gitattributes +24 -0
  4. calpit-0.1/.github/ISSUE_TEMPLATE/0-general_issue.md +8 -0
  5. calpit-0.1/.github/ISSUE_TEMPLATE/1-bug_report.md +17 -0
  6. calpit-0.1/.github/ISSUE_TEMPLATE/2-feature_request.md +18 -0
  7. calpit-0.1/.github/dependabot.yml +10 -0
  8. calpit-0.1/.github/pull_request_template.md +63 -0
  9. calpit-0.1/.github/workflows/asv-main.yml +101 -0
  10. calpit-0.1/.github/workflows/asv-nightly.yml +93 -0
  11. calpit-0.1/.github/workflows/asv-pr.yml +86 -0
  12. calpit-0.1/.github/workflows/build-documentation.yml +38 -0
  13. calpit-0.1/.github/workflows/pre-commit-ci.yml +35 -0
  14. calpit-0.1/.github/workflows/publish-benchmarks-pr.yml +53 -0
  15. calpit-0.1/.github/workflows/publish-to-pypi.yml +37 -0
  16. calpit-0.1/.github/workflows/smoke-test.yml +42 -0
  17. calpit-0.1/.github/workflows/testing-and-coverage.yml +38 -0
  18. calpit-0.1/.gitignore +156 -0
  19. calpit-0.1/.pre-commit-config.yaml +148 -0
  20. calpit-0.1/.readthedocs.yml +22 -0
  21. calpit-0.1/.setup_dev.sh +42 -0
  22. calpit-0.1/LICENSE +21 -0
  23. calpit-0.1/PKG-INFO +56 -0
  24. calpit-0.1/README.md +10 -0
  25. calpit-0.1/benchmarks/__init__.py +0 -0
  26. calpit-0.1/benchmarks/asv.conf.json +80 -0
  27. calpit-0.1/benchmarks/benchmarks.py +16 -0
  28. calpit-0.1/docker/Dockerfile +29 -0
  29. calpit-0.1/docker/build_image.sh +4 -0
  30. calpit-0.1/docs/Makefile +31 -0
  31. calpit-0.1/docs/conf.py +58 -0
  32. calpit-0.1/docs/index.rst +50 -0
  33. calpit-0.1/docs/notebooks/README.md +1 -0
  34. calpit-0.1/docs/notebooks/intro_notebook.ipynb +84 -0
  35. calpit-0.1/docs/notebooks.rst +6 -0
  36. calpit-0.1/docs/requirements.txt +10 -0
  37. calpit-0.1/pyproject.toml +108 -0
  38. calpit-0.1/setup.cfg +4 -0
  39. calpit-0.1/src/.pylintrc +626 -0
  40. calpit-0.1/src/calpit/__init__.py +9 -0
  41. calpit-0.1/src/calpit/_version.py +16 -0
  42. calpit-0.1/src/calpit/datasets.py +0 -0
  43. calpit-0.1/src/calpit/diagnostics_and_calibration.py +305 -0
  44. calpit-0.1/src/calpit/example_benchmarks.py +14 -0
  45. calpit-0.1/src/calpit/metrics.py +150 -0
  46. calpit-0.1/src/calpit/nn/__init__.py +2 -0
  47. calpit-0.1/src/calpit/nn/ispline_nn.py +102 -0
  48. calpit-0.1/src/calpit/nn/models.py +52 -0
  49. calpit-0.1/src/calpit/nn/umnn/MonotonicNN.py +82 -0
  50. calpit-0.1/src/calpit/nn/umnn/NeuralIntegral.py +88 -0
  51. calpit-0.1/src/calpit/nn/umnn/ParallelNeuralIntegral.py +99 -0
  52. calpit-0.1/src/calpit/nn/umnn/__init__.py +3 -0
  53. calpit-0.1/src/calpit/nn/utils.py +162 -0
  54. calpit-0.1/src/calpit/py.typed +0 -0
  55. calpit-0.1/src/calpit/utils.py +146 -0
  56. calpit-0.1/src/calpit.egg-info/PKG-INFO +56 -0
  57. calpit-0.1/src/calpit.egg-info/SOURCES.txt +61 -0
  58. calpit-0.1/src/calpit.egg-info/dependency_links.txt +1 -0
  59. calpit-0.1/src/calpit.egg-info/requires.txt +10 -0
  60. calpit-0.1/src/calpit.egg-info/top_level.txt +1 -0
  61. calpit-0.1/tests/.pylintrc +627 -0
  62. calpit-0.1/tests/calpit/conftest.py +0 -0
  63. calpit-0.1/tests/calpit/test_example_module.py +13 -0
@@ -0,0 +1,24 @@
1
+ # Changes here will be overwritten by Copier
2
+ _commit: v2.0.1
3
+ _src_path: gh:lincc-frameworks/python-project-template
4
+ author_email: biprateep@pitt.edu
5
+ author_name: Biprateep Dey
6
+ create_example_module: true
7
+ custom_install: true
8
+ enforce_style:
9
+ - pylint
10
+ - black
11
+ - isort
12
+ failure_notification: []
13
+ include_benchmarks: true
14
+ include_docs: true
15
+ include_notebooks: true
16
+ mypy_type_checking: basic
17
+ package_name: calpit
18
+ project_license: MIT
19
+ project_name: calpit
20
+ project_organization: lee-group-cmu
21
+ python_versions:
22
+ - '3.10'
23
+ - '3.11'
24
+ - '3.12'
@@ -0,0 +1,4 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4
+ ref-names: $Format:%D$
@@ -0,0 +1,24 @@
1
+ # For explanation of this file and uses see
2
+ # https://git-scm.com/docs/gitattributes
3
+ # https://developer.lsst.io/git/git-lfs.html#using-git-lfs-enabled-repositories
4
+ # https://lincc-ppt.readthedocs.io/en/latest/practices/git-lfs.html
5
+ #
6
+ # Used by https://github.com/lsst/afwdata.git
7
+ # *.boost filter=lfs diff=lfs merge=lfs -text
8
+ # *.dat filter=lfs diff=lfs merge=lfs -text
9
+ # *.fits filter=lfs diff=lfs merge=lfs -text
10
+ # *.gz filter=lfs diff=lfs merge=lfs -text
11
+ #
12
+ # apache parquet files
13
+ # *.parq filter=lfs diff=lfs merge=lfs -text
14
+ #
15
+ # sqlite files
16
+ # *.sqlite3 filter=lfs diff=lfs merge=lfs -text
17
+ #
18
+ # gzip files
19
+ # *.gz filter=lfs diff=lfs merge=lfs -text
20
+ #
21
+ # png image files
22
+ # *.png filter=lfs diff=lfs merge=lfs -text
23
+
24
+ .git_archival.txt export-subst
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: General issue
3
+ about: Quickly create a general issue
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: Bug report
3
+ about: Tell us about a problem to fix
4
+ title: 'Short description'
5
+ labels: 'bug'
6
+ assignees: ''
7
+
8
+ ---
9
+ **Bug report**
10
+
11
+
12
+ **Before submitting**
13
+ Please check the following:
14
+
15
+ - [ ] I have described the situation in which the bug arose, including what code was executed, information about my environment, and any applicable data others will need to reproduce the problem.
16
+ - [ ] I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a descriprion of what I expected instead.
17
+ - [ ] If I have a solution in mind, I have provided an explanation and/or pseudocode and/or task list.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: 'Short description'
5
+ labels: 'enhancement'
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Feature request**
11
+
12
+
13
+ **Before submitting**
14
+ Please check the following:
15
+
16
+ - [ ] I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves.
17
+ - [ ] I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality.
18
+ - [ ] If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps.
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
7
+ - package-ecosystem: "pip"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "monthly"
@@ -0,0 +1,63 @@
1
+ <!--
2
+ Thank you for your contribution to the repo :)
3
+
4
+ Pull Request (PR) Instructions:
5
+ Provide a general summary of your changes in the Title above. Fill out each section of the template, and replace the space with an `x` in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help! Once you are satisfied with the pull request, click the "Create pull request" button to submit it for review.
6
+
7
+ Before submitting this PR, please ensure that your input and responses are entered in the designated space provided below each section to keep all project-related information organized and easily accessible.
8
+
9
+ How to link to a PR:
10
+ https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
11
+ -->
12
+
13
+ ## Change Description
14
+ <!---
15
+ Describe your changes in detail. In your description, you should answer questions like "Why is this change required? What problem does it solve?".
16
+
17
+ If it fixes an open issue, please link to the issue here. If this PR closes an issue, put the word 'closes' before the issue link to auto-close the issue when the PR is merged.
18
+ -->
19
+ - [ ] My PR includes a link to the issue that I am addressing
20
+
21
+
22
+
23
+ ## Solution Description
24
+ <!-- Please explain the technical solution that I have provided and how it addresses the issue or feature being implemented -->
25
+
26
+
27
+
28
+ ## Code Quality
29
+ - [ ] I have read the Contribution Guide
30
+ - [ ] My code follows the code style of this project
31
+ - [ ] My code builds (or compiles) cleanly without any errors or warnings
32
+ - [ ] My code contains relevant comments and necessary documentation
33
+
34
+ ## Project-Specific Pull Request Checklists
35
+ <!--- Please only use the checklist that apply to your change type(s) -->
36
+
37
+ ### Bug Fix Checklist
38
+ - [ ] My fix includes a new test that breaks as a result of the bug (if possible)
39
+ - [ ] My change includes a breaking change
40
+ - [ ] My change includes backwards compatibility and deprecation warnings (if possible)
41
+
42
+ ### New Feature Checklist
43
+ - [ ] I have added or updated the docstrings associated with my feature using the [NumPy docstring format](https://numpydoc.readthedocs.io/en/latest/format.html)
44
+ - [ ] I have updated the tutorial to highlight my new feature (if appropriate)
45
+ - [ ] I have added unit/End-to-End (E2E) test cases to cover my new feature
46
+ - [ ] My change includes a breaking change
47
+ - [ ] My change includes backwards compatibility and deprecation warnings (if possible)
48
+
49
+ ### Documentation Change Checklist
50
+ - [ ] Any updated docstrings use the [NumPy docstring format](https://numpydoc.readthedocs.io/en/latest/format.html)
51
+
52
+ ### Build/CI Change Checklist
53
+ - [ ] If required or optional dependencies have changed (including version numbers), I have updated the README to reflect this
54
+ - [ ] If this is a new CI setup, I have added the associated badge to the README
55
+
56
+ <!-- ### Version Change Checklist [For Future Use] -->
57
+
58
+ ### Other Change Checklist
59
+ - [ ] Any new or updated docstrings use the [NumPy docstring format](https://numpydoc.readthedocs.io/en/latest/format.html).
60
+ - [ ] I have updated the tutorial to highlight my new feature (if appropriate)
61
+ - [ ] I have added unit/End-to-End (E2E) test cases to cover any changes
62
+ - [ ] My change includes a breaking change
63
+ - [ ] My change includes backwards compatibility and deprecation warnings (if possible)
@@ -0,0 +1,101 @@
1
+ # This workflow will run benchmarks with airspeed velocity (asv),
2
+ # store the new results in the "benchmarks" branch and publish them
3
+ # to a dashboard on GH Pages.
4
+
5
+ name: Run ASV benchmarks for main
6
+
7
+ on:
8
+ push:
9
+ branches: [ main ]
10
+
11
+ env:
12
+ PYTHON_VERSION: "3.10"
13
+ WORKING_DIR: ${{ github.workspace }}/benchmarks
14
+
15
+ concurrency:
16
+ group: ${{ github.workflow }}-${{ github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+
21
+ setup-python:
22
+ runs-on: ubuntu-latest
23
+
24
+ steps:
25
+ - name: Cache Python ${{ env.PYTHON_VERSION }}
26
+ uses: actions/cache@v4
27
+ with:
28
+ path: ~/.cache/pip
29
+ key: python-${{ env.PYTHON_VERSION }}
30
+
31
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: "${{ env.PYTHON_VERSION }}"
35
+
36
+ asv-main:
37
+ runs-on: ubuntu-latest
38
+ needs: setup-python
39
+
40
+ permissions:
41
+ contents: write
42
+
43
+ defaults:
44
+ run:
45
+ working-directory: ${{ env.WORKING_DIR }}
46
+
47
+ steps:
48
+ - name: Checkout main branch of the repository
49
+ uses: actions/checkout@v4
50
+ with:
51
+ fetch-depth: 0
52
+
53
+ - name: Cache Python ${{ env.PYTHON_VERSION }}
54
+ uses: actions/cache@v4
55
+ with:
56
+ path: ~/.cache/pip
57
+ key: python-${{ env.PYTHON_VERSION }}
58
+
59
+ - name: Install dependencies
60
+ run: |
61
+ sudo apt-get update
62
+ python -m pip install --upgrade pip
63
+ pip install asv==0.6.1 virtualenv tabulate
64
+
65
+ - name: Configure git
66
+ run: |
67
+ git config user.name "github-actions[bot]"
68
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
69
+
70
+ - name: Create ASV machine config file
71
+ run: asv machine --machine gh-runner --yes
72
+
73
+ - name: Fetch previous results from the "benchmarks" branch
74
+ run: |
75
+ if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
76
+ git merge origin/benchmarks \
77
+ --allow-unrelated-histories \
78
+ --no-commit
79
+ mv ../_results .
80
+ fi
81
+
82
+ - name: Run ASV for the main branch
83
+ run: asv run ALL --skip-existing --verbose || true
84
+
85
+ - name: Submit new results to the "benchmarks" branch
86
+ uses: JamesIves/github-pages-deploy-action@v4
87
+ with:
88
+ branch: benchmarks
89
+ folder: ${{ env.WORKING_DIR }}/_results
90
+ target-folder: _results
91
+
92
+ - name: Generate dashboard HTML
93
+ run: |
94
+ asv show
95
+ asv publish
96
+
97
+ - name: Deploy to Github pages
98
+ uses: JamesIves/github-pages-deploy-action@v4
99
+ with:
100
+ branch: gh-pages
101
+ folder: ${{ env.WORKING_DIR }}/_html
@@ -0,0 +1,93 @@
1
+ # This workflow will run daily at 06:45.
2
+ # It will run benchmarks with airspeed velocity (asv)
3
+ # and compare performance with the previous nightly build.
4
+
5
+ name: Run benchmarks nightly job
6
+
7
+ on:
8
+ schedule:
9
+ - cron: 45 6 * * *
10
+ workflow_dispatch:
11
+
12
+ env:
13
+ PYTHON_VERSION: "3.10"
14
+ WORKING_DIR: ${{ github.workspace }}/benchmarks
15
+ NIGHTLY_HASH_FILE: nightly-hash
16
+
17
+ jobs:
18
+
19
+ asv-nightly:
20
+ runs-on: ubuntu-latest
21
+
22
+ defaults:
23
+ run:
24
+ working-directory: ${{ env.WORKING_DIR }}
25
+
26
+ steps:
27
+ - name: Checkout main branch of the repository
28
+ uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 0
31
+
32
+ - name: Cache Python ${{ env.PYTHON_VERSION }}
33
+ uses: actions/cache@v4
34
+ with:
35
+ path: ~/.cache/pip
36
+ key: python-${{ env.PYTHON_VERSION }}
37
+
38
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
39
+ uses: actions/setup-python@v5
40
+ with:
41
+ python-version: "${{ env.PYTHON_VERSION }}"
42
+
43
+ - name: Install dependencies
44
+ run: |
45
+ sudo apt-get update
46
+ python -m pip install --upgrade pip
47
+ pip install asv==0.6.1 virtualenv
48
+
49
+ - name: Configure git
50
+ run: |
51
+ git config user.name "github-actions[bot]"
52
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
53
+
54
+ - name: Create ASV machine config file
55
+ run: asv machine --machine gh-runner --yes
56
+
57
+ - name: Fetch previous results from the "benchmarks" branch
58
+ run: |
59
+ if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
60
+ git merge origin/benchmarks \
61
+ --allow-unrelated-histories \
62
+ --no-commit
63
+ mv ../_results .
64
+ fi
65
+
66
+ - name: Get nightly dates under comparison
67
+ id: nightly-dates
68
+ run: |
69
+ echo "yesterday=$(date -d yesterday +'%Y-%m-%d')" >> $GITHUB_OUTPUT
70
+ echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
71
+
72
+ - name: Use last nightly commit hash from cache
73
+ uses: actions/cache@v4
74
+ with:
75
+ path: ${{ env.WORKING_DIR }}
76
+ key: nightly-results-${{ steps.nightly-dates.outputs.yesterday }}
77
+
78
+ - name: Run comparison of main against last nightly build
79
+ run: |
80
+ HASH_FILE=${{ env.NIGHTLY_HASH_FILE }}
81
+ CURRENT_HASH=${{ github.sha }}
82
+ if [ -f $HASH_FILE ]; then
83
+ PREV_HASH=$(cat $HASH_FILE)
84
+ asv continuous $PREV_HASH $CURRENT_HASH --verbose || true
85
+ asv compare $PREV_HASH $CURRENT_HASH --sort ratio --verbose
86
+ fi
87
+ echo $CURRENT_HASH > $HASH_FILE
88
+
89
+ - name: Update last nightly hash in cache
90
+ uses: actions/cache@v4
91
+ with:
92
+ path: ${{ env.WORKING_DIR }}
93
+ key: nightly-results-${{ steps.nightly-dates.outputs.today }}
@@ -0,0 +1,86 @@
1
+ # This workflow will run benchmarks with airspeed velocity (asv) for pull requests.
2
+ # It will compare the performance of the main branch with the performance of the merge
3
+ # with the new changes. It then publishes a comment with this assessment by triggering
4
+ # the publish-benchmarks-pr workflow.
5
+ # Based on https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
6
+ name: Run benchmarks for PR
7
+
8
+ on:
9
+ pull_request:
10
+ branches: [ main ]
11
+ workflow_dispatch:
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ env:
18
+ PYTHON_VERSION: "3.10"
19
+ WORKING_DIR: ${{ github.workspace }}/benchmarks
20
+ ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
21
+
22
+ jobs:
23
+ setup-python:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Cache Python ${{ env.PYTHON_VERSION }}
27
+ uses: actions/cache@v4
28
+ with:
29
+ path: ~/.cache/pip
30
+ key: python-${{ env.PYTHON_VERSION }}
31
+ - name: Set up Python ${{ env.PYTHON_VERSION }}
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: ${{ env.PYTHON_VERSION }}
35
+ asv-pr:
36
+ runs-on: ubuntu-latest
37
+ needs: setup-python
38
+ defaults:
39
+ run:
40
+ working-directory: ${{ env.WORKING_DIR }}
41
+ steps:
42
+ - name: Checkout PR branch of the repository
43
+ uses: actions/checkout@v4
44
+ with:
45
+ fetch-depth: 0
46
+ - name: Display Workflow Run Information
47
+ run: |
48
+ echo "Workflow Run ID: ${{ github.run_id }}"
49
+ - name: Cache Python ${{ env.PYTHON_VERSION }}
50
+ uses: actions/cache@v4
51
+ with:
52
+ path: ~/.cache/pip
53
+ key: python-${{ env.PYTHON_VERSION }}
54
+ - name: Install dependencies
55
+ run: |
56
+ sudo apt-get update
57
+ python -m pip install --upgrade pip
58
+ pip install asv==0.6.1 virtualenv tabulate lf-asv-formatter
59
+ - name: Make artifacts directory
60
+ run: mkdir -p ${{ env.ARTIFACTS_DIR }}
61
+ - name: Save pull request number
62
+ run: echo ${{ github.event.pull_request.number }} > ${{ env.ARTIFACTS_DIR }}/pr
63
+ - name: Get current job logs URL
64
+ uses: Tiryoh/gha-jobid-action@v1
65
+ id: jobs
66
+ with:
67
+ github_token: ${{ secrets.GITHUB_TOKEN }}
68
+ job_name: ${{ github.job }}
69
+ - name: Create ASV machine config file
70
+ run: asv machine --machine gh-runner --yes
71
+ - name: Save comparison of PR against main branch
72
+ run: |
73
+ git remote add upstream https://github.com/${{ github.repository }}.git
74
+ git fetch upstream
75
+ asv continuous upstream/main HEAD --verbose || true
76
+ asv compare upstream/main HEAD --sort ratio --verbose | tee output
77
+ python -m lf_asv_formatter --asv_version "$(echo asv --version)"
78
+ printf "\n\nClick [here]($STEP_URL) to view all benchmarks." >> output
79
+ mv output ${{ env.ARTIFACTS_DIR }}
80
+ env:
81
+ STEP_URL: "${{ steps.jobs.outputs.html_url }}#step:11:1"
82
+ - name: Upload artifacts (PR number and benchmarks output)
83
+ uses: actions/upload-artifact@v4
84
+ with:
85
+ name: benchmark-artifacts
86
+ path: ${{ env.ARTIFACTS_DIR }}
@@ -0,0 +1,38 @@
1
+ # This workflow will install Python dependencies, build the package and then build the documentation.
2
+
3
+ name: Build documentation
4
+
5
+
6
+ on:
7
+ push:
8
+ branches: [ main ]
9
+ pull_request:
10
+ branches: [ main ]
11
+
12
+ concurrency:
13
+ group: ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ build:
18
+
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - name: Set up Python 3.10
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: '3.10'
27
+ - name: Install dependencies
28
+ run: |
29
+ sudo apt-get update
30
+ python -m pip install --upgrade pip
31
+ if [ -f docs/requirements.txt ]; then pip install -r docs/requirements.txt; fi
32
+ pip install .
33
+ - name: Install notebook requirements
34
+ run: |
35
+ sudo apt-get install pandoc
36
+ - name: Build docs
37
+ run: |
38
+ sphinx-build -T -E -b html -d docs/build/doctrees ./docs docs/build/html
@@ -0,0 +1,35 @@
1
+ # This workflow runs pre-commit hooks on pushes and pull requests to main
2
+ # to enforce coding style. To ensure correct configuration, please refer to:
3
+ # https://lincc-ppt.readthedocs.io/en/latest/practices/ci_precommit.html
4
+ name: Run pre-commit hooks
5
+
6
+ on:
7
+ push:
8
+ branches: [ main ]
9
+ pull_request:
10
+ branches: [ main ]
11
+
12
+ jobs:
13
+ pre-commit-ci:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: '3.10'
23
+ - name: Install dependencies
24
+ run: |
25
+ sudo apt-get update
26
+ python -m pip install --upgrade pip
27
+ pip install .[dev]
28
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29
+ - uses: pre-commit/action@v3.0.1
30
+ with:
31
+ extra_args: --all-files --verbose
32
+ env:
33
+ SKIP: "check-lincc-frameworks-template-version,no-commit-to-branch,check-added-large-files,validate-pyproject,sphinx-build,pytest-check"
34
+ - uses: pre-commit-ci/lite-action@v1.0.2
35
+ if: failure() && github.event_name == 'pull_request' && github.event.pull_request.draft == false
@@ -0,0 +1,53 @@
1
+ # This workflow publishes a benchmarks comment on a pull request. It is triggered after the
2
+ # benchmarks are computed in the asv-pr workflow. This separation of concerns allows us limit
3
+ # access to the target repository private tokens and secrets, increasing the level of security.
4
+ # Based on https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
5
+ name: Publish benchmarks comment to PR
6
+
7
+ on:
8
+ workflow_run:
9
+ workflows: ["Run benchmarks for PR"]
10
+ types: [completed]
11
+
12
+ jobs:
13
+ upload-pr-comment:
14
+ runs-on: ubuntu-latest
15
+ if: >
16
+ github.event.workflow_run.event == 'pull_request' &&
17
+ github.event.workflow_run.conclusion == 'success'
18
+ permissions:
19
+ issues: write
20
+ pull-requests: write
21
+ steps:
22
+ - name: Display Workflow Run Information
23
+ run: |
24
+ echo "Workflow Run ID: ${{ github.event.workflow_run.id }}"
25
+ echo "Head SHA: ${{ github.event.workflow_run.head_sha }}"
26
+ echo "Head Branch: ${{ github.event.workflow_run.head_branch }}"
27
+ echo "Conclusion: ${{ github.event.workflow_run.conclusion }}"
28
+ echo "Event: ${{ github.event.workflow_run.event }}"
29
+ - name: Download artifact
30
+ uses: dawidd6/action-download-artifact@v3
31
+ with:
32
+ name: benchmark-artifacts
33
+ run_id: ${{ github.event.workflow_run.id }}
34
+ - name: Extract artifacts information
35
+ id: pr-info
36
+ run: |
37
+ printf "PR number: $(cat pr)\n"
38
+ printf "Output:\n$(cat output)"
39
+ printf "pr=$(cat pr)" >> $GITHUB_OUTPUT
40
+ - name: Find benchmarks comment
41
+ uses: peter-evans/find-comment@v3
42
+ id: find-comment
43
+ with:
44
+ issue-number: ${{ steps.pr-info.outputs.pr }}
45
+ comment-author: 'github-actions[bot]'
46
+ body-includes: view all benchmarks
47
+ - name: Create or update benchmarks comment
48
+ uses: peter-evans/create-or-update-comment@v4
49
+ with:
50
+ comment-id: ${{ steps.find-comment.outputs.comment-id }}
51
+ issue-number: ${{ steps.pr-info.outputs.pr }}
52
+ body-path: output
53
+ edit-mode: replace
@@ -0,0 +1,37 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://github.com/pypa/gh-action-pypi-publish#trusted-publishing
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ deploy:
20
+
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ id-token: write
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - name: Set up Python
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version: '3.10'
30
+ - name: Install dependencies
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ pip install build
34
+ - name: Build package
35
+ run: python -m build
36
+ - name: Publish package
37
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,42 @@
1
+ # This workflow will run daily at 06:45.
2
+ # It will install Python dependencies and run tests with a variety of Python versions.
3
+ # See documentation for help debugging smoke test issues:
4
+ # https://lincc-ppt.readthedocs.io/en/latest/practices/ci_testing.html#version-culprit
5
+
6
+ name: Unit test smoke test
7
+
8
+ on:
9
+
10
+ # Runs this workflow automatically
11
+ schedule:
12
+ - cron: 45 6 * * *
13
+
14
+ # Allows you to run this workflow manually from the Actions tab
15
+ workflow_dispatch:
16
+
17
+ jobs:
18
+ build:
19
+
20
+ runs-on: ubuntu-latest
21
+ strategy:
22
+ matrix:
23
+ python-version: ['3.10', '3.11', '3.12']
24
+
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+ - name: Install dependencies
32
+ run: |
33
+ sudo apt-get update
34
+ python -m pip install --upgrade pip
35
+ pip install -e .[dev]
36
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
37
+ - name: List dependencies
38
+ run: |
39
+ pip list
40
+ - name: Run unit tests with pytest
41
+ run: |
42
+ python -m pytest