live-rail 0.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 (71) hide show
  1. live_rail-0.0/.github/workflows/linting.yml +33 -0
  2. live_rail-0.0/.github/workflows/publish-to-pypi.yml +39 -0
  3. live_rail-0.0/.github/workflows/smoke-test.yml +36 -0
  4. live_rail-0.0/.github/workflows/testing-and-coverage.yml +39 -0
  5. live_rail-0.0/.gitignore +215 -0
  6. live_rail-0.0/CLAUDE.md +99 -0
  7. live_rail-0.0/LICENSE +21 -0
  8. live_rail-0.0/PKG-INFO +157 -0
  9. live_rail-0.0/README.md +94 -0
  10. live_rail-0.0/nb/catalogs.yaml +248 -0
  11. live_rail-0.0/nb/default_catalogs.yaml +186 -0
  12. live_rail-0.0/nb/sandbox_catalogs.yaml +107 -0
  13. live_rail-0.0/pyproject.toml +110 -0
  14. live_rail-0.0/scripts/setup_pzdc.py +107 -0
  15. live_rail-0.0/setup.cfg +4 -0
  16. live_rail-0.0/src/live_rail/__init__.py +0 -0
  17. live_rail-0.0/src/live_rail/_version.py +24 -0
  18. live_rail-0.0/src/live_rail/app.py +32 -0
  19. live_rail-0.0/src/live_rail/backend/__init__.py +5 -0
  20. live_rail-0.0/src/live_rail/backend/provider.py +151 -0
  21. live_rail-0.0/src/live_rail/cli/commands.py +45 -0
  22. live_rail-0.0/src/live_rail/cli/options.py +70 -0
  23. live_rail-0.0/src/live_rail/dashboard/__init__.py +5 -0
  24. live_rail-0.0/src/live_rail/dashboard/app.py +23 -0
  25. live_rail-0.0/src/live_rail/dashboard/assets/horse.png +0 -0
  26. live_rail-0.0/src/live_rail/dashboard/layout.py +58 -0
  27. live_rail-0.0/src/live_rail/dashboard/nav.py +68 -0
  28. live_rail-0.0/src/live_rail/dashboard/pages/__init__.py +0 -0
  29. live_rail-0.0/src/live_rail/dashboard/pages/crud/__init__.py +0 -0
  30. live_rail-0.0/src/live_rail/dashboard/pages/crud/_base.py +286 -0
  31. live_rail-0.0/src/live_rail/dashboard/pages/crud/_components.py +287 -0
  32. live_rail-0.0/src/live_rail/dashboard/pages/crud/algorithm.py +18 -0
  33. live_rail-0.0/src/live_rail/dashboard/pages/crud/band.py +18 -0
  34. live_rail-0.0/src/live_rail/dashboard/pages/crud/catalog_band_assoc.py +19 -0
  35. live_rail-0.0/src/live_rail/dashboard/pages/crud/catalog_tag.py +18 -0
  36. live_rail-0.0/src/live_rail/dashboard/pages/crud/dataset.py +130 -0
  37. live_rail-0.0/src/live_rail/dashboard/pages/crud/dataset_assoc.py +18 -0
  38. live_rail-0.0/src/live_rail/dashboard/pages/crud/estimates.py +19 -0
  39. live_rail-0.0/src/live_rail/dashboard/pages/crud/estimator.py +19 -0
  40. live_rail-0.0/src/live_rail/dashboard/pages/crud/model.py +20 -0
  41. live_rail-0.0/src/live_rail/dashboard/pages/estimation/__init__.py +0 -0
  42. live_rail-0.0/src/live_rail/dashboard/pages/estimation/estimate_dataset.py +91 -0
  43. live_rail-0.0/src/live_rail/dashboard/pages/estimation/estimate_ensemble.py +84 -0
  44. live_rail-0.0/src/live_rail/dashboard/pages/estimation/estimate_pdf.py +109 -0
  45. live_rail-0.0/src/live_rail/dashboard/pages/home.py +49 -0
  46. live_rail-0.0/src/live_rail/dashboard/pages/settings.py +120 -0
  47. live_rail-0.0/src/live_rail/dashboard/pages/visualizers/__init__.py +0 -0
  48. live_rail-0.0/src/live_rail/dashboard/pages/visualizers/multi_catalog.py +457 -0
  49. live_rail-0.0/src/live_rail/dashboard/pages/visualizers/single_catalog.py +421 -0
  50. live_rail-0.0/src/live_rail/py.typed +0 -0
  51. live_rail-0.0/src/live_rail/rail_svc_utils.py +68 -0
  52. live_rail-0.0/src/live_rail/wrappers/__init__.py +7 -0
  53. live_rail-0.0/src/live_rail/wrappers/object_wrapper.py +249 -0
  54. live_rail-0.0/src/live_rail/wrappers/rail_svc_wrapper.py +177 -0
  55. live_rail-0.0/src/live_rail.egg-info/PKG-INFO +157 -0
  56. live_rail-0.0/src/live_rail.egg-info/SOURCES.txt +69 -0
  57. live_rail-0.0/src/live_rail.egg-info/dependency_links.txt +1 -0
  58. live_rail-0.0/src/live_rail.egg-info/entry_points.txt +2 -0
  59. live_rail-0.0/src/live_rail.egg-info/requires.txt +24 -0
  60. live_rail-0.0/src/live_rail.egg-info/top_level.txt +1 -0
  61. live_rail-0.0/tests/conftest.py +114 -0
  62. live_rail-0.0/tests/test_app.py +52 -0
  63. live_rail-0.0/tests/test_backend_provider.py +172 -0
  64. live_rail-0.0/tests/test_callbacks.py +282 -0
  65. live_rail-0.0/tests/test_cli.py +36 -0
  66. live_rail-0.0/tests/test_crud_base.py +170 -0
  67. live_rail-0.0/tests/test_crud_components.py +183 -0
  68. live_rail-0.0/tests/test_integration.py +163 -0
  69. live_rail-0.0/tests/test_object_wrapper.py +174 -0
  70. live_rail-0.0/tests/test_rail_svc_utils.py +81 -0
  71. live_rail-0.0/tests/test_rail_svc_wrapper.py +142 -0
