sdasim 0.2.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 (44) hide show
  1. sdasim-0.2.0/.gitignore +218 -0
  2. sdasim-0.2.0/LICENSE +21 -0
  3. sdasim-0.2.0/Makefile +156 -0
  4. sdasim-0.2.0/PKG-INFO +327 -0
  5. sdasim-0.2.0/README.md +287 -0
  6. sdasim-0.2.0/docs/streak_model.md +162 -0
  7. sdasim-0.2.0/examples/pretrain.py +72 -0
  8. sdasim-0.2.0/examples/rate_sidereal.yaml +64 -0
  9. sdasim-0.2.0/examples/rate_track.yaml +58 -0
  10. sdasim-0.2.0/examples/sidereal.yaml +60 -0
  11. sdasim-0.2.0/examples/speed_test.yaml +67 -0
  12. sdasim-0.2.0/pyproject.toml +101 -0
  13. sdasim-0.2.0/src/sdasim/__init__.py +90 -0
  14. sdasim-0.2.0/src/sdasim/_compat.py +194 -0
  15. sdasim-0.2.0/src/sdasim/_version.py +6 -0
  16. sdasim-0.2.0/src/sdasim/batch.py +346 -0
  17. sdasim-0.2.0/src/sdasim/calibrate.py +621 -0
  18. sdasim-0.2.0/src/sdasim/cli.py +237 -0
  19. sdasim-0.2.0/src/sdasim/config.py +162 -0
  20. sdasim-0.2.0/src/sdasim/device.py +44 -0
  21. sdasim-0.2.0/src/sdasim/empirical.py +682 -0
  22. sdasim-0.2.0/src/sdasim/fpa.py +110 -0
  23. sdasim-0.2.0/src/sdasim/io.py +174 -0
  24. sdasim-0.2.0/src/sdasim/noise.py +50 -0
  25. sdasim-0.2.0/src/sdasim/render.py +244 -0
  26. sdasim-0.2.0/src/sdasim/sampler.py +312 -0
  27. sdasim-0.2.0/src/sdasim/scene.py +484 -0
  28. sdasim-0.2.0/src/sdasim/splat.py +426 -0
  29. sdasim-0.2.0/src/sdasim/sstr7.py +422 -0
  30. sdasim-0.2.0/src/sdasim/stars.py +161 -0
  31. sdasim-0.2.0/src/sdasim/streak_vis.py +300 -0
  32. sdasim-0.2.0/src/sdasim/targets.py +74 -0
  33. sdasim-0.2.0/tests/conftest.py +20 -0
  34. sdasim-0.2.0/tests/test_config.py +72 -0
  35. sdasim-0.2.0/tests/test_empirical.py +118 -0
  36. sdasim-0.2.0/tests/test_fpa.py +111 -0
  37. sdasim-0.2.0/tests/test_gradients.py +169 -0
  38. sdasim-0.2.0/tests/test_noise.py +86 -0
  39. sdasim-0.2.0/tests/test_rate_sidereal.py +328 -0
  40. sdasim-0.2.0/tests/test_render.py +216 -0
  41. sdasim-0.2.0/tests/test_scene.py +286 -0
  42. sdasim-0.2.0/tests/test_splat.py +128 -0
  43. sdasim-0.2.0/tests/test_stars.py +115 -0
  44. sdasim-0.2.0/tests/test_targets.py +52 -0
