shine-wl 0.0.2__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 (76) hide show
  1. shine_wl-0.0.2/.all-contributorsrc +57 -0
  2. shine_wl-0.0.2/.github/workflows/claude-code-review.yml +44 -0
  3. shine_wl-0.0.2/.github/workflows/claude.yml +50 -0
  4. shine_wl-0.0.2/.github/workflows/docs.yml +40 -0
  5. shine_wl-0.0.2/.github/workflows/release.yaml +70 -0
  6. shine_wl-0.0.2/.github/workflows/test.yml +40 -0
  7. shine_wl-0.0.2/.gitignore +214 -0
  8. shine_wl-0.0.2/CLAUDE.md +129 -0
  9. shine_wl-0.0.2/DESIGN.md +343 -0
  10. shine_wl-0.0.2/LICENSE +21 -0
  11. shine_wl-0.0.2/PKG-INFO +148 -0
  12. shine_wl-0.0.2/README.md +111 -0
  13. shine_wl-0.0.2/assets/logo.png +0 -0
  14. shine_wl-0.0.2/configs/test_run.yaml +61 -0
  15. shine_wl-0.0.2/configs/validation/level0_base.yaml +48 -0
  16. shine_wl-0.0.2/configs/validation/level0_test.yaml +25 -0
  17. shine_wl-0.0.2/docs/api/config.md +9 -0
  18. shine_wl-0.0.2/docs/api/data.md +8 -0
  19. shine_wl-0.0.2/docs/api/galaxy_utils.md +8 -0
  20. shine_wl-0.0.2/docs/api/inference.md +8 -0
  21. shine_wl-0.0.2/docs/api/psf_utils.md +8 -0
  22. shine_wl-0.0.2/docs/api/scene.md +8 -0
  23. shine_wl-0.0.2/docs/api/validation/bias_config.md +8 -0
  24. shine_wl-0.0.2/docs/api/validation/cli.md +9 -0
  25. shine_wl-0.0.2/docs/api/validation/extraction.md +8 -0
  26. shine_wl-0.0.2/docs/api/validation/index.md +11 -0
  27. shine_wl-0.0.2/docs/api/validation/plots.md +8 -0
  28. shine_wl-0.0.2/docs/api/validation/simulation.md +8 -0
  29. shine_wl-0.0.2/docs/api/validation/statistics.md +8 -0
  30. shine_wl-0.0.2/docs/architecture.md +98 -0
  31. shine_wl-0.0.2/docs/assets/logo.png +0 -0
  32. shine_wl-0.0.2/docs/configuration.md +232 -0
  33. shine_wl-0.0.2/docs/getting-started.md +125 -0
  34. shine_wl-0.0.2/docs/index.md +53 -0
  35. shine_wl-0.0.2/docs/validation/batched.md +94 -0
  36. shine_wl-0.0.2/docs/validation/index.md +107 -0
  37. shine_wl-0.0.2/docs/validation/level0.md +115 -0
  38. shine_wl-0.0.2/examples/shear_inference.py +176 -0
  39. shine_wl-0.0.2/mkdocs.yml +94 -0
  40. shine_wl-0.0.2/pyproject.toml +89 -0
  41. shine_wl-0.0.2/setup.cfg +4 -0
  42. shine_wl-0.0.2/shine/__init__.py +9 -0
  43. shine_wl-0.0.2/shine/_version.py +34 -0
  44. shine_wl-0.0.2/shine/config.py +407 -0
  45. shine_wl-0.0.2/shine/data.py +200 -0
  46. shine_wl-0.0.2/shine/galaxy_utils.py +153 -0
  47. shine_wl-0.0.2/shine/inference.py +147 -0
  48. shine_wl-0.0.2/shine/main.py +118 -0
  49. shine_wl-0.0.2/shine/psf_utils.py +69 -0
  50. shine_wl-0.0.2/shine/scene.py +310 -0
  51. shine_wl-0.0.2/shine/validation/__init__.py +66 -0
  52. shine_wl-0.0.2/shine/validation/bias_config.py +163 -0
  53. shine_wl-0.0.2/shine/validation/cli.py +648 -0
  54. shine_wl-0.0.2/shine/validation/extraction.py +331 -0
  55. shine_wl-0.0.2/shine/validation/plots.py +234 -0
  56. shine_wl-0.0.2/shine/validation/simulation.py +178 -0
  57. shine_wl-0.0.2/shine/validation/statistics.py +238 -0
  58. shine_wl-0.0.2/shine_wl.egg-info/PKG-INFO +148 -0
  59. shine_wl-0.0.2/shine_wl.egg-info/SOURCES.txt +74 -0
  60. shine_wl-0.0.2/shine_wl.egg-info/dependency_links.txt +1 -0
  61. shine_wl-0.0.2/shine_wl.egg-info/entry_points.txt +4 -0
  62. shine_wl-0.0.2/shine_wl.egg-info/requires.txt +21 -0
  63. shine_wl-0.0.2/shine_wl.egg-info/top_level.txt +1 -0
  64. shine_wl-0.0.2/tests/__init__.py +1 -0
  65. shine_wl-0.0.2/tests/test_config.py +305 -0
  66. shine_wl-0.0.2/tests/test_data.py +272 -0
  67. shine_wl-0.0.2/tests/test_galaxy_utils.py +228 -0
  68. shine_wl-0.0.2/tests/test_psf_utils.py +111 -0
  69. shine_wl-0.0.2/tests/test_validation/__init__.py +0 -0
  70. shine_wl-0.0.2/tests/test_validation/test_batched_inference.py +394 -0
  71. shine_wl-0.0.2/tests/test_validation/test_bias_config.py +159 -0
  72. shine_wl-0.0.2/tests/test_validation/test_extraction.py +199 -0
  73. shine_wl-0.0.2/tests/test_validation/test_level0_batched_integration.py +145 -0
  74. shine_wl-0.0.2/tests/test_validation/test_level0_integration.py +137 -0
  75. shine_wl-0.0.2/tests/test_validation/test_simulation.py +97 -0
  76. shine_wl-0.0.2/tests/test_validation/test_statistics.py +89 -0
