science-catalogs 0.1.0b2__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 (86) hide show
  1. science_catalogs-0.1.0b2/.copier-answers.yml +24 -0
  2. science_catalogs-0.1.0b2/.git_archival.txt +4 -0
  3. science_catalogs-0.1.0b2/.gitattributes +24 -0
  4. science_catalogs-0.1.0b2/.github/ISSUE_TEMPLATE/0-general_issue.md +8 -0
  5. science_catalogs-0.1.0b2/.github/ISSUE_TEMPLATE/1-bug_report.md +30 -0
  6. science_catalogs-0.1.0b2/.github/ISSUE_TEMPLATE/2-feature_request.md +18 -0
  7. science_catalogs-0.1.0b2/.github/ISSUE_TEMPLATE/README.md +9 -0
  8. science_catalogs-0.1.0b2/.github/dependabot.yml +10 -0
  9. science_catalogs-0.1.0b2/.github/pull_request_template.md +13 -0
  10. science_catalogs-0.1.0b2/.github/workflows/README.md +9 -0
  11. science_catalogs-0.1.0b2/.github/workflows/asv-main.yml +68 -0
  12. science_catalogs-0.1.0b2/.github/workflows/asv-nightly.yml +72 -0
  13. science_catalogs-0.1.0b2/.github/workflows/asv-pr.yml +70 -0
  14. science_catalogs-0.1.0b2/.github/workflows/build-documentation.yml +41 -0
  15. science_catalogs-0.1.0b2/.github/workflows/pre-commit-ci.yml +37 -0
  16. science_catalogs-0.1.0b2/.github/workflows/publish-benchmarks-pr.yml +53 -0
  17. science_catalogs-0.1.0b2/.github/workflows/publish-to-pypi.yml +39 -0
  18. science_catalogs-0.1.0b2/.github/workflows/smoke-test.yml +43 -0
  19. science_catalogs-0.1.0b2/.github/workflows/testing-and-coverage.yml +40 -0
  20. science_catalogs-0.1.0b2/.gitignore +151 -0
  21. science_catalogs-0.1.0b2/.pre-commit-config.yaml +97 -0
  22. science_catalogs-0.1.0b2/.readthedocs.yml +24 -0
  23. science_catalogs-0.1.0b2/.setup_dev.sh +51 -0
  24. science_catalogs-0.1.0b2/LICENSE +21 -0
  25. science_catalogs-0.1.0b2/PKG-INFO +176 -0
  26. science_catalogs-0.1.0b2/README.md +125 -0
  27. science_catalogs-0.1.0b2/benchmarks/README.md +12 -0
  28. science_catalogs-0.1.0b2/benchmarks/__init__.py +0 -0
  29. science_catalogs-0.1.0b2/benchmarks/asv.conf.json +81 -0
  30. science_catalogs-0.1.0b2/benchmarks/benchmarks.py +16 -0
  31. science_catalogs-0.1.0b2/docs/Makefile +31 -0
  32. science_catalogs-0.1.0b2/docs/conf.py +58 -0
  33. science_catalogs-0.1.0b2/docs/index.rst +69 -0
  34. science_catalogs-0.1.0b2/docs/notebooks/README.md +25 -0
  35. science_catalogs-0.1.0b2/docs/notebooks/intro_notebook.ipynb +84 -0
  36. science_catalogs-0.1.0b2/docs/notebooks.rst +6 -0
  37. science_catalogs-0.1.0b2/docs/pre_executed/README.md +16 -0
  38. science_catalogs-0.1.0b2/docs/quickstart.rst +50 -0
  39. science_catalogs-0.1.0b2/docs/requirements.txt +10 -0
  40. science_catalogs-0.1.0b2/examples/configs/des_dr2_mag_auto_dered.yml +114 -0
  41. science_catalogs-0.1.0b2/examples/configs/lsst_dp02_cmodel_mag_dered.yml +118 -0
  42. science_catalogs-0.1.0b2/examples/configs/lsst_dp1_cmodel_mag_dered.yml +121 -0
  43. science_catalogs-0.1.0b2/examples/demo_catalog/configs/demo_hats.yml +61 -0
  44. science_catalogs-0.1.0b2/examples/demo_catalog/configs/demo_parquet.yml +59 -0
  45. science_catalogs-0.1.0b2/examples/demo_catalog/data/input/demo_part_0.parquet +0 -0
  46. science_catalogs-0.1.0b2/examples/demo_catalog/data/input/demo_part_1.parquet +0 -0
  47. science_catalogs-0.1.0b2/examples/demo_catalog/demo_all.py +81 -0
  48. science_catalogs-0.1.0b2/examples/demo_catalog/output/.gitignore +2 -0
  49. science_catalogs-0.1.0b2/examples/notebooks/demo_notebook.ipynb +238 -0
  50. science_catalogs-0.1.0b2/pyproject.toml +125 -0
  51. science_catalogs-0.1.0b2/requirements-dev.txt +1 -0
  52. science_catalogs-0.1.0b2/requirements.txt +0 -0
  53. science_catalogs-0.1.0b2/setup.cfg +4 -0
  54. science_catalogs-0.1.0b2/src/science_catalogs/__init__.py +61 -0
  55. science_catalogs-0.1.0b2/src/science_catalogs/_version.py +24 -0
  56. science_catalogs-0.1.0b2/src/science_catalogs/catalog.py +263 -0
  57. science_catalogs-0.1.0b2/src/science_catalogs/cli.py +42 -0
  58. science_catalogs-0.1.0b2/src/science_catalogs/example_benchmarks.py +14 -0
  59. science_catalogs-0.1.0b2/src/science_catalogs/executor.py +41 -0
  60. science_catalogs-0.1.0b2/src/science_catalogs/processing.py +242 -0
  61. science_catalogs-0.1.0b2/src/science_catalogs/utils/__init__.py +1 -0
  62. science_catalogs-0.1.0b2/src/science_catalogs/utils/config.py +102 -0
  63. science_catalogs-0.1.0b2/src/science_catalogs/utils/dust.py +53 -0
  64. science_catalogs-0.1.0b2/src/science_catalogs/utils/io_readers.py +46 -0
  65. science_catalogs-0.1.0b2/src/science_catalogs/utils/partitioning.py +98 -0
  66. science_catalogs-0.1.0b2/src/science_catalogs/utils/writers.py +193 -0
  67. science_catalogs-0.1.0b2/src/science_catalogs.egg-info/PKG-INFO +176 -0
  68. science_catalogs-0.1.0b2/src/science_catalogs.egg-info/SOURCES.txt +84 -0
  69. science_catalogs-0.1.0b2/src/science_catalogs.egg-info/dependency_links.txt +1 -0
  70. science_catalogs-0.1.0b2/src/science_catalogs.egg-info/entry_points.txt +2 -0
  71. science_catalogs-0.1.0b2/src/science_catalogs.egg-info/requires.txt +31 -0
  72. science_catalogs-0.1.0b2/src/science_catalogs.egg-info/scm_file_list.json +79 -0
  73. science_catalogs-0.1.0b2/src/science_catalogs.egg-info/scm_version.json +8 -0
  74. science_catalogs-0.1.0b2/src/science_catalogs.egg-info/top_level.txt +1 -0
  75. science_catalogs-0.1.0b2/tests/data/README.md +41 -0
  76. science_catalogs-0.1.0b2/tests/data/des_dr2_sample_1000.fits +150 -0
  77. science_catalogs-0.1.0b2/tests/data/lsst_dp02_scrambled_sample_1000.parq +0 -0
  78. science_catalogs-0.1.0b2/tests/data/lsst_dp1_scrambled_sample_1000.parq +0 -0
  79. science_catalogs-0.1.0b2/tests/science_catalogs/conftest.py +0 -0
  80. science_catalogs-0.1.0b2/tests/science_catalogs/test_packaging.py +6 -0
  81. science_catalogs-0.1.0b2/tests/test_build_catalog.py +108 -0
  82. science_catalogs-0.1.0b2/tests/test_cli.py +40 -0
  83. science_catalogs-0.1.0b2/tests/test_config.py +39 -0
  84. science_catalogs-0.1.0b2/tests/test_example_configs.py +189 -0
  85. science_catalogs-0.1.0b2/tests/test_prepared_catalog.py +125 -0
  86. science_catalogs-0.1.0b2/tests/test_processing.py +75 -0