@@ -0,0 +1,218 @@
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
+ # Local render output
210
+ test_render/
211
+ output/
212
+ calib/
213
+
214
+ # Scratch / calibration work area (internal data paths, not for distribution)
215
+ temp/
216
+
217
+ # Claude Code local settings
218
+ .claude/settings.local.json
sdasim-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zach Gazak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
sdasim-0.2.0/Makefile ADDED
@@ -0,0 +1,156 @@
1
+ # Try bash first, fall back to zsh (for macOS)
2
+ ifeq ($(shell which bash 2>/dev/null),)
3
+ SHELL := /bin/zsh
4
+ else
5
+ SHELL := /bin/bash
6
+ endif
7
+
8
+ # Project variables
9
+ PACKAGE := sdasim
10
+ DIST_NAME := sdasim
11
+ VERSION := $(shell sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)
12
+ # Non-conflicting extras (compat/satsim conflicts with catalogs/fits, so it is
13
+ # installed on demand, never as part of the standard dev environment).
14
+ EXTRAS := --extra dev --extra catalogs --extra fits --extra calibrate
15
+ # Export variables
16
+ EXPORT_BASE := dist/export
17
+ EXPORT_NAME := $(PACKAGE)-$(VERSION)
18
+ EXPORT_DIR := $(EXPORT_BASE)/$(EXPORT_NAME)
19
+
20
+ .DEFAULT_GOAL := help
21
+
22
+ ###################
23
+ # Setup #
24
+ ###################
25
+
26
+ .PHONY: check-uv sync
27
+
28
+ check-uv:
29
+ @which uv > /dev/null 2>&1 || ( \
30
+ echo "Error: uv is not installed. Please install it first:"; \
31
+ echo "curl -LsSf https://astral.sh/uv/install.sh | sh"; \
32
+ exit 1 \
33
+ )
34
+
35
+ sync: check-uv ## Sync dependencies (dev + catalogs + fits + calibrate)
36
+ uv sync $(EXTRAS)
37
+
38
+ ###################
39
+ # Testing #
40
+ ###################
41
+
42
+ .PHONY: test coverage
43
+
44
+ test: ## Run the full test suite
45
+ uv run $(EXTRAS) pytest -v
46
+
47
+ coverage: ## Run tests with coverage report (htmlcov/index.html)
48
+ uv run $(EXTRAS) --with pytest-cov pytest \
49
+ --cov=$(PACKAGE) \
50
+ --cov-report=term-missing \
51
+ --cov-report=html
52
+ @echo "Coverage report: htmlcov/index.html"
53
+
54
+ ###################
55
+ # Code Quality #
56
+ ###################
57
+
58
+ .PHONY: lint format
59
+
60
+ lint: ## Run linter (ruff)
61
+ uv run ruff check src/ tests/
62
+
63
+ format: ## Format code and fix lint issues (ruff)
64
+ uv run ruff format src/ tests/
65
+ uv run ruff check --fix src/ tests/
66
+
67
+ ###################
68
+ # Release #
69
+ ###################
70
+
71
+ .PHONY: version build check-clean-tree check-version-unpublished check-tag-free tag publish-test publish
72
+
73
+ version: ## Print the version from pyproject.toml
74
+ @echo $(VERSION)
75
+
76
+ build: ## Build wheel and sdist
77
+ rm -rf dist/
78
+ uv build
79
+
80
+ check-clean-tree:
81
+ @test -z "$$(git status --porcelain)" || { echo "ERROR: git tree is dirty; commit or stash first"; git status --short; exit 1; }
82
+
83
+ check-version-unpublished:
84
+ @if curl -sf https://pypi.org/pypi/$(DIST_NAME)/$(VERSION)/json > /dev/null; then \
85
+ echo "ERROR: $(DIST_NAME) $(VERSION) is already on PyPI; bump version in pyproject.toml first"; exit 1; \
86
+ fi
87
+ @echo "PyPI check OK: $(DIST_NAME) $(VERSION) not yet published"
88
+
89
+ check-tag-free:
90
+ @if git rev-parse -q --verify "refs/tags/v$(VERSION)" > /dev/null; then \
91
+ echo "ERROR: local tag v$(VERSION) already exists"; exit 1; \
92
+ fi
93
+ @if git ls-remote --exit-code --tags origin "v$(VERSION)" > /dev/null 2>&1; then \
94
+ echo "ERROR: tag v$(VERSION) already exists on origin"; exit 1; \
95
+ fi
96
+ @echo "Tag check OK: v$(VERSION) is free"
97
+
98
+ tag: check-clean-tree check-tag-free ## git tag v<version> from pyproject.toml and push it
99
+ git tag v$(VERSION)
100
+ git push origin v$(VERSION)
101
+
102
+ publish-test: check-clean-tree test build ## Test + build + upload to TestPyPI (token from ~/.pypirc)
103
+ uvx twine upload --repository testpypi dist/*
104
+
105
+ # Publish to PyPI. Guarded: refuses on a dirty tree or an already-published
106
+ # version, always rebuilds from scratch, and runs the test suite first.
107
+ # PyPI uploads are irreversible per version - bump pyproject.toml first.
108
+ publish: check-clean-tree check-version-unpublished test build ## Guarded upload to PyPI (token from ~/.pypirc)
109
+ uvx twine upload dist/*
110
+
111
+ ###################
112
+ # Export #
113
+ ###################
114
+
115
+ .PHONY: export export-zip
116
+
117
+ export: ## Export clean source snapshot (no git history)
118
+ @echo "Exporting clean source snapshot..."
119
+ rm -rf $(EXPORT_DIR)
120
+ mkdir -p $(EXPORT_DIR)
121
+ git archive --format=tar HEAD | tar -x -C $(EXPORT_DIR)
122
+ @echo "Exported to $(EXPORT_DIR)"
123
+
124
+ export-zip: ## Export clean source snapshot as zip
125
+ @echo "Exporting clean source snapshot (zip)..."
126
+ mkdir -p $(EXPORT_BASE)
127
+ git archive --format=zip -o $(EXPORT_BASE)/$(EXPORT_NAME).zip HEAD
128
+ @echo "Exported to $(EXPORT_BASE)/$(EXPORT_NAME).zip"
129
+
130
+ ###################
131
+ # Cleanup #
132
+ ###################
133
+
134
+ .PHONY: clean clean-all
135
+
136
+ clean: ## Remove build artifacts, caches, and reports
137
+ rm -rf build/ dist/ .eggs/ .pytest_cache/ .ruff_cache/ .coverage .coverage.* htmlcov/
138
+ find . -type d -name '*.egg-info' -exec rm -rf {} +
139
+ find . -type d -name '__pycache__' -exec rm -rf {} +
140
+ find . -type f -name '*.py[cod]' -delete
141
+ rm -f coverage.xml
142
+
143
+ clean-all: clean ## clean + remove the virtual environment and lock file
144
+ rm -rf .venv uv.lock
145
+
146
+ ###################
147
+ # Help #
148
+ ###################
149
+
150
+ .PHONY: help
151
+
152
+ help: ## Show this help message
153
+ @echo 'Usage: make [target]'
154
+ @echo ''
155
+ @echo 'Targets:'
156
+ @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-24s %s\n", $$1, $$2}' $(MAKEFILE_LIST)