lorax-arg 0.1__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 (72) hide show
  1. lorax_arg-0.1/PKG-INFO +131 -0
  2. lorax_arg-0.1/README.md +176 -0
  3. lorax_arg-0.1/lorax_arg.egg-info/PKG-INFO +131 -0
  4. lorax_arg-0.1/lorax_arg.egg-info/SOURCES.txt +70 -0
  5. lorax_arg-0.1/lorax_arg.egg-info/dependency_links.txt +1 -0
  6. lorax_arg-0.1/lorax_arg.egg-info/entry_points.txt +4 -0
  7. lorax_arg-0.1/lorax_arg.egg-info/requires.txt +31 -0
  8. lorax_arg-0.1/lorax_arg.egg-info/top_level.txt +2 -0
  9. lorax_arg-0.1/packages/app/README.md +92 -0
  10. lorax_arg-0.1/packages/app/lorax_app/__init__.py +4 -0
  11. lorax_arg-0.1/packages/app/lorax_app/app.py +159 -0
  12. lorax_arg-0.1/packages/app/lorax_app/cli.py +114 -0
  13. lorax_arg-0.1/packages/app/lorax_app/static/X.png +0 -0
  14. lorax_arg-0.1/packages/app/lorax_app/static/assets/index-BCEGlUFi.js +2361 -0
  15. lorax_arg-0.1/packages/app/lorax_app/static/assets/index-iKjzUpA9.css +1 -0
  16. lorax_arg-0.1/packages/app/lorax_app/static/assets/localBackendWorker-BaWwjSV_.js +2 -0
  17. lorax_arg-0.1/packages/app/lorax_app/static/assets/renderDataWorker-BKLdiU7J.js +2 -0
  18. lorax_arg-0.1/packages/app/lorax_app/static/gestures/gesture-flick.ogv +0 -0
  19. lorax_arg-0.1/packages/app/lorax_app/static/gestures/gesture-two-finger-scroll.ogv +0 -0
  20. lorax_arg-0.1/packages/app/lorax_app/static/index.html +14 -0
  21. lorax_arg-0.1/packages/app/lorax_app/static/logo.png +0 -0
  22. lorax_arg-0.1/packages/app/lorax_app/static/lorax-logo.png +0 -0
  23. lorax_arg-0.1/packages/app/lorax_app/static/vite.svg +1 -0
  24. lorax_arg-0.1/packages/backend/lorax/buffer.py +43 -0
  25. lorax_arg-0.1/packages/backend/lorax/cache/__init__.py +43 -0
  26. lorax_arg-0.1/packages/backend/lorax/cache/csv_tree_graph.py +59 -0
  27. lorax_arg-0.1/packages/backend/lorax/cache/disk.py +467 -0
  28. lorax_arg-0.1/packages/backend/lorax/cache/file_cache.py +142 -0
  29. lorax_arg-0.1/packages/backend/lorax/cache/file_context.py +72 -0
  30. lorax_arg-0.1/packages/backend/lorax/cache/lru.py +90 -0
  31. lorax_arg-0.1/packages/backend/lorax/cache/tree_graph.py +293 -0
  32. lorax_arg-0.1/packages/backend/lorax/cli.py +312 -0
  33. lorax_arg-0.1/packages/backend/lorax/cloud/__init__.py +0 -0
  34. lorax_arg-0.1/packages/backend/lorax/cloud/gcs_utils.py +205 -0
  35. lorax_arg-0.1/packages/backend/lorax/constants.py +66 -0
  36. lorax_arg-0.1/packages/backend/lorax/context.py +80 -0
  37. lorax_arg-0.1/packages/backend/lorax/csv/__init__.py +7 -0
  38. lorax_arg-0.1/packages/backend/lorax/csv/config.py +250 -0
  39. lorax_arg-0.1/packages/backend/lorax/csv/layout.py +182 -0
  40. lorax_arg-0.1/packages/backend/lorax/csv/newick_tree.py +234 -0
  41. lorax_arg-0.1/packages/backend/lorax/handlers.py +998 -0
  42. lorax_arg-0.1/packages/backend/lorax/lineage.py +456 -0
  43. lorax_arg-0.1/packages/backend/lorax/loaders/__init__.py +0 -0
  44. lorax_arg-0.1/packages/backend/lorax/loaders/csv_loader.py +10 -0
  45. lorax_arg-0.1/packages/backend/lorax/loaders/loader.py +31 -0
  46. lorax_arg-0.1/packages/backend/lorax/loaders/tskit_loader.py +119 -0
  47. lorax_arg-0.1/packages/backend/lorax/lorax_app.py +75 -0
  48. lorax_arg-0.1/packages/backend/lorax/manager.py +58 -0
  49. lorax_arg-0.1/packages/backend/lorax/metadata/__init__.py +0 -0
  50. lorax_arg-0.1/packages/backend/lorax/metadata/loader.py +426 -0
  51. lorax_arg-0.1/packages/backend/lorax/metadata/mutations.py +146 -0
  52. lorax_arg-0.1/packages/backend/lorax/modes.py +190 -0
  53. lorax_arg-0.1/packages/backend/lorax/pg.py +183 -0
  54. lorax_arg-0.1/packages/backend/lorax/redis_utils.py +30 -0
  55. lorax_arg-0.1/packages/backend/lorax/routes.py +137 -0
  56. lorax_arg-0.1/packages/backend/lorax/session_manager.py +206 -0
  57. lorax_arg-0.1/packages/backend/lorax/sockets/__init__.py +55 -0
  58. lorax_arg-0.1/packages/backend/lorax/sockets/connection.py +99 -0
  59. lorax_arg-0.1/packages/backend/lorax/sockets/debug.py +47 -0
  60. lorax_arg-0.1/packages/backend/lorax/sockets/decorators.py +112 -0
  61. lorax_arg-0.1/packages/backend/lorax/sockets/file_ops.py +200 -0
  62. lorax_arg-0.1/packages/backend/lorax/sockets/lineage.py +307 -0
  63. lorax_arg-0.1/packages/backend/lorax/sockets/metadata.py +232 -0
  64. lorax_arg-0.1/packages/backend/lorax/sockets/mutations.py +154 -0
  65. lorax_arg-0.1/packages/backend/lorax/sockets/node_search.py +535 -0
  66. lorax_arg-0.1/packages/backend/lorax/sockets/tree_layout.py +117 -0
  67. lorax_arg-0.1/packages/backend/lorax/sockets/utils.py +10 -0
  68. lorax_arg-0.1/packages/backend/lorax/tree_graph/__init__.py +12 -0
  69. lorax_arg-0.1/packages/backend/lorax/tree_graph/tree_graph.py +689 -0
  70. lorax_arg-0.1/packages/backend/lorax/utils.py +124 -0
  71. lorax_arg-0.1/pyproject.toml +65 -0
  72. lorax_arg-0.1/setup.cfg +4 -0