@@ -0,0 +1,24 @@
1
+ # Changes here will be overwritten by Copier
2
+ _commit: v2.2.0-15-ga7522ba
3
+ _src_path: gh:lincc-frameworks/python-project-template
4
+ author_email: ''
5
+ author_name: LIneA IT
6
+ create_example_module: false
7
+ custom_install: custom
8
+ enforce_style:
9
+ - ruff_lint
10
+ - ruff_format
11
+ failure_notification: []
12
+ include_benchmarks: true
13
+ include_docs: true
14
+ include_notebooks: true
15
+ mypy_type_checking: none
16
+ package_name: science_catalogs
17
+ project_description: Reusable toolkit for science-ready catalog preparation with Dask,
18
+ LSDB, and HATS.
19
+ project_license: MIT
20
+ project_name: science_catalogs
21
+ project_organization: linea-it
22
+ python_versions:
23
+ - '3.12'
24
+ test_lowest_version: none
@@ -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,30 @@
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
+ **Environment Information**
13
+
14
+
15
+ <details>
16
+ <summary>Traceback</summary>
17
+
18
+ ```
19
+ FILL IN YOUR STACK TRACE HERE
20
+ ```
21
+
22
+ </details>
23
+
24
+ **Before submitting**
25
+ Please check the following:
26
+
27
+ - [ ] I have described the situation in which the bug arose, including what code was executed, and any applicable data others will need to reproduce the problem.
28
+ - [ ] I have included information about my environment, including the version of this package (e.g. `science_catalogs.__version__`)
29
+ - [ ] I have included available evidence of the unexpected behavior (including error messages, screenshots, and/or plots) as well as a description of what I expected instead.
30
+ - [ ] 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,9 @@
1
+ # Configurations
2
+
3
+ Templates for various different issue types are defined in this directory
4
+ and a pull request template is defined as ``../pull_request_template.md``. Adding,
5
+ removing, and modifying these templates to suit the needs of your project is encouraged.
6
+
7
+ For more information about these templates, look here: https://lincc-ppt.readthedocs.io/en/latest/practices/issue_pr_templating.html
8
+
9
+ Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html
@@ -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,13 @@
1
+ ## Change Description
2
+ <!---
3
+ Closes #???
4
+ -->
5
+
6
+ ## Solution Description
7
+
8
+
9
+ ## Code Quality
10
+ - [ ] I have read the Contribution Guide and agree to the Code of Conduct
11
+ - [ ] My code follows the code style of this project
12
+ - [ ] My code builds (or compiles) cleanly without any errors or warnings
13
+ - [ ] My code contains relevant comments and necessary documentation
@@ -0,0 +1,9 @@
1
+ # Workflows
2
+
3
+ The .yml files in this directory are used to define the various continuous
4
+ integration scripts that will be run on your behalf e.g. nightly as a smoke check,
5
+ or when you create a new PR.
6
+
7
+ For more information about CI and workflows, look here: https://lincc-ppt.readthedocs.io/en/latest/practices/ci.html
8
+
9
+ Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html
@@ -0,0 +1,68 @@
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
+ name: Run ASV benchmarks for main
5
+
6
+ on:
7
+ push:
8
+ branches: [ main ]
9
+
10
+ env:
11
+ PYTHON_VERSION: "3.12"
12
+ ASV_VERSION: "0.6.5"
13
+ WORKING_DIR: ${{github.workspace}}/benchmarks
14
+
15
+ concurrency:
16
+ group: ${{github.workflow}}-${{github.ref}}
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+ asv-main:
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ contents: write
24
+ defaults:
25
+ run:
26
+ working-directory: ${{env.WORKING_DIR}}
27
+ steps:
28
+ - name: Set up Python ${{env.PYTHON_VERSION}}
29
+ uses: actions/setup-python@v6
30
+ with:
31
+ python-version: ${{env.PYTHON_VERSION}}
32
+ - name: Checkout main branch of the repository
33
+ uses: actions/checkout@v6
34
+ with:
35
+ fetch-depth: 0
36
+ - name: Install dependencies
37
+ run: pip install asv[virtualenv]==${{env.ASV_VERSION}}
38
+ - name: Configure git
39
+ run: |
40
+ git config user.name "github-actions[bot]"
41
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
42
+ - name: Create ASV machine config file
43
+ run: asv machine --machine gh-runner --yes
44
+ - name: Fetch previous results from the "benchmarks" branch
45
+ run: |
46
+ if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
47
+ git merge origin/benchmarks \
48
+ --allow-unrelated-histories \
49
+ --no-commit
50
+ mv ../_results .
51
+ fi
52
+ - name: Run ASV for the main branch
53
+ run: asv run ALL --skip-existing --verbose || true
54
+ - name: Submit new results to the "benchmarks" branch
55
+ uses: JamesIves/github-pages-deploy-action@v4
56
+ with:
57
+ branch: benchmarks
58
+ folder: ${{env.WORKING_DIR}}/_results
59
+ target-folder: _results
60
+ - name: Generate dashboard HTML
61
+ run: |
62
+ asv show
63
+ asv publish
64
+ - name: Deploy to Github pages
65
+ uses: JamesIves/github-pages-deploy-action@v4
66
+ with:
67
+ branch: gh-pages
68
+ folder: ${{env.WORKING_DIR}}/_html
@@ -0,0 +1,72 @@
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
+ name: Run benchmarks nightly job
5
+
6
+ on:
7
+ schedule:
8
+ - cron: 45 6 * * *
9
+ workflow_dispatch:
10
+
11
+ env:
12
+ PYTHON_VERSION: "3.12"
13
+ ASV_VERSION: "0.6.5"
14
+ WORKING_DIR: ${{github.workspace}}/benchmarks
15
+ NIGHTLY_HASH_FILE: nightly-hash
16
+
17
+ jobs:
18
+ asv-nightly:
19
+ runs-on: ubuntu-latest
20
+ defaults:
21
+ run:
22
+ working-directory: ${{env.WORKING_DIR}}
23
+ steps:
24
+ - name: Set up Python ${{env.PYTHON_VERSION}}
25
+ uses: actions/setup-python@v6
26
+ with:
27
+ python-version: ${{env.PYTHON_VERSION}}
28
+ - name: Checkout main branch of the repository
29
+ uses: actions/checkout@v6
30
+ with:
31
+ fetch-depth: 0
32
+ - name: Install dependencies
33
+ run: pip install asv[virtualenv]==${{env.ASV_VERSION}}
34
+ - name: Configure git
35
+ run: |
36
+ git config user.name "github-actions[bot]"
37
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38
+ - name: Create ASV machine config file
39
+ run: asv machine --machine gh-runner --yes
40
+ - name: Fetch previous results from the "benchmarks" branch
41
+ run: |
42
+ if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
43
+ git merge origin/benchmarks \
44
+ --allow-unrelated-histories \
45
+ --no-commit
46
+ mv ../_results .
47
+ fi
48
+ - name: Get nightly dates under comparison
49
+ id: nightly-dates
50
+ run: |
51
+ echo "yesterday=$(date -d yesterday +'%Y-%m-%d')" >> $GITHUB_OUTPUT
52
+ echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
53
+ - name: Use last nightly commit hash from cache
54
+ uses: actions/cache@v5
55
+ with:
56
+ path: ${{env.WORKING_DIR}}
57
+ key: nightly-results-${{steps.nightly-dates.outputs.yesterday}}
58
+ - name: Run comparison of main against last nightly build
59
+ run: |
60
+ HASH_FILE=${{env.NIGHTLY_HASH_FILE}}
61
+ CURRENT_HASH=${{github.sha}}
62
+ if [ -f $HASH_FILE ]; then
63
+ PREV_HASH=$(cat $HASH_FILE)
64
+ asv continuous $PREV_HASH $CURRENT_HASH --verbose || true
65
+ asv compare $PREV_HASH $CURRENT_HASH --sort ratio --verbose
66
+ fi
67
+ echo $CURRENT_HASH > $HASH_FILE
68
+ - name: Update last nightly hash in cache
69
+ uses: actions/cache@v5
70
+ with:
71
+ path: ${{env.WORKING_DIR}}
72
+ key: nightly-results-${{steps.nightly-dates.outputs.today}}
@@ -0,0 +1,70 @@
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.12"
19
+ ASV_VERSION: "0.6.5"
20
+ WORKING_DIR: ${{github.workspace}}/benchmarks
21
+ ARTIFACTS_DIR: ${{github.workspace}}/artifacts
22
+
23
+ jobs:
24
+ asv-pr:
25
+ runs-on: ubuntu-latest
26
+ defaults:
27
+ run:
28
+ working-directory: ${{env.WORKING_DIR}}
29
+ steps:
30
+ - name: Set up Python ${{env.PYTHON_VERSION}}
31
+ uses: actions/setup-python@v6
32
+ with:
33
+ python-version: ${{env.PYTHON_VERSION}}
34
+ - name: Checkout PR branch of the repository
35
+ uses: actions/checkout@v6
36
+ with:
37
+ fetch-depth: 0
38
+ - name: Display Workflow Run Information
39
+ run: |
40
+ echo "Workflow Run ID: ${{github.run_id}}"
41
+ - name: Install dependencies
42
+ run: pip install asv[virtualenv]==${{env.ASV_VERSION}} lf-asv-formatter
43
+ - name: Make artifacts directory
44
+ run: mkdir -p ${{env.ARTIFACTS_DIR}}
45
+ - name: Save pull request number
46
+ run: echo ${{github.event.pull_request.number}} > ${{env.ARTIFACTS_DIR}}/pr
47
+ - name: Get current job logs URL
48
+ uses: Tiryoh/gha-jobid-action@v1
49
+ id: jobs
50
+ with:
51
+ github_token: ${{secrets.GITHUB_TOKEN}}
52
+ job_name: ${{github.job}}
53
+ - name: Create ASV machine config file
54
+ run: asv machine --machine gh-runner --yes
55
+ - name: Save comparison of PR against main branch
56
+ run: |
57
+ git remote add upstream https://github.com/${{github.repository}}.git
58
+ git fetch upstream
59
+ asv continuous upstream/main HEAD --verbose || true
60
+ asv compare upstream/main HEAD --sort ratio --verbose | tee output
61
+ python -m lf_asv_formatter --asv_version "$(asv --version | awk '{print $2}')"
62
+ printf "\n\nClick [here]($STEP_URL) to view all benchmarks." >> output
63
+ mv output ${{env.ARTIFACTS_DIR}}
64
+ env:
65
+ STEP_URL: ${{steps.jobs.outputs.html_url}}#step:10:1
66
+ - name: Upload artifacts (PR number and benchmarks output)
67
+ uses: actions/upload-artifact@v6
68
+ with:
69
+ name: benchmark-artifacts
70
+ path: ${{env.ARTIFACTS_DIR}}
@@ -0,0 +1,41 @@
1
+
2
+ # This workflow will install Python dependencies, build the package and then build the documentation.
3
+
4
+ name: Build documentation
5
+
6
+
7
+ on:
8
+ push:
9
+ branches: [ main ]
10
+ pull_request:
11
+ branches: [ main ]
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ build:
19
+
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v6
24
+ - name: Set up Python 3.12
25
+ uses: actions/setup-python@v6
26
+ with:
27
+ python-version: '3.12'
28
+ - name: Install uv
29
+ uses: astral-sh/setup-uv@v7
30
+ - name: Install dependencies
31
+ run: |
32
+ sudo apt-get update
33
+ uv pip install --system -e .
34
+ if [ -f docs/requirements.txt ]; then uv pip install --system -r docs/requirements.txt; fi
35
+ if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
36
+ - name: Install notebook requirements
37
+ run: |
38
+ sudo apt-get install pandoc
39
+ - name: Build docs
40
+ run: |
41
+ sphinx-build -T -E -b html -d docs/build/doctrees ./docs docs/build/html
@@ -0,0 +1,37 @@
1
+
2
+ # This workflow runs pre-commit hooks on pushes and pull requests to main
3
+ # to enforce coding style. To ensure correct configuration, please refer to:
4
+ # https://lincc-ppt.readthedocs.io/en/latest/practices/ci_precommit.html
5
+ name: Run pre-commit hooks
6
+
7
+ on:
8
+ push:
9
+ branches: [ main ]
10
+ pull_request:
11
+ branches: [ main ]
12
+
13
+ jobs:
14
+ pre-commit-ci:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+ with:
19
+ fetch-depth: 0
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v6
22
+ with:
23
+ python-version: '3.12'
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v7
26
+ - name: Install dependencies
27
+ run: |
28
+ sudo apt-get update
29
+ uv pip install --system .[dev]
30
+ if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
31
+ - uses: pre-commit/action@v3.0.1
32
+ with:
33
+ extra_args: --all-files --verbose
34
+ env:
35
+ SKIP: "check-lincc-frameworks-template-version,no-commit-to-branch,check-added-large-files,validate-pyproject,sphinx-build,pytest-check"
36
+ - uses: pre-commit-ci/lite-action@v1.1.0
37
+ 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@v14
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@v4
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@v5
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,39 @@
1
+
2
+ # This workflow will upload a Python Package using Twine when a release is created
3
+ # For more information see: https://github.com/pypa/gh-action-pypi-publish#trusted-publishing
4
+
5
+ # This workflow uses actions that are not certified by GitHub.
6
+ # They are provided by a third-party and are governed by
7
+ # separate terms of service, privacy policy, and support
8
+ # documentation.
9
+
10
+ name: Upload Python Package
11
+
12
+ on:
13
+ release:
14
+ types: [published]
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ deploy:
21
+
22
+ runs-on: ubuntu-latest
23
+ environment: pypi
24
+ permissions:
25
+ id-token: write
26
+ steps:
27
+ - uses: actions/checkout@v6
28
+ - name: Set up Python
29
+ uses: actions/setup-python@v6
30
+ with:
31
+ python-version: '3.12'
32
+ - name: Install dependencies
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ pip install build
36
+ - name: Build package
37
+ run: python -m build
38
+ - name: Publish package
39
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,43 @@
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.12']
24
+
25
+ steps:
26
+ - uses: actions/checkout@v6
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ uses: actions/setup-python@v6
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+ - name: Install uv
32
+ uses: astral-sh/setup-uv@v7
33
+ - name: Install dependencies
34
+ run: |
35
+ sudo apt-get update
36
+ uv pip install --system -e .[dev]
37
+ if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
38
+ - name: List dependencies
39
+ run: |
40
+ pip list
41
+ - name: Run unit tests with pytest
42
+ run: |
43
+ python -m pytest
@@ -0,0 +1,40 @@
1
+
2
+ # This workflow will install Python dependencies, run tests and report code coverage with a variety of Python versions
3
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
4
+
5
+ name: Unit test and code coverage
6
+
7
+ on:
8
+ push:
9
+ branches: [ main ]
10
+ pull_request:
11
+ branches: [ main ]
12
+
13
+ jobs:
14
+ build:
15
+
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ matrix:
19
+ python-version: ['3.12']
20
+
21
+ steps:
22
+ - uses: actions/checkout@v6
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@v6
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ - name: Install uv
28
+ uses: astral-sh/setup-uv@v7
29
+ - name: Install dependencies
30
+ run: |
31
+ sudo apt-get update
32
+ uv pip install --system -e .[dev]
33
+ if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
34
+ - name: Run unit tests with pytest
35
+ run: |
36
+ python -m pytest --cov=science_catalogs --cov-report=xml
37
+ - name: Upload coverage report to codecov
38
+ uses: codecov/codecov-action@v5
39
+ with:
40
+ token: ${{ secrets.CODECOV_TOKEN }}