@@ -0,0 +1,33 @@
1
+ # This workflow will install Python dependencies,
2
+ # then perform static linting analysis.
3
+
4
+ name: Lint
5
+
6
+ on:
7
+ push:
8
+ branches: [main]
9
+ pull_request:
10
+ branches: [main]
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v3
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v4
19
+ with:
20
+ python-version: '3.13'
21
+ - name: Install dependencies
22
+ run: |
23
+ sudo apt-get update
24
+ python -m pip install --upgrade pip
25
+ pip install .
26
+ pip install .[dev]
27
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28
+ - name: Type checking
29
+ run: |
30
+ mypy src
31
+ - name: Linting
32
+ run: |
33
+ ruff check src tests
@@ -0,0 +1,39 @@
1
+ # This workflow will upload a Python Package using
2
+ # Twine when a release is created
3
+ # For more information see:
4
+ # https://github.com/pypa/gh-action-pypi-publish#trusted-publishing
5
+
6
+ # This workflow uses actions that are not certified by GitHub.
7
+ # They are provided by a third-party and are governed by
8
+ # separate terms of service, privacy policy, and support
9
+ # documentation.
10
+
11
+ name: Upload Python Package
12
+
13
+ on:
14
+ release:
15
+ types: [published]
16
+
17
+ permissions:
18
+ contents: read
19
+
20
+ jobs:
21
+ deploy:
22
+
23
+ runs-on: ubuntu-latest
24
+ permissions:
25
+ id-token: write
26
+ steps:
27
+ - uses: actions/checkout@v3
28
+ - name: Set up Python
29
+ uses: actions/setup-python@v4
30
+ with:
31
+ python-version: '3.13'
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,36 @@
1
+ # This workflow will run daily at 06:45.
2
+ # It will install Python dependencies and run tests with a variety of
3
+ # Python versions.
4
+
5
+ name: Unit test smoke test
6
+
7
+ on:
8
+ schedule:
9
+ - cron: 45 6 * * *
10
+
11
+ # Allows you to run this workflow manually from the Actions tab
12
+ workflow_dispatch:
13
+
14
+ jobs:
15
+ build:
16
+
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ['3.13']
21
+ steps:
22
+ - uses: actions/checkout@v3
23
+ - name: Set up Python ${{ matrix.python-version }}
24
+ uses: actions/setup-python@v4
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ - name: Install dependencies
28
+ run: |
29
+ sudo apt-get update
30
+ python -m pip install --upgrade pip
31
+ pip install .
32
+ pip install .[dev]
33
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34
+ - name: Run unit tests with pytest
35
+ run: |
36
+ python -m pytest tests
@@ -0,0 +1,39 @@
1
+ # This workflow will install Python dependencies, run tests and report
2
+ # code coverage with a variety of Python versions
3
+
4
+ name: Unit test and code coverage
5
+
6
+ on:
7
+ schedule:
8
+ - cron: 45 7 * * 1
9
+ push:
10
+ branches: [main]
11
+ pull_request:
12
+ branches: [main]
13
+
14
+ jobs:
15
+ build:
16
+
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ['3.13']
21
+ steps:
22
+ - uses: actions/checkout@v3
23
+ with:
24
+ fetch-tags: true
25
+ fetch-depth: 0
26
+ - name: Set up Python ${{ matrix.python-version }}
27
+ uses: actions/setup-python@v4
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+ - name: Install dependencies
31
+ run: |
32
+ sudo apt-get update
33
+ python -m pip install --upgrade pip
34
+ pip install .
35
+ pip install .[dev]
36
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
37
+ - name: Run unit tests with pytest
38
+ run: |
39
+ python -m pytest tests
@@ -0,0 +1,215 @@
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
+ _version.py
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
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # specific stuff
31
+ rail_svc.db
32
+ sandbox.tgz
33
+ archive/
34
+ data/
35
+ projects/
36
+
37
+ # PyInstaller
38
+ # Usually these files are written by a python script from a template
39
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
40
+ *.manifest
41
+ *.spec
42
+
43
+ # Installer logs
44
+ pip-log.txt
45
+ pip-delete-this-directory.txt
46
+
47
+ # Unit test / coverage reports
48
+ htmlcov/
49
+ .tox/
50
+ .nox/
51
+ .coverage
52
+ .coverage.*
53
+ .cache
54
+ nosetests.xml
55
+ coverage.xml
56
+ *.cover
57
+ *.py.cover
58
+ .hypothesis/
59
+ .pytest_cache/
60
+ cover/
61
+
62
+ # Translations
63
+ *.mo
64
+ *.pot
65
+
66
+ # Django stuff:
67
+ *.log
68
+ local_settings.py
69
+ db.sqlite3
70
+ db.sqlite3-journal
71
+
72
+ # Flask stuff:
73
+ instance/
74
+ .webassets-cache
75
+
76
+ # Scrapy stuff:
77
+ .scrapy
78
+
79
+ # Sphinx documentation
80
+ docs/_build/
81
+
82
+ # PyBuilder
83
+ .pybuilder/
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # pyenv
94
+ # For a library or package, you might want to ignore these files since the code is
95
+ # intended to run in multiple environments; otherwise, check them in:
96
+ # .python-version
97
+
98
+ # pipenv
99
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
101
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
102
+ # install all needed dependencies.
103
+ #Pipfile.lock
104
+
105
+ # UV
106
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
107
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
108
+ # commonly ignored for libraries.
109
+ #uv.lock
110
+
111
+ # poetry
112
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
113
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
114
+ # commonly ignored for libraries.
115
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
116
+ #poetry.lock
117
+ #poetry.toml
118
+
119
+ # pdm
120
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
121
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
122
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
123
+ #pdm.lock
124
+ #pdm.toml
125
+ .pdm-python
126
+ .pdm-build/
127
+
128
+ # pixi
129
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
130
+ #pixi.lock
131
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
132
+ # in the .venv directory. It is recommended not to include this directory in version control.
133
+ .pixi
134
+
135
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
136
+ __pypackages__/
137
+
138
+ # Celery stuff
139
+ celerybeat-schedule
140
+ celerybeat.pid
141
+
142
+ # SageMath parsed files
143
+ *.sage.py
144
+
145
+ # Environments
146
+ .env
147
+ .envrc
148
+ .venv
149
+ env/
150
+ venv/
151
+ ENV/
152
+ env.bak/
153
+ venv.bak/
154
+
155
+ # Spyder project settings
156
+ .spyderproject
157
+ .spyproject
158
+
159
+ # Rope project settings
160
+ .ropeproject
161
+
162
+ # mkdocs documentation
163
+ /site
164
+
165
+ # mypy
166
+ .mypy_cache/
167
+ .dmypy.json
168
+ dmypy.json
169
+
170
+ # Pyre type checker
171
+ .pyre/
172
+
173
+ # pytype static type analyzer
174
+ .pytype/
175
+
176
+ # Cython debug symbols
177
+ cython_debug/
178
+
179
+ # PyCharm
180
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
181
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
182
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
183
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
184
+ #.idea/
185
+
186
+ # Abstra
187
+ # Abstra is an AI-powered process automation framework.
188
+ # Ignore directories containing user credentials, local state, and settings.
189
+ # Learn more at https://abstra.io/docs
190
+ .abstra/
191
+
192
+ # Visual Studio Code
193
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
194
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
195
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
196
+ # you could uncomment the following to ignore the entire vscode folder
197
+ # .vscode/
198
+
199
+ # Ruff stuff:
200
+ .ruff_cache/
201
+
202
+ # PyPI configuration file
203
+ .pypirc
204
+
205
+ # Cursor
206
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
207
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
208
+ # refer to https://docs.cursor.com/context/ignore-files
209
+ .cursorignore
210
+ .cursorindexingignore
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
@@ -0,0 +1,99 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ `live-rail` is a unified Dash dashboard for managing and visualizing photometric redshift (photo-z) estimation data from the LSST DESC RAIL framework. It provides CRUD management of catalog entities, estimation workflow execution, and interactive visualization — all backed by the `pz-rail-svc` package for data access.
8
+
9
+ ## Build & Development Commands
10
+
11
+ ```bash
12
+ # Install in development mode
13
+ pip install -e '.[dev]'
14
+
15
+ # Run the dashboard (local DB)
16
+ live-rail dashboard --backend local --db-url "sqlite+aiosqlite:///rail_svc.db"
17
+
18
+ # Run unit tests (excludes integration tests)
19
+ pytest
20
+
21
+ # Run integration tests (requires real DB + data files)
22
+ pytest tests/test_integration.py -m integration -v
23
+
24
+ # Run all tests together
25
+ pytest -m "integration or not integration"
26
+
27
+ # Lint
28
+ ruff check src/ tests/
29
+ ruff format src/ tests/
30
+
31
+ # Type checking
32
+ mypy src/
33
+
34
+ # Pylint
35
+ pylint src/live_rail/ --rcfile=pyproject.toml
36
+ ```
37
+
38
+ ## Architecture
39
+
40
+ ```
41
+ src/live_rail/
42
+ ├── app.py # Direct entry point (python -m live_rail.app)
43
+ ├── rail_svc_utils.py # Database setup helpers (safe_insert_*)
44
+ ├── backend/
45
+ │ └── provider.py # BackendProvider singleton — switches local_sync/remote_sync
46
+ ├── cli/
47
+ │ └── commands.py # Click CLI with 'dashboard' command
48
+ ├── wrappers/
49
+ │ ├── object_wrapper.py # ObjectWrapper, CatalogWrapper, MultiCatalogWrapper ABCs
50
+ │ └── rail_svc_wrapper.py # RailSvcLocal/RemoteCatalogWrapper implementations
51
+ └── dashboard/
52
+ ├── app.py # Dash app factory (create_app, use_pages=True)
53
+ ├── layout.py # Top-level layout: sidebar + page_container + logo
54
+ ├── nav.py # Sidebar navigation
55
+ └── pages/
56
+ ├── home.py # Landing page with connection status
57
+ ├── settings.py # Backend mode/URL configuration
58
+ ├── crud/
59
+ │ ├── _base.py # CrudPageConfig + register_crud_callbacks factory
60
+ │ ├── _components.py # AG Grid table, form builders, modals
61
+ │ └── *.py # One file per entity (algorithm, dataset, etc.)
62
+ ├── estimation/ # Estimate PDF, Ensemble, Dataset pages
63
+ └── visualizers/ # Single + Multi catalog interactive visualizers
64
+ ```
65
+
66
+ ### Key Design Patterns
67
+
68
+ - **BackendProvider singleton** (`backend/provider.py`): All data access goes through `BackendProvider.get()` which dispatches to `rail_svc.local_sync` or `rail_svc.remote_sync` based on settings.
69
+ - **CRUD page factory** (`pages/crud/_base.py`): `register_crud_callbacks(config)` generates all callbacks from a `CrudPageConfig` dataclass. Each entity page is ~15 lines.
70
+ - **AG Grid tables**: Using `dash-ag-grid` with `cellClicked` for detail popups and FK lookups.
71
+ - **Wrapper caching**: Visualizer pages cache `RailSvcLocalCatalogWrapper` instances per dataset_id to avoid re-initialization on every callback.
72
+ - **Dash Pages**: Multi-page app with `use_pages=True`. Pages auto-register via `dash.register_page()` at module import time.
73
+
74
+ ## Configuration
75
+
76
+ - `--backend local|remote` — which rail_svc backend to use
77
+ - `--db-url` — SQLite URL for local mode (default: `sqlite+aiosqlite:///rail_svc.db`)
78
+ - `--server-url` — FastAPI server URL for remote mode
79
+ - `--catalog-yaml` — RAIL catalog YAML config (default: `nb/sandbox_catalogs.yaml`)
80
+
81
+ ## Testing
82
+
83
+ - Unit tests mock all `rail_svc` dependencies and run in <2s
84
+ - Integration tests require `rail_svc.db` + `nb/sandbox_catalogs.yaml` + HDF5 data files
85
+ - Integration tests are marked with `@pytest.mark.integration` and excluded from default runs
86
+ - Dash page modules can't be imported at top level in tests (triggers `register_page` error) — import inside test methods after creating a Dash app
87
+
88
+ ## Code Style
89
+
90
+ - Line length: 110 (ruff + pylint)
91
+ - Ruff with E, F, W, I rules (includes isort)
92
+ - mypy with `disallow_untyped_defs = false` (Dash callbacks are untyped)
93
+ - Pylint at 10.00/10
94
+
95
+ ## Data Files Required for Integration Tests
96
+
97
+ - `rail_svc.db` — SQLite database with catalog entities
98
+ - `nb/sandbox_catalogs.yaml` — RAIL catalog tag definitions
99
+ - HDF5 data files referenced by dataset paths in the DB (at absolute paths on disk)
live_rail-0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LSST Dark Energy Science Collaboration (DESC)
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.
live_rail-0.0/PKG-INFO ADDED
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: live-rail
3
+ Version: 0.0
4
+ Summary: Unified dashboard for RAIL photometric redshift estimation
5
+ Author-email: The LSST DESC PZ WG <echarles@slac.stanford.edu>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 LSST Dark Energy Science Collaboration (DESC)
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Classifier: Development Status :: 4 - Beta
29
+ Classifier: License :: OSI Approved :: MIT License
30
+ Classifier: Intended Audience :: Developers
31
+ Classifier: Intended Audience :: Science/Research
32
+ Classifier: Programming Language :: Python
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Programming Language :: Python :: 3.13
35
+ Classifier: Natural Language :: English
36
+ Classifier: Operating System :: POSIX
37
+ Requires-Python: >=3.13
38
+ Description-Content-Type: text/markdown
39
+ License-File: LICENSE
40
+ Requires-Dist: pz-rail-base>=2.0
41
+ Requires-Dist: plotly
42
+ Requires-Dist: click
43
+ Requires-Dist: dash[ag-grid]
44
+ Requires-Dist: pz-rail-svc[all]
45
+ Requires-Dist: qp-prob[full]
46
+ Provides-Extra: dev
47
+ Requires-Dist: coverage; extra == "dev"
48
+ Requires-Dist: pytest; extra == "dev"
49
+ Requires-Dist: pytest-cov; extra == "dev"
50
+ Requires-Dist: ruff; extra == "dev"
51
+ Requires-Dist: mypy; extra == "dev"
52
+ Requires-Dist: pylint; extra == "dev"
53
+ Requires-Dist: pre-commit; extra == "dev"
54
+ Provides-Extra: docs
55
+ Requires-Dist: nbsphinx; extra == "docs"
56
+ Requires-Dist: sphinx; extra == "docs"
57
+ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
58
+ Requires-Dist: sphinx_rtd_theme; extra == "docs"
59
+ Requires-Dist: sphinx-autoapi; extra == "docs"
60
+ Requires-Dist: sphinx-tabs; extra == "docs"
61
+ Requires-Dist: sphinx-click; extra == "docs"
62
+ Dynamic: license-file
63
+
64
+ # live-rail
65
+
66
+ Unified dashboard for RAIL photometric redshift estimation catalog management and visualization.
67
+
68
+ ## Overview
69
+
70
+ `live-rail` provides a multi-page Dash web application for:
71
+
72
+ - **CRUD management** of photo-z catalog entities (algorithms, bands, catalog tags, datasets, models, estimators, estimates)
73
+ - **Estimation workflows** — run photo-z PDF estimation, ensemble estimation, and full dataset estimation
74
+ - **Interactive visualization** — single-catalog and multi-catalog photometric spectrum, color-color diagrams, and redshift PDF comparison
75
+
76
+ All backed by the `pz-rail-svc` package, supporting both local SQLite database access and remote FastAPI server access.
77
+
78
+ ## Installation
79
+
80
+ ```bash
81
+ pip install -e '.[dev]'
82
+ ```
83
+
84
+ ## Quick Start
85
+
86
+ ```bash
87
+
88
+ # Download data set set up local SQLite DB
89
+ python scripts/setup_pzdc.py
90
+
91
+ # Launch the dashboard (uses local SQLite DB)
92
+ live-rail dashboard --backend local --db-url "sqlite+aiosqlite:///rail_svc.db"
93
+
94
+ # With RAIL catalog config for live estimators
95
+ live-rail dashboard --catalog-yaml nb/sandbox_catalogs.yaml
96
+
97
+ # Connect to a remote rail_svc server
98
+ live-rail dashboard --backend remote --server-url http://localhost:8000
99
+ ```
100
+
101
+ Then open http://127.0.0.1:8050 in your browser.
102
+
103
+ ## Features
104
+
105
+ ### CRUD Tables
106
+ - AG Grid tables with sorting, filtering, and pagination
107
+ - Click entity names to see full details in a popup
108
+ - Click FK columns (model_id, dataset_id, etc.) to see the referenced entity
109
+ - Create and delete entities via modal forms
110
+
111
+ ### Visualizers
112
+ - **Single Catalog**: Photometric spectrum, color-color diagram (all adjacent pairs), and redshift PDF estimates for any object in a dataset
113
+ - **Multi Catalog**: Same layout comparing across component catalogs in a matched (collection) dataset
114
+ - Navigate objects with slider or back/next buttons
115
+ - Pre-computed and live estimator PDFs with true redshift overlay
116
+
117
+ ### Estimation
118
+ - Run photo-z PDF estimation for a single object
119
+ - Run ensemble estimation for an entire catalog
120
+ - Run full dataset estimation (creates estimates record in DB)
121
+
122
+ ## Development
123
+
124
+ ```bash
125
+ # Run unit tests
126
+ pytest
127
+
128
+ # Run integration tests (requires real DB + data files)
129
+ pytest -m integration
130
+
131
+ # Lint & format
132
+ ruff check src/ tests/
133
+ ruff format src/ tests/
134
+
135
+ # Type check
136
+ mypy src/
137
+
138
+ # Pylint
139
+ pylint src/live_rail/ --rcfile=pyproject.toml
140
+ ```
141
+
142
+ ## Project Structure
143
+
144
+ ```
145
+ src/live_rail/
146
+ ├── backend/ # BackendProvider — switches between local/remote rail_svc
147
+ ├── cli/ # Click CLI (live-rail dashboard)
148
+ ├── dashboard/ # Dash multi-page app
149
+ │ ├── pages/crud/ # CRUD pages for each entity
150
+ │ ├── pages/estimation/ # Estimation workflow pages
151
+ │ └── pages/visualizers/ # Interactive visualizer pages
152
+ └── wrappers/ # CatalogWrapper abstractions for data access
153
+ ```
154
+
155
+ ## License
156
+
157
+ MIT