trap-hci 2.1.0__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 (65) hide show
  1. trap_hci-2.1.0/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
  2. trap_hci-2.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. trap_hci-2.1.0/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  4. trap_hci-2.1.0/.github/PULL_REQUEST_TEMPLATE.md +40 -0
  5. trap_hci-2.1.0/.github/dependabot.yml +11 -0
  6. trap_hci-2.1.0/.github/workflows/ci.yml +93 -0
  7. trap_hci-2.1.0/.github/workflows/publish.yml +108 -0
  8. trap_hci-2.1.0/.gitignore +132 -0
  9. trap_hci-2.1.0/CHANGELOG.md +352 -0
  10. trap_hci-2.1.0/CITATION.cff +56 -0
  11. trap_hci-2.1.0/LICENSE +21 -0
  12. trap_hci-2.1.0/MANIFEST.in +5 -0
  13. trap_hci-2.1.0/PKG-INFO +216 -0
  14. trap_hci-2.1.0/README.md +170 -0
  15. trap_hci-2.1.0/RELEASING.md +38 -0
  16. trap_hci-2.1.0/docs/Makefile +20 -0
  17. trap_hci-2.1.0/docs/conf.py +53 -0
  18. trap_hci-2.1.0/docs/index.rst +67 -0
  19. trap_hci-2.1.0/docs/make.bat +35 -0
  20. trap_hci-2.1.0/pixi.toml +81 -0
  21. trap_hci-2.1.0/pyproject.toml +112 -0
  22. trap_hci-2.1.0/setup.cfg +4 -0
  23. trap_hci-2.1.0/src/trap/__init__.py +10 -0
  24. trap_hci-2.1.0/src/trap/_version.py +24 -0
  25. trap_hci-2.1.0/src/trap/detection.py +5090 -0
  26. trap_hci-2.1.0/src/trap/image_coordinates.py +212 -0
  27. trap_hci-2.1.0/src/trap/likelihood_tools.py +312 -0
  28. trap_hci-2.1.0/src/trap/makesource.py +472 -0
  29. trap_hci-2.1.0/src/trap/parameters.py +940 -0
  30. trap_hci-2.1.0/src/trap/pca_regression.py +392 -0
  31. trap_hci-2.1.0/src/trap/plotting_tools.py +167 -0
  32. trap_hci-2.1.0/src/trap/reduction_wrapper.py +2386 -0
  33. trap_hci-2.1.0/src/trap/regression.py +2049 -0
  34. trap_hci-2.1.0/src/trap/regressor_selection.py +543 -0
  35. trap_hci-2.1.0/src/trap/shared_arrays.py +154 -0
  36. trap_hci-2.1.0/src/trap/species_setup.py +164 -0
  37. trap_hci-2.1.0/src/trap/template.py +257 -0
  38. trap_hci-2.1.0/src/trap/utils.py +692 -0
  39. trap_hci-2.1.0/src/trap_hci.egg-info/PKG-INFO +216 -0
  40. trap_hci-2.1.0/src/trap_hci.egg-info/SOURCES.txt +63 -0
  41. trap_hci-2.1.0/src/trap_hci.egg-info/dependency_links.txt +1 -0
  42. trap_hci-2.1.0/src/trap_hci.egg-info/requires.txt +33 -0
  43. trap_hci-2.1.0/src/trap_hci.egg-info/scm_file_list.json +65 -0
  44. trap_hci-2.1.0/src/trap_hci.egg-info/scm_version.json +8 -0
  45. trap_hci-2.1.0/src/trap_hci.egg-info/top_level.txt +1 -0
  46. trap_hci-2.1.0/tests/test_astrometry_uncertainty.py +676 -0
  47. trap_hci-2.1.0/tests/test_config_normalization.py +31 -0
  48. trap_hci-2.1.0/tests/test_coronagraph_throughput.py +122 -0
  49. trap_hci-2.1.0/tests/test_detection_output_refresh.py +172 -0
  50. trap_hci-2.1.0/tests/test_detection_robustness.py +272 -0
  51. trap_hci-2.1.0/tests/test_e2e_51eri.py +159 -0
  52. trap_hci-2.1.0/tests/test_edge_injection.py +88 -0
  53. trap_hci-2.1.0/tests/test_footprint_integration.py +158 -0
  54. trap_hci-2.1.0/tests/test_footprint_masks.py +217 -0
  55. trap_hci-2.1.0/tests/test_imports.py +17 -0
  56. trap_hci-2.1.0/tests/test_logging.py +60 -0
  57. trap_hci-2.1.0/tests/test_multiwavelength_regressors.py +465 -0
  58. trap_hci-2.1.0/tests/test_nan_centers.py +83 -0
  59. trap_hci-2.1.0/tests/test_padded_crop.py +87 -0
  60. trap_hci-2.1.0/tests/test_parallel_equivalence.py +124 -0
  61. trap_hci-2.1.0/tests/test_pca_regression.py +36 -0
  62. trap_hci-2.1.0/tests/test_runtime_state.py +223 -0
  63. trap_hci-2.1.0/tests/test_shared_arrays.py +88 -0
  64. trap_hci-2.1.0/tests/test_species_setup.py +266 -0
  65. trap_hci-2.1.0/tests/test_trap_config_for_irdis.py +89 -0
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: 🐞 Bug Report
3
+ about: Report something that's not working correctly
4
+ title: "[Bug]: "
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ### 🐞 Describe the Bug
10
+
11
+ A clear and concise description of what the bug is.
12
+
13
+ ### 🔍 Steps to Reproduce
14
+
15
+ A step-by-step description of how to reproduce the bug,
16
+
17
+ ### ❌ Expected Behavior
18
+
19
+ A clear description of what you expected to happen.
20
+
21
+ ### 📸 Screenshots / Logs
22
+
23
+ If applicable, add screenshots or log outputs to help explain your problem.
24
+
25
+ ### 💻 Environment
26
+
27
+ - **OS:** [e.g., Ubuntu, macOS, Windows]
28
+ - **Python Version:** [e.g., 3.11]
29
+ - **Project Version:** [e.g., v1.0.2]
30
+
31
+ ### 🛠 Additional context
32
+
33
+ Add any other context about the problem here.
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Ask a question or seek support
4
+ url: https://github.com/m-samland/trap/discussions
5
+ about: Use Discussions for questions, support, or other topics.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: ✨ Feature Request
3
+ about: Suggest a new feature or improvement
4
+ title: "[Feature]: "
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ### ✨ Description of the Feature
10
+
11
+ Clearly and concisely describe the feature you'd like.
12
+
13
+ ### 🚩 Problem or Motivation
14
+
15
+ Explain the problem or use case this feature addresses.
16
+
17
+ ### 🔖 Proposed Solution
18
+
19
+ Briefly outline a possible solution or how the feature could work.
20
+
21
+ ### 📝 Additional Information
22
+
23
+ Add any additional context, references, screenshots, or mock-ups here.
@@ -0,0 +1,40 @@
1
+ ### 📌 Description
2
+
3
+ Provide a clear, concise description of the pull request's purpose and the changes made.
4
+
5
+ ### 📌 Type of change
6
+
7
+ Please delete options that are not relevant (and this line).
8
+
9
+ - Bug fix (non-breaking change which fixes an issue)
10
+ - New feature (non-breaking change which adds functionality)
11
+ - Breaking change (fix or feature that would cause existing functionality to not work as expected)
12
+
13
+ ### 🚨 Motivation and Context
14
+
15
+ Why is this change required? Explain the problem it solves or the feature it adds.
16
+
17
+ ### ✅ Checklist
18
+
19
+ - [ ] I’ve tested the changes locally.
20
+ - [ ] I’ve updated documentation as necessary.
21
+ - [ ] My changes follow the project's coding style and conventions.
22
+ - [ ] All tests pass successfully.
23
+
24
+ ### 🔍 How to test/review
25
+
26
+ Describe steps for testing or reviewing your PR:
27
+
28
+ 1. Step one
29
+ 2. Step two
30
+ 3. ...
31
+
32
+ ### 📸 Screenshots (if applicable)
33
+
34
+ Add screenshots or GIFs that show your feature working or illustrate changes.
35
+
36
+ ### 🔖 Related Issues/Tickets
37
+
38
+ List any related issues, tickets, or tasks here:
39
+ - Closes #<issue_number>
40
+ - Relates to #<issue_number>
@@ -0,0 +1,11 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ target-branch: "develop"
7
+ schedule:
8
+ interval: "monthly"
9
+ groups:
10
+ actions:
11
+ patterns: ["*"]
@@ -0,0 +1,93 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+ # Dependencies float within their ranges, so a new upstream release can break
9
+ # the package while the repo is quiet. GitHub runs scheduled workflows on the
10
+ # default branch only.
11
+ schedule:
12
+ - cron: "0 6 * * 1" # Mondays 06:00 UTC
13
+ workflow_dispatch:
14
+
15
+ jobs:
16
+
17
+ lint:
18
+ name: 🧹 Lint with Ruff
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v7
24
+
25
+ - name: Set up Python 3.12
26
+ uses: actions/setup-python@v7
27
+ with:
28
+ python-version: "3.12"
29
+
30
+ - name: Install Ruff
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ pip install ruff
34
+
35
+ - name: Run Ruff check
36
+ run: |
37
+ ruff check .
38
+
39
+ test:
40
+ name: 🧪 Test with pytest (Python ${{ matrix.python-version }})
41
+ runs-on: ubuntu-latest
42
+ needs: lint # Ensures linting passes before running tests
43
+
44
+ strategy:
45
+ matrix:
46
+ python-version: ["3.11", "3.12", "3.13"]
47
+
48
+ steps:
49
+ - name: Checkout
50
+ uses: actions/checkout@v7
51
+
52
+ - name: Set up Python ${{ matrix.python-version }}
53
+ uses: actions/setup-python@v7
54
+ with:
55
+ python-version: ${{ matrix.python-version }}
56
+
57
+ # Only the declared dependencies plus the test tools, so test_imports.py
58
+ # catches a module that needs a package only an optional extra provides.
59
+ - name: Install dependencies
60
+ run: |
61
+ python -m pip install --upgrade pip
62
+ pip install ".[test]"
63
+
64
+ # The suite builds synthetic data: no network, no species grids, no examples/.
65
+ - name: Run pytest
66
+ run: |
67
+ pytest
68
+
69
+ e2e:
70
+ name: 🔭 End-to-end on 51 Eri b
71
+ runs-on: ubuntu-latest
72
+ # Only spend the minutes once the cheap checks pass.
73
+ needs: [lint, test]
74
+ timeout-minutes: 30
75
+
76
+ steps:
77
+ - name: Checkout
78
+ uses: actions/checkout@v7
79
+
80
+ - name: Set up Python 3.12
81
+ uses: actions/setup-python@v7
82
+ with:
83
+ python-version: "3.12"
84
+
85
+ - name: Install dependencies
86
+ run: |
87
+ python -m pip install --upgrade pip
88
+ pip install ".[test]"
89
+
90
+ # Real IRDIS data from examples/test_data; a few minutes on the runner's 4 CPUs.
91
+ - name: Run the end-to-end test
92
+ run: |
93
+ pytest -m e2e
@@ -0,0 +1,108 @@
1
+ name: Publish
2
+
3
+ # Every run builds and checks the package. Uploads use Trusted Publishing (no tokens),
4
+ # configured on PyPI and TestPyPI for this file name and the environments below:
5
+ # - a published GitHub release uploads to PyPI (environment `pypi`: v* tags only,
6
+ # waits for a maintainer's approval);
7
+ # - a manual run uploads a dev version to TestPyPI (environment `testpypi`).
8
+ # Renaming this file or an environment breaks publishing until the trusted publishers on
9
+ # PyPI and TestPyPI are updated. The release steps are in RELEASING.md.
10
+ on:
11
+ push:
12
+ branches: [main, develop]
13
+ pull_request:
14
+ branches: [main, develop]
15
+ release:
16
+ types: [published]
17
+ workflow_dispatch:
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+
24
+ build:
25
+ name: 📦 Build and check
26
+ runs-on: ubuntu-latest
27
+
28
+ steps:
29
+ # setuptools_scm needs the tags; a shallow clone builds version 0.1.dev1.
30
+ - name: Checkout
31
+ uses: actions/checkout@v7
32
+ with:
33
+ fetch-depth: 0
34
+
35
+ - name: Set up Python 3.12
36
+ uses: actions/setup-python@v7
37
+ with:
38
+ python-version: "3.12"
39
+
40
+ # PyPI rejects local versions (+g<hash>), which every build between tags carries.
41
+ - name: Build sdist and wheel
42
+ env:
43
+ SETUPTOOLS_SCM_OVERRIDES_FOR_TRAP_HCI: '{local_scheme = "no-local-version"}'
44
+ run: |
45
+ python -m pip install --upgrade pip build twine
46
+ python -m build
47
+ twine check --strict dist/*
48
+
49
+ # An upload can never be replaced, so install the wheel on its own before it goes out.
50
+ - name: Smoke test the wheel
51
+ env:
52
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
53
+ run: |
54
+ python -m venv "$RUNNER_TEMP/smoke"
55
+ "$RUNNER_TEMP/smoke/bin/pip" install dist/*.whl
56
+ cd "$RUNNER_TEMP"
57
+ "$RUNNER_TEMP/smoke/bin/python" -c "
58
+ import os, trap
59
+ print('trap', trap.__version__)
60
+ tag = os.environ['RELEASE_TAG']
61
+ assert not tag or trap.__version__ == tag.removeprefix('v'), f'version {trap.__version__} does not match tag {tag}'
62
+ "
63
+
64
+ - name: Upload the distributions
65
+ uses: actions/upload-artifact@v7
66
+ with:
67
+ name: dist
68
+ path: dist/
69
+
70
+ testpypi:
71
+ name: 🧪 Upload to TestPyPI
72
+ if: github.event_name == 'workflow_dispatch'
73
+ needs: build
74
+ runs-on: ubuntu-latest
75
+ environment:
76
+ name: testpypi
77
+ url: https://test.pypi.org/p/trap-hci
78
+ permissions:
79
+ id-token: write
80
+
81
+ steps:
82
+ - uses: actions/download-artifact@v8
83
+ with:
84
+ name: dist
85
+ path: dist/
86
+
87
+ - uses: pypa/gh-action-pypi-publish@release/v1
88
+ with:
89
+ repository-url: https://test.pypi.org/legacy/
90
+
91
+ pypi:
92
+ name: 🚀 Upload to PyPI
93
+ if: github.event_name == 'release'
94
+ needs: build
95
+ runs-on: ubuntu-latest
96
+ environment:
97
+ name: pypi
98
+ url: https://pypi.org/p/trap-hci
99
+ permissions:
100
+ id-token: write
101
+
102
+ steps:
103
+ - uses: actions/download-artifact@v8
104
+ with:
105
+ name: dist
106
+ path: dist/
107
+
108
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,132 @@
1
+ .DS_Store
2
+ # Byte-compiled / optimized / DLL files
3
+ __pycache__/
4
+ *.py[cod]
5
+ *$py.class
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ pip-wheel-metadata/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+ *_version.py
31
+
32
+ # PyInstaller
33
+ # Usually these files are written by a python script from a template
34
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
35
+ *.manifest
36
+ *.spec
37
+
38
+ # Installer logs
39
+ pip-log.txt
40
+ pip-delete-this-directory.txt
41
+
42
+ # Unit test / coverage reports
43
+ htmlcov/
44
+ .tox/
45
+ .nox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ *.py,cover
53
+ .hypothesis/
54
+ .pytest_cache/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+ docs/api/
76
+
77
+ # PyBuilder
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98
+ __pypackages__/
99
+
100
+ # Celery stuff
101
+ celerybeat-schedule
102
+ celerybeat.pid
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .env
109
+ .venv
110
+ env/
111
+ venv/
112
+ ENV/
113
+ env.bak/
114
+ venv.bak/
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mkdocs documentation
124
+ /site
125
+
126
+ # mypy
127
+ .mypy_cache/
128
+ .dmypy.json
129
+ dmypy.json
130
+
131
+ # Pyre type checker
132
+ .pyre/