lorax_arg-0.1/PKG-INFO ADDED
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: lorax-arg
3
+ Version: 0.1
4
+ Summary: Lorax single-port app (bundled UI + backend)
5
+ Author: Lorax Team
6
+ License: MIT
7
+ Keywords: lorax,arg,visualization,evolution,genomics,biology
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: fastapi>=0.100.0
11
+ Requires-Dist: uvicorn>=0.20.0
12
+ Requires-Dist: python-socketio>=5.0.0
13
+ Requires-Dist: python-dotenv>=1.0.0
14
+ Requires-Dist: click>=8.0.0
15
+ Requires-Dist: aiofiles>=24.0.0
16
+ Requires-Dist: aiohttp>=3.0.0
17
+ Requires-Dist: numpy>=2.0.0
18
+ Requires-Dist: pandas>=2.0.0
19
+ Requires-Dist: pyarrow>=18.0.0
20
+ Requires-Dist: tskit>=1.0.0
21
+ Requires-Dist: tszip>=0.2.0
22
+ Requires-Dist: redis>=5.0.0
23
+ Requires-Dist: google-cloud-storage>=3.0.0
24
+ Requires-Dist: starlette>=0.40.0
25
+ Requires-Dist: psutil>=5.0.0
26
+ Requires-Dist: ete3>=3.1.0
27
+ Requires-Dist: numba>0.57.1
28
+ Requires-Dist: python-multipart>=0.0.10
29
+ Provides-Extra: prod
30
+ Requires-Dist: gunicorn>=23.0.0; extra == "prod"
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
33
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
34
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
35
+ Requires-Dist: httpx>=0.24.0; extra == "dev"
36
+ Requires-Dist: locust>=2.15.0; extra == "dev"
37
+ Requires-Dist: python-socketio[client]>=5.0.0; extra == "dev"
38
+ Requires-Dist: msprime>=1.2.0; extra == "dev"
39
+
40
+ # lorax-arg
41
+
42
+ `lorax-arg` is a pip-installable distribution that runs Lorax as a **single-port app**.
43
+ It ships the backend package in the same wheel so the install does not depend on a separate `lorax` PyPI release.
44
+ CLI entrypoint: `lorax` (with `lorax-arg` as an alias).
45
+
46
+ - React UI served at `/`
47
+ - Backend API served at `/api/*`
48
+ - Socket.IO served at `/api/socket.io/`
49
+
50
+ ## Development (monorepo)
51
+
52
+ This package can run against the backend Python package from `packages/backend/` during development.
53
+
54
+ ### Build + sync UI assets (for wheel builds)
55
+
56
+ Build the website with `VITE_API_BASE=/api`, then copy the `dist/` output into the Python package:
57
+
58
+ ```bash
59
+ npm ci
60
+ VITE_API_BASE=/api npm --workspace packages/website run build
61
+ python packages/app/scripts/sync_ui_assets.py
62
+ ```
63
+
64
+ ### Run from source without copying assets
65
+
66
+ ```bash
67
+ export LORAX_APP_STATIC_DIR=packages/website/dist
68
+ python -m pip install -e .
69
+ lorax
70
+ ```
71
+
72
+ ## Clean (remove build artifacts)
73
+
74
+ ```bash
75
+ rm -rf build dist *.egg-info
76
+ find packages/app -type d -name __pycache__ -prune -exec rm -rf {} +
77
+ ```
78
+
79
+ ## Production build (bundled UI)
80
+
81
+ Build the UI and bundle it into the Python package, then build the wheel/sdist:
82
+
83
+ ```bash
84
+ npm ci
85
+ VITE_API_BASE=/api npm --workspace packages/website run build
86
+ python packages/app/scripts/sync_ui_assets.py
87
+
88
+ python -m pip install -U build
89
+ python -m build .
90
+ ```
91
+
92
+ You can also run:
93
+
94
+ ```bash
95
+ lorax build
96
+ ```
97
+
98
+ ## Production install
99
+
100
+ Install the built wheel locally (recommended for production verification):
101
+
102
+ ```bash
103
+ python -m pip install --force-reinstall dist/lorax_arg-*.whl
104
+ lorax
105
+ ```
106
+
107
+ ## Publish online (PyPI)
108
+
109
+ 1) Update `version` in the repo-root `pyproject.toml`.
110
+ 2) Build fresh artifacts:
111
+
112
+ ```bash
113
+ rm -rf build dist *.egg-info
114
+ npm ci
115
+ VITE_API_BASE=/api npm --workspace packages/website run build
116
+ python packages/app/scripts/sync_ui_assets.py
117
+ python -m pip install -U build twine
118
+ python -m build .
119
+ ```
120
+
121
+ 3) Upload to TestPyPI (recommended), then PyPI:
122
+
123
+ ```bash
124
+ python -m twine upload --repository testpypi dist/*
125
+ # verify: python -m pip install -i https://test.pypi.org/simple lorax-arg
126
+ python -m twine upload dist/*
127
+ ```
128
+
129
+ Notes:
130
+ - You need PyPI credentials (or a token) configured in `~/.pypirc` or via `TWINE_USERNAME`/`TWINE_PASSWORD`.
131
+ - Keep `README.md` and metadata in sync with what you want on PyPI.
@@ -0,0 +1,176 @@
1
+ # Lorax
2
+
3
+ **Lorax** is an essential tool for the **interactive exploration and visualization of Ancestral Recombination Graphs (ARGs)**.
4
+
5
+ > Visit the official Lorax Website: [https://lorax.in/](https://lorax.in/)
6
+
7
+ ## Local Installation and Usage
8
+
9
+ ### Option 1: Using the Pre-built Docker Image (Recommended)
10
+
11
+ The simplest way to get started is by pulling the image directly from Docker Hub.
12
+
13
+ ```bash
14
+ docker pull pratikkatte7/lorax
15
+ ```
16
+ ### Option 2: Building the Docker Image from Source
17
+
18
+ If you prefer to build the image locally, follow these steps:
19
+
20
+ 1. Clone the Repository
21
+ ```bash
22
+ git clone https://github.com/pratikkatte/lorax.git
23
+ cd lorax
24
+ ```
25
+ 2. Built the docker image.
26
+
27
+ ```bash
28
+ docker build -t lorax .
29
+ ```
30
+
31
+ ### Running Lorax and Accessing the Interface
32
+
33
+ Once the Docker image is available (either pulled or built), you can run the container and access the web interface.
34
+
35
+ #### Running the Container
36
+
37
+ Use the following command to run Lorax. It maps the container's internal port 80 to your machine's port 80 (or any other port you specify).
38
+
39
+ ```bash
40
+ # Maps container port 80 to host port 80
41
+ docker run -it -p 80:80 lorax
42
+ ```
43
+
44
+ > ⚠️ Note: If port 80 is in use on your system, you can choose a different host port, such as 5173:
45
+ > ```bash
46
+ > docker run -it -p 5173:80 lorax
47
+ > ```
48
+ -- The tool can be accessed via http://localhost:80. You can provide any other port. For instance 5173, http://localhost:5173
49
+
50
+ ### Accessing the Tool
51
+
52
+ After running the container, open your web browser and navigate to the appropriate address:
53
+
54
+ - If you used port 80: http://localhost:80/
55
+ > If you used other port: http://localhost:[port]/
56
+
57
+ ## Using Your Own ARG Data Files
58
+ Lorax supports files in `.trees`, `.tsz` (tskit format) or `.csv` format.
59
+
60
+ 1. Simple File Upload via Web Interface
61
+
62
+ For smaller files, you can easily use the dedicated upload panel located within the Lorax web page once the tool is running.
63
+
64
+ 2. Mounting a Local Directory (Recommended for Large Datasets)
65
+
66
+ This method is the easiest and fastest when working with large ARG files, as it avoids slow web uploads by directly sharing your file system with the container.
67
+
68
+ To make a local directory of your data available inside the container, use the -v (volume mount) flag:
69
+
70
+ - Example: If your ARG files are located in a folder named ts_files in your current directory (`$(pwd)`), use this command:
71
+ > ```
72
+ > docker run -it -p 80:80 -v $(pwd)/ts_files:/app/UPLOADS/ts_files lorax
73
+ > ```
74
+
75
+ After the volume is mounted, your files will be accessible by Lorax when you use the interface.
76
+
77
+ ---
78
+
79
+ ## Monorepo Docker (single Dockerfile, two targets)
80
+
81
+ This repo can be built from the **repo-root `Dockerfile`** with two targets:
82
+ - **`full` (default)**: website + backend in one container (nginx on **:3000**)
83
+ - **`backend`**: backend-only image (API on **:8080**, for GCP)
84
+
85
+ ### Full image (website + backend, port 3000)
86
+
87
+ This image includes:
88
+ - `packages/backend` (FastAPI + Socket.IO) running internally on `127.0.0.1:8080`
89
+ - `packages/website` served by **nginx on port 3000**
90
+ - same-origin proxying so the browser only needs **port 3000**
91
+
92
+ ### Build
93
+
94
+ ```bash
95
+ docker build -t lorax-monorepo .
96
+ ```
97
+
98
+ ### Run
99
+
100
+ ```bash
101
+ docker run --rm -p 3000:3000 lorax-monorepo
102
+ ```
103
+
104
+ Then open: `http://localhost:3000`
105
+
106
+ ### Mount local data (recommended)
107
+
108
+ ```bash
109
+ docker run --rm -p 3000:3000 \
110
+ -v "$(pwd)/ts_files:/app/UPLOADS/ts_files" \
111
+ lorax-monorepo
112
+ ```
113
+
114
+ ---
115
+
116
+ ### Backend-only image (GCP, port 8080)
117
+
118
+ Build the backend-only target from the repo root:
119
+
120
+ ```bash
121
+ docker build --target backend -t lorax-backend .
122
+ ```
123
+
124
+ Run locally:
125
+
126
+ ```bash
127
+ docker run --rm -p 8080:8080 lorax-backend
128
+ ```
129
+
130
+ Then open: `http://localhost:8080`
131
+
132
+ ---
133
+
134
+ ## Pip (single-port app, port 3000)
135
+
136
+ This repo also contains a pip-installable single-port app distribution at `packages/app/` (named `lorax-arg`).
137
+
138
+ - **UI**: served at `/`
139
+ - **Backend API**: served at `/api/*`
140
+ - **Socket.IO**: served at `/api/socket.io/`
141
+
142
+ ### Run from source (developer workflow)
143
+
144
+ ```bash
145
+ # Build website once (requires Node 20.19+ or 22.12+; Node 22 recommended)
146
+ npm ci
147
+ VITE_API_BASE=/api npm --workspace packages/website run build
148
+
149
+ # Install python packages
150
+ python -m pip install -e packages/backend
151
+ python -m pip install -e packages/app
152
+
153
+ # Run (uses packaged static assets by default)
154
+ lorax --port 3000
155
+ ```
156
+
157
+ ### Build a self-contained wheel
158
+
159
+ ```bash
160
+ # Build UI and sync into the Python package
161
+ npm ci
162
+ VITE_API_BASE=/api npm --workspace packages/website run build
163
+ python packages/app/scripts/sync_ui_assets.py
164
+
165
+ # Build wheel
166
+ python -m pip install build
167
+ python -m build .
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Maintainer
173
+
174
+ **Pratik Katte** \
175
+ Department of Biomolecular Engineering & Bioinformatics \
176
+ University of California, Santa Cruz
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: lorax-arg
3
+ Version: 0.1
4
+ Summary: Lorax single-port app (bundled UI + backend)
5
+ Author: Lorax Team
6
+ License: MIT
7
+ Keywords: lorax,arg,visualization,evolution,genomics,biology
8
+ Requires-Python: >=3.10
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: fastapi>=0.100.0
11
+ Requires-Dist: uvicorn>=0.20.0
12
+ Requires-Dist: python-socketio>=5.0.0
13
+ Requires-Dist: python-dotenv>=1.0.0
14
+ Requires-Dist: click>=8.0.0
15
+ Requires-Dist: aiofiles>=24.0.0
16
+ Requires-Dist: aiohttp>=3.0.0
17
+ Requires-Dist: numpy>=2.0.0
18
+ Requires-Dist: pandas>=2.0.0
19
+ Requires-Dist: pyarrow>=18.0.0
20
+ Requires-Dist: tskit>=1.0.0
21
+ Requires-Dist: tszip>=0.2.0
22
+ Requires-Dist: redis>=5.0.0
23
+ Requires-Dist: google-cloud-storage>=3.0.0
24
+ Requires-Dist: starlette>=0.40.0
25
+ Requires-Dist: psutil>=5.0.0
26
+ Requires-Dist: ete3>=3.1.0
27
+ Requires-Dist: numba>0.57.1
28
+ Requires-Dist: python-multipart>=0.0.10
29
+ Provides-Extra: prod
30
+ Requires-Dist: gunicorn>=23.0.0; extra == "prod"
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
33
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
34
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
35
+ Requires-Dist: httpx>=0.24.0; extra == "dev"
36
+ Requires-Dist: locust>=2.15.0; extra == "dev"
37
+ Requires-Dist: python-socketio[client]>=5.0.0; extra == "dev"
38
+ Requires-Dist: msprime>=1.2.0; extra == "dev"
39
+
40
+ # lorax-arg
41
+
42
+ `lorax-arg` is a pip-installable distribution that runs Lorax as a **single-port app**.
43
+ It ships the backend package in the same wheel so the install does not depend on a separate `lorax` PyPI release.
44
+ CLI entrypoint: `lorax` (with `lorax-arg` as an alias).
45
+
46
+ - React UI served at `/`
47
+ - Backend API served at `/api/*`
48
+ - Socket.IO served at `/api/socket.io/`
49
+
50
+ ## Development (monorepo)
51
+
52
+ This package can run against the backend Python package from `packages/backend/` during development.
53
+
54
+ ### Build + sync UI assets (for wheel builds)
55
+
56
+ Build the website with `VITE_API_BASE=/api`, then copy the `dist/` output into the Python package:
57
+
58
+ ```bash
59
+ npm ci
60
+ VITE_API_BASE=/api npm --workspace packages/website run build
61
+ python packages/app/scripts/sync_ui_assets.py
62
+ ```
63
+
64
+ ### Run from source without copying assets
65
+
66
+ ```bash
67
+ export LORAX_APP_STATIC_DIR=packages/website/dist
68
+ python -m pip install -e .
69
+ lorax
70
+ ```
71
+
72
+ ## Clean (remove build artifacts)
73
+
74
+ ```bash
75
+ rm -rf build dist *.egg-info
76
+ find packages/app -type d -name __pycache__ -prune -exec rm -rf {} +
77
+ ```
78
+
79
+ ## Production build (bundled UI)
80
+
81
+ Build the UI and bundle it into the Python package, then build the wheel/sdist:
82
+
83
+ ```bash
84
+ npm ci
85
+ VITE_API_BASE=/api npm --workspace packages/website run build
86
+ python packages/app/scripts/sync_ui_assets.py
87
+
88
+ python -m pip install -U build
89
+ python -m build .
90
+ ```
91
+
92
+ You can also run:
93
+
94
+ ```bash
95
+ lorax build
96
+ ```
97
+
98
+ ## Production install
99
+
100
+ Install the built wheel locally (recommended for production verification):
101
+
102
+ ```bash
103
+ python -m pip install --force-reinstall dist/lorax_arg-*.whl
104
+ lorax
105
+ ```
106
+
107
+ ## Publish online (PyPI)
108
+
109
+ 1) Update `version` in the repo-root `pyproject.toml`.
110
+ 2) Build fresh artifacts:
111
+
112
+ ```bash
113
+ rm -rf build dist *.egg-info
114
+ npm ci
115
+ VITE_API_BASE=/api npm --workspace packages/website run build
116
+ python packages/app/scripts/sync_ui_assets.py
117
+ python -m pip install -U build twine
118
+ python -m build .
119
+ ```
120
+
121
+ 3) Upload to TestPyPI (recommended), then PyPI:
122
+
123
+ ```bash
124
+ python -m twine upload --repository testpypi dist/*
125
+ # verify: python -m pip install -i https://test.pypi.org/simple lorax-arg
126
+ python -m twine upload dist/*
127
+ ```
128
+
129
+ Notes:
130
+ - You need PyPI credentials (or a token) configured in `~/.pypirc` or via `TWINE_USERNAME`/`TWINE_PASSWORD`.
131
+ - Keep `README.md` and metadata in sync with what you want on PyPI.
@@ -0,0 +1,70 @@
1
+ README.md
2
+ pyproject.toml
3
+ lorax_arg.egg-info/PKG-INFO
4
+ lorax_arg.egg-info/SOURCES.txt
5
+ lorax_arg.egg-info/dependency_links.txt
6
+ lorax_arg.egg-info/entry_points.txt
7
+ lorax_arg.egg-info/requires.txt
8
+ lorax_arg.egg-info/top_level.txt
9
+ packages/app/README.md
10
+ packages/app/lorax_app/__init__.py
11
+ packages/app/lorax_app/app.py
12
+ packages/app/lorax_app/cli.py
13
+ packages/app/lorax_app/static/X.png
14
+ packages/app/lorax_app/static/index.html
15
+ packages/app/lorax_app/static/logo.png
16
+ packages/app/lorax_app/static/lorax-logo.png
17
+ packages/app/lorax_app/static/vite.svg
18
+ packages/app/lorax_app/static/assets/index-BCEGlUFi.js
19
+ packages/app/lorax_app/static/assets/index-iKjzUpA9.css
20
+ packages/app/lorax_app/static/assets/localBackendWorker-BaWwjSV_.js
21
+ packages/app/lorax_app/static/assets/renderDataWorker-BKLdiU7J.js
22
+ packages/app/lorax_app/static/gestures/gesture-flick.ogv
23
+ packages/app/lorax_app/static/gestures/gesture-two-finger-scroll.ogv
24
+ packages/backend/lorax/buffer.py
25
+ packages/backend/lorax/cli.py
26
+ packages/backend/lorax/constants.py
27
+ packages/backend/lorax/context.py
28
+ packages/backend/lorax/handlers.py
29
+ packages/backend/lorax/lineage.py
30
+ packages/backend/lorax/lorax_app.py
31
+ packages/backend/lorax/manager.py
32
+ packages/backend/lorax/modes.py
33
+ packages/backend/lorax/pg.py
34
+ packages/backend/lorax/redis_utils.py
35
+ packages/backend/lorax/routes.py
36
+ packages/backend/lorax/session_manager.py
37
+ packages/backend/lorax/utils.py
38
+ packages/backend/lorax/cache/__init__.py
39
+ packages/backend/lorax/cache/csv_tree_graph.py
40
+ packages/backend/lorax/cache/disk.py
41
+ packages/backend/lorax/cache/file_cache.py
42
+ packages/backend/lorax/cache/file_context.py
43
+ packages/backend/lorax/cache/lru.py
44
+ packages/backend/lorax/cache/tree_graph.py
45
+ packages/backend/lorax/cloud/__init__.py
46
+ packages/backend/lorax/cloud/gcs_utils.py
47
+ packages/backend/lorax/csv/__init__.py
48
+ packages/backend/lorax/csv/config.py
49
+ packages/backend/lorax/csv/layout.py
50
+ packages/backend/lorax/csv/newick_tree.py
51
+ packages/backend/lorax/loaders/__init__.py
52
+ packages/backend/lorax/loaders/csv_loader.py
53
+ packages/backend/lorax/loaders/loader.py
54
+ packages/backend/lorax/loaders/tskit_loader.py
55
+ packages/backend/lorax/metadata/__init__.py
56
+ packages/backend/lorax/metadata/loader.py
57
+ packages/backend/lorax/metadata/mutations.py
58
+ packages/backend/lorax/sockets/__init__.py
59
+ packages/backend/lorax/sockets/connection.py
60
+ packages/backend/lorax/sockets/debug.py
61
+ packages/backend/lorax/sockets/decorators.py
62
+ packages/backend/lorax/sockets/file_ops.py
63
+ packages/backend/lorax/sockets/lineage.py
64
+ packages/backend/lorax/sockets/metadata.py
65
+ packages/backend/lorax/sockets/mutations.py
66
+ packages/backend/lorax/sockets/node_search.py
67
+ packages/backend/lorax/sockets/tree_layout.py
68
+ packages/backend/lorax/sockets/utils.py
69
+ packages/backend/lorax/tree_graph/__init__.py
70
+ packages/backend/lorax/tree_graph/tree_graph.py
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ lorax = lorax_app.cli:main
3
+ lorax-arg = lorax_app.cli:main
4
+ lorax-backend = lorax.cli:main
@@ -0,0 +1,31 @@
1
+ fastapi>=0.100.0
2
+ uvicorn>=0.20.0
3
+ python-socketio>=5.0.0
4
+ python-dotenv>=1.0.0
5
+ click>=8.0.0
6
+ aiofiles>=24.0.0
7
+ aiohttp>=3.0.0
8
+ numpy>=2.0.0
9
+ pandas>=2.0.0
10
+ pyarrow>=18.0.0
11
+ tskit>=1.0.0
12
+ tszip>=0.2.0
13
+ redis>=5.0.0
14
+ google-cloud-storage>=3.0.0
15
+ starlette>=0.40.0
16
+ psutil>=5.0.0
17
+ ete3>=3.1.0
18
+ numba>0.57.1
19
+ python-multipart>=0.0.10
20
+
21
+ [dev]
22
+ pytest>=7.0.0
23
+ pytest-asyncio>=0.21.0
24
+ pytest-cov>=4.0.0
25
+ httpx>=0.24.0
26
+ locust>=2.15.0
27
+ python-socketio[client]>=5.0.0
28
+ msprime>=1.2.0
29
+
30
+ [prod]
31
+ gunicorn>=23.0.0
@@ -0,0 +1,2 @@
1
+ lorax
2
+ lorax_app
@@ -0,0 +1,92 @@
1
+ # lorax-arg
2
+
3
+ `lorax-arg` is a pip-installable distribution that runs Lorax as a **single-port app**.
4
+ It ships the backend package in the same wheel so the install does not depend on a separate `lorax` PyPI release.
5
+ CLI entrypoint: `lorax` (with `lorax-arg` as an alias).
6
+
7
+ - React UI served at `/`
8
+ - Backend API served at `/api/*`
9
+ - Socket.IO served at `/api/socket.io/`
10
+
11
+ ## Development (monorepo)
12
+
13
+ This package can run against the backend Python package from `packages/backend/` during development.
14
+
15
+ ### Build + sync UI assets (for wheel builds)
16
+
17
+ Build the website with `VITE_API_BASE=/api`, then copy the `dist/` output into the Python package:
18
+
19
+ ```bash
20
+ npm ci
21
+ VITE_API_BASE=/api npm --workspace packages/website run build
22
+ python packages/app/scripts/sync_ui_assets.py
23
+ ```
24
+
25
+ ### Run from source without copying assets
26
+
27
+ ```bash
28
+ export LORAX_APP_STATIC_DIR=packages/website/dist
29
+ python -m pip install -e .
30
+ lorax
31
+ ```
32
+
33
+ ## Clean (remove build artifacts)
34
+
35
+ ```bash
36
+ rm -rf build dist *.egg-info
37
+ find packages/app -type d -name __pycache__ -prune -exec rm -rf {} +
38
+ ```
39
+
40
+ ## Production build (bundled UI)
41
+
42
+ Build the UI and bundle it into the Python package, then build the wheel/sdist:
43
+
44
+ ```bash
45
+ npm ci
46
+ VITE_API_BASE=/api npm --workspace packages/website run build
47
+ python packages/app/scripts/sync_ui_assets.py
48
+
49
+ python -m pip install -U build
50
+ python -m build .
51
+ ```
52
+
53
+ You can also run:
54
+
55
+ ```bash
56
+ lorax build
57
+ ```
58
+
59
+ ## Production install
60
+
61
+ Install the built wheel locally (recommended for production verification):
62
+
63
+ ```bash
64
+ python -m pip install --force-reinstall dist/lorax_arg-*.whl
65
+ lorax
66
+ ```
67
+
68
+ ## Publish online (PyPI)
69
+
70
+ 1) Update `version` in the repo-root `pyproject.toml`.
71
+ 2) Build fresh artifacts:
72
+
73
+ ```bash
74
+ rm -rf build dist *.egg-info
75
+ npm ci
76
+ VITE_API_BASE=/api npm --workspace packages/website run build
77
+ python packages/app/scripts/sync_ui_assets.py
78
+ python -m pip install -U build twine
79
+ python -m build .
80
+ ```
81
+
82
+ 3) Upload to TestPyPI (recommended), then PyPI:
83
+
84
+ ```bash
85
+ python -m twine upload --repository testpypi dist/*
86
+ # verify: python -m pip install -i https://test.pypi.org/simple lorax-arg
87
+ python -m twine upload dist/*
88
+ ```
89
+
90
+ Notes:
91
+ - You need PyPI credentials (or a token) configured in `~/.pypirc` or via `TWINE_USERNAME`/`TWINE_PASSWORD`.
92
+ - Keep `README.md` and metadata in sync with what you want on PyPI.
@@ -0,0 +1,4 @@
1
+ __all__ = ["__version__"]
2
+
3
+ __version__ = "0.1.0"
4
+