@@ -0,0 +1,57 @@
1
+ {
2
+ "files": [
3
+ "README.md"
4
+ ],
5
+ "imageSize": 100,
6
+ "commit": false,
7
+ "commitType": "docs",
8
+ "commitConvention": "angular",
9
+ "contributors": [
10
+ {
11
+ "login": "CentofantiEze",
12
+ "name": "Ezequiel Centofanti",
13
+ "avatar_url": "https://avatars.githubusercontent.com/u/42658822?v=4",
14
+ "profile": "https://centofantieze.github.io",
15
+ "contributions": [
16
+ "ideas",
17
+ "projectManagement"
18
+ ]
19
+ },
20
+ {
21
+ "login": "sfarrens",
22
+ "name": "Samuel Farrens",
23
+ "avatar_url": "https://avatars.githubusercontent.com/u/6851839?v=4",
24
+ "profile": "http://sfarrens.github.io",
25
+ "contributions": [
26
+ "ideas",
27
+ "projectManagement"
28
+ ]
29
+ },
30
+ {
31
+ "login": "Emmaaycoberry",
32
+ "name": "Emma Ayçoberry",
33
+ "avatar_url": "https://avatars.githubusercontent.com/u/80262003?v=4",
34
+ "profile": "https://github.com/Emmaaycoberry",
35
+ "contributions": [
36
+ "ideas",
37
+ "projectManagement"
38
+ ]
39
+ },
40
+ {
41
+ "login": "EiffL",
42
+ "name": "Francois Lanusse",
43
+ "avatar_url": "https://avatars.githubusercontent.com/u/861591?v=4",
44
+ "profile": "http://flanusse.net/",
45
+ "contributions": [
46
+ "ideas",
47
+ "projectManagement"
48
+ ]
49
+ }
50
+ ],
51
+ "contributorsPerLine": 4,
52
+ "skipCi": true,
53
+ "repoType": "github",
54
+ "repoHost": "https://github.com",
55
+ "projectName": "SHINE",
56
+ "projectOwner": "CosmoStat"
57
+ }
@@ -0,0 +1,44 @@
1
+ name: Claude Code Review
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, ready_for_review, reopened]
6
+ # Optional: Only run on specific file changes
7
+ # paths:
8
+ # - "src/**/*.ts"
9
+ # - "src/**/*.tsx"
10
+ # - "src/**/*.js"
11
+ # - "src/**/*.jsx"
12
+
13
+ jobs:
14
+ claude-review:
15
+ # Optional: Filter by PR author
16
+ # if: |
17
+ # github.event.pull_request.user.login == 'external-contributor' ||
18
+ # github.event.pull_request.user.login == 'new-developer' ||
19
+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20
+
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ contents: read
24
+ pull-requests: read
25
+ issues: read
26
+ id-token: write
27
+
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 1
33
+
34
+ - name: Run Claude Code Review
35
+ id: claude-review
36
+ uses: anthropics/claude-code-action@v1
37
+ with:
38
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39
+ plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
40
+ plugins: 'code-review@claude-code-plugins'
41
+ prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
42
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
43
+ # or https://code.claude.com/docs/en/cli-reference for available options
44
+
@@ -0,0 +1,50 @@
1
+ name: Claude Code
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+ issues:
9
+ types: [opened, assigned]
10
+ pull_request_review:
11
+ types: [submitted]
12
+
13
+ jobs:
14
+ claude:
15
+ if: |
16
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ id-token: write
26
+ actions: read # Required for Claude to read CI results on PRs
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 1
32
+
33
+ - name: Run Claude Code
34
+ id: claude
35
+ uses: anthropics/claude-code-action@v1
36
+ with:
37
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
+
39
+ # This is an optional setting that allows Claude to read CI results on PRs
40
+ additional_permissions: |
41
+ actions: read
42
+
43
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44
+ # prompt: 'Update the pull request description to include a summary of changes.'
45
+
46
+ # Optional: Add claude_args to customize behavior and configuration
47
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48
+ # or https://code.claude.com/docs/en/cli-reference for available options
49
+ # claude_args: '--allowed-tools Bash(gh pr:*)'
50
+
@@ -0,0 +1,40 @@
1
+ name: Deploy docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ concurrency:
14
+ group: pages
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ deploy:
19
+ runs-on: ubuntu-latest
20
+ environment:
21
+ name: github-pages
22
+ url: ${{ steps.deployment.outputs.page_url }}
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.12"
29
+ cache: pip
30
+
31
+ - run: pip install -e ".[docs]"
32
+
33
+ - run: mkdocs build --strict
34
+
35
+ - uses: actions/upload-pages-artifact@v3
36
+ with:
37
+ path: site/
38
+
39
+ - id: deployment
40
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,70 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
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
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.x"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ # url: https://pypi.org/p/YOURPROJECT
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,40 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, prototype ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ['3.11', '3.12', '3.13']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ # Install JAX-GalSim from GitHub (not yet on PyPI)
28
+ pip install git+https://github.com/GalSim-developers/JAX-GalSim.git
29
+ # Install SHINE with test dependencies
30
+ pip install -e ".[test]"
31
+
32
+ - name: Run tests with pytest
33
+ run: |
34
+ pytest tests/ -v --cov=shine --cov-report=term-missing
35
+
36
+ - name: Upload coverage reports
37
+ if: matrix.python-version == '3.11'
38
+ uses: codecov/codecov-action@v4
39
+ with:
40
+ fail_ci_if_error: false
@@ -0,0 +1,214 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
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
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
208
+
209
+ shine/_version.py
210
+
211
+ results/
212
+ examples/output/
213
+
214
+ project_plan/
@@ -0,0 +1,129 @@
1
+ # CLAUDE.md - AI Assistant Guide for SHINE
2
+
3
+ ## Project Overview
4
+
5
+ SHINE (SHear INference Environment) is a JAX-powered framework for probabilistic shear estimation in weak gravitational lensing. It treats shear measurement as a Bayesian inverse problem: generating forward models of the sky, convolving with instrument response, and comparing to observed data to infer posterior distributions of shear parameters.
6
+
7
+ **Status:** Early development / Alpha. The architectural design is complete (see `DESIGN.md`) but source code implementation has not yet begun — currently only `shine/__init__.py` exists as an empty module.
8
+
9
+ **Organization:** CosmoStat Lab (CEA / CNRS)
10
+ **License:** MIT
11
+
12
+ ## Repository Structure
13
+
14
+ ```
15
+ SHINE/
16
+ ├── .github/workflows/ # CI/CD (Claude PR assistant + code review)
17
+ │ ├── claude.yml # Claude PR assistant triggered by @claude mentions
18
+ │ └── claude-code-review.yml # Automated code review on PRs
19
+ ├── assets/
20
+ │ └── logo.png # Project logo
21
+ ├── external/
22
+ │ └── GalSim/ # External GalSim dependency (placeholder)
23
+ ├── shine/ # Main Python package
24
+ │ └── __init__.py # Currently empty
25
+ ├── CLAUDE.md # This file
26
+ ├── DESIGN.md # Comprehensive architecture & design document
27
+ ├── LICENSE # MIT License
28
+ ├── README.md # Project overview and quick start
29
+ └── pyproject.toml # Build configuration
30
+ ```
31
+
32
+ ## Key Technologies
33
+
34
+ - **JAX** — Core computation: JIT compilation, vmap vectorization, grad for HMC
35
+ - **NumPyro** — Probabilistic programming: hierarchical models, MCMC (NUTS/HMC)
36
+ - **JAX-GalSim** — Differentiable galaxy profile rendering and PSF convolution
37
+ - **BlackJAX** — Optional lower-level inference library for custom samplers
38
+
39
+ ## Planned Module Architecture
40
+
41
+ These modules are specified in `DESIGN.md` but not yet implemented:
42
+
43
+ | Module | Purpose |
44
+ |--------|---------|
45
+ | `shine.config` | YAML config parsing and validation (pydantic) |
46
+ | `shine.scene_modelling` | NumPyro generative model definitions |
47
+ | `shine.inference` | Bayesian inference (NUTS, SVI, BlackJAX) |
48
+ | `shine.simulations` | Survey-specific data interfaces (Euclid, LSST, MeerKAT) |
49
+ | `shine.morphology` | Galaxy surface brightness profiles (Sersic, VAE/GAN) |
50
+ | `shine.wms` | Workflow management for HPC/SLURM clusters |
51
+
52
+ ## Build System
53
+
54
+ - **Build backend:** setuptools (>=61) with setuptools-scm (>=6.2)
55
+ - **Version:** Dynamic, managed by setuptools-scm (writes to `shine/_version.py`)
56
+ - **Python:** >=3.9 (supports 3.9 through 3.13)
57
+ - **Install:** `pip install -e .` for development
58
+
59
+ ## Code Standards (from DESIGN.md Section 4.1)
60
+
61
+ When implementing code for this project, follow these conventions:
62
+
63
+ - **Formatter:** Black
64
+ - **Import sorting:** isort
65
+ - **Type hints:** Full PEP 484 compliance required
66
+ - **Docstrings:** Google-style
67
+ - **Testing:** pytest + chex (JAX-specific array shape/type testing)
68
+ - **Documentation:** Sphinx + ReadTheDocs (not yet configured)
69
+
70
+ ## JAX-Specific Guidelines
71
+
72
+ - JAX-GalSim objects are **immutable** — the pipeline must be purely functional
73
+ - Use `jax.vmap` or `numpyro.plate` for vectorization over galaxies; **never use Python loops** in rendering paths
74
+ - Use `jax.jit` to compile likelihood and gradient functions
75
+ - JAX uses a **functional PRNG** — manage RNG keys carefully, especially within NumPyro models
76
+ - Support reparameterization (e.g., `LocScaleReparam`) for hierarchical models
77
+
78
+ ## Testing Strategy
79
+
80
+ Not yet implemented. When tests are added, follow this strategy:
81
+
82
+ - **Unit tests:** Verify individual components (e.g., Sersic profile generation)
83
+ - **Integration tests:** End-to-end runs on small synthetic patches
84
+ - **Validation tests:**
85
+ - Self-consistency: generate data with known shear, infer it back, verify posterior credible intervals
86
+ - Comparison: compare with standard (non-JAX) GalSim for numerical accuracy
87
+ - **Run tests with:** `pytest` (when test infrastructure exists)
88
+
89
+ ## Configuration Pattern
90
+
91
+ SHINE uses GalSim-compatible YAML configuration with a probabilistic extension: any parameter defined as a distribution (e.g., `type: Normal`) becomes a **latent variable** for inference rather than a fixed simulation value. See `DESIGN.md` Section 6.1 for config examples.
92
+
93
+ ## Development Roadmap
94
+
95
+ 1. **Phase 1:** Prototype with simple parametric models (Sersic) and constant PSF
96
+ 2. **Phase 2:** Realistic PSF models (Euclid/LSST specific)
97
+ 3. **Phase 3:** Non-parametric galaxy morphology (VAE/Diffusion)
98
+ 4. **Phase 4:** Large-scale validation on Flagship/CosmoDC2 simulations
99
+
100
+ ## Key Design Reference
101
+
102
+ The primary design document is `DESIGN.md` (343 lines). Consult it for:
103
+ - Architecture diagrams (Section 2.3)
104
+ - Component API designs (Section 3)
105
+ - Code structure examples (Section 3.2)
106
+ - End-to-end usage examples with config and Python code (Section 6)
107
+
108
+ ## Common Tasks
109
+
110
+ ```bash
111
+ # Install in development mode
112
+ pip install -e .
113
+
114
+ # Run tests (when available)
115
+ pytest
116
+
117
+ # Format code (when tooling is configured)
118
+ black shine/
119
+ isort shine/
120
+ ```
121
+
122
+ ## Notes for AI Assistants
123
+
124
+ - Always consult `DESIGN.md` before implementing new modules — it contains detailed API specifications and code structure examples
125
+ - The project has no runtime dependencies listed in `pyproject.toml` yet; add JAX, NumPyro, JAX-GalSim, etc. when implementing modules
126
+ - No linter/formatter configuration files exist yet (no `.flake8`, `pyproject.toml [tool.black]`, etc.) — create them following the standards in DESIGN.md Section 4.1 when needed
127
+ - No test directory or test infrastructure exists yet — create `tests/` following pytest conventions when adding tests
128
+ - The `external/GalSim/` directory is currently an empty placeholder
129
+ - CI/CD currently only includes Claude-based PR workflows; traditional CI (tests, linting) should be added when code exists to test