# Collider Dashboard
<p align="center">
<a href="https://opensource.org/license/mit/">
<img src="https://badgen.net/static/license/MIT/blue">
</a>
<a href="https://python-poetry.org/">
<img src="https://badgen.net/static/Package%20Manager/Poetry/orange">
</a>
<a href="https://dash.plotly.com/">
<img src="https://badgen.net/static/Dash/2.14.1/green">
</a>
<a href="https://black.readthedocs.io/en/stable/">
<img src="https://badgen.net/static/Code%20style/Black/black">
</a>
<img src="https://badgen.net/github/release/colasdroin/collider-dashboard">
<img src="https://badgen.net/github/commits/colasdroin/collider-dashboard">
</p>
A Dash application to visualize the observables and parameters of a collider built and configured with Xsuite.
## Installation
The dashboard can be installed from PyPI with pip:
```bash
pip install collider-dashboard
```
This will install the required packages and build the application. If you haven't done it already, it is recommended to prebuild the Xsuite kernel to gain some computation time:
```bash
xsuite-prebuild
```
## Usage
For personal usage, the simplest way to use the dashboard is to run the package as a development server from the command line, providing a few arguments:
```bash
python -m collider_dashboard --collider-path path_to_collider.json --filling-path path_to_scheme.json --port 8080 --force-reload --ignore-footprint --full-twiss --type-particles proton --debug
```
- `--collider-path`, or `-c`, sets the path to the collider configuration file. Default value to the path of a dummy collider used for testing.
- `--filling-path`, or `-f`, sets the path to the filling scheme, instead of using the one in the collider configuration file. Optional.
- `--port`, or `-p`, sets the port on which the dashboard will be deployed. Default value to `8080``.
- `--force-reload`, or `-r`, sets a boolean indicating whether the collider dashboard data should be reloaded if already existing. Optional.
- `--ignore-footprint`, or `-i`, sets a boolean indicating whether the footprint should be ignored to gain computation time. Optional.
- `--full-twiss`, or `-t`, sets a boolean indicating whether the Twiss/Survey tables should be computed fully (not removing duplicates and entry/exit elements), at the expense of computation time. Optional.
- `--type-particles`, or `-a`, sets the type of particles to be used for the collider. Default value to `proton`.
- `--debug`, or `-d`, sets a boolean indicating whether the dashboard should be run in debug mode. Optional.
After computing some temporary variables (this may take a while the first time), this will deploy a local server and open the dashboard in a browser window.
Alternatively, one can import the dashboard as a module and use it in a custom script:
```python
# my-awesome-dashboard.py
from collider_dashboard import build_app
app, server = build_app(path_to_collider.json,
path_scheme=path_to_scheme.json,
port=8080,
force_reload=False,
ignore_footprint=False,
debug = False,
simplify_tw=True
type_particles='proton'
)
```
The dashboard can then be deployed e.g. with gunicorn:
```bash
gunicorn my-awesome-dashboard:server -b :8080
```
Note that, as the dashboard deals with global variables, it is not thread-safe. It is therefore recommended to run it with a single worker (it's the case by default).
Raw data
{
"_id": null,
"home_page": "https://github.com/ColasDroin/simulation-dashboard",
"name": "collider-dashboard",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Colas Droin",
"author_email": "colas.noe.droin@cern.ch",
"download_url": "https://files.pythonhosted.org/packages/dc/54/825d72b8a8732fdbfe42e7050f4391605cd7b6a9ecd2be05af2301c6e54c/collider_dashboard-1.4.2.0.tar.gz",
"platform": null,
"description": "# Collider Dashboard\n\n<p align=\"center\">\n <a href=\"https://opensource.org/license/mit/\">\n <img src=\"https://badgen.net/static/license/MIT/blue\">\n </a>\n <a href=\"https://python-poetry.org/\">\n <img src=\"https://badgen.net/static/Package%20Manager/Poetry/orange\">\n </a>\n <a href=\"https://dash.plotly.com/\">\n <img src=\"https://badgen.net/static/Dash/2.14.1/green\">\n </a>\n <a href=\"https://black.readthedocs.io/en/stable/\">\n <img src=\"https://badgen.net/static/Code%20style/Black/black\">\n </a>\n <img src=\"https://badgen.net/github/release/colasdroin/collider-dashboard\">\n <img src=\"https://badgen.net/github/commits/colasdroin/collider-dashboard\">\n</p>\n\n\nA Dash application to visualize the observables and parameters of a collider built and configured with Xsuite.\n\n## Installation\n\nThe dashboard can be installed from PyPI with pip:\n\n```bash\npip install collider-dashboard\n```\n\nThis will install the required packages and build the application. If you haven't done it already, it is recommended to prebuild the Xsuite kernel to gain some computation time:\n\n```bash\nxsuite-prebuild\n```\n\n## Usage\n\nFor personal usage, the simplest way to use the dashboard is to run the package as a development server from the command line, providing a few arguments:\n\n```bash\npython -m collider_dashboard --collider-path path_to_collider.json --filling-path path_to_scheme.json --port 8080 --force-reload --ignore-footprint --full-twiss --type-particles proton --debug\n```\n\n- `--collider-path`, or `-c`, sets the path to the collider configuration file. Default value to the path of a dummy collider used for testing.\n- `--filling-path`, or `-f`, sets the path to the filling scheme, instead of using the one in the collider configuration file. Optional.\n- `--port`, or `-p`, sets the port on which the dashboard will be deployed. Default value to `8080``.\n- `--force-reload`, or `-r`, sets a boolean indicating whether the collider dashboard data should be reloaded if already existing. Optional.\n- `--ignore-footprint`, or `-i`, sets a boolean indicating whether the footprint should be ignored to gain computation time. Optional.\n- `--full-twiss`, or `-t`, sets a boolean indicating whether the Twiss/Survey tables should be computed fully (not removing duplicates and entry/exit elements), at the expense of computation time. Optional.\n- `--type-particles`, or `-a`, sets the type of particles to be used for the collider. Default value to `proton`.\n- `--debug`, or `-d`, sets a boolean indicating whether the dashboard should be run in debug mode. Optional.\n\nAfter computing some temporary variables (this may take a while the first time), this will deploy a local server and open the dashboard in a browser window.\n\nAlternatively, one can import the dashboard as a module and use it in a custom script:\n\n```python\n# my-awesome-dashboard.py\n\nfrom collider_dashboard import build_app\napp, server = build_app(path_to_collider.json, \n path_scheme=path_to_scheme.json, \n port=8080, \n force_reload=False, \n ignore_footprint=False, \n debug = False, \n simplify_tw=True\n type_particles='proton'\n )\n```\n\nThe dashboard can then be deployed e.g. with gunicorn:\n\n```bash\ngunicorn my-awesome-dashboard:server -b :8080\n```\n\nNote that, as the dashboard deals with global variables, it is not thread-safe. It is therefore recommended to run it with a single worker (it's the case by default).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Dash application to visualize the observables and parameters of a collider built and configured with Xsuite.",
"version": "1.4.2.0",
"project_urls": {
"Homepage": "https://github.com/ColasDroin/simulation-dashboard",
"Repository": "https://github.com/ColasDroin/simulation-dashboard"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4803d1d27d2ac455600ebbc298086d74f2addc609d6de93b68abdf7de01574b7",
"md5": "e43d9bf75b7c86a640b0674270a0da9c",
"sha256": "2a14c1a83e4da247d98419c84cd82fbf7fded5f33d0d0af89a41356a82b99aa5"
},
"downloads": -1,
"filename": "collider_dashboard-1.4.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e43d9bf75b7c86a640b0674270a0da9c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.10",
"size": 4079928,
"upload_time": "2024-09-06T07:33:23",
"upload_time_iso_8601": "2024-09-06T07:33:23.344575Z",
"url": "https://files.pythonhosted.org/packages/48/03/d1d27d2ac455600ebbc298086d74f2addc609d6de93b68abdf7de01574b7/collider_dashboard-1.4.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dc54825d72b8a8732fdbfe42e7050f4391605cd7b6a9ecd2be05af2301c6e54c",
"md5": "8d2d6219a71976540e21ef1dcb559a4a",
"sha256": "6e4ecf2d37081d65f5634fa9e1f62474ec642029d50e47a98ec6f55ff03dafbf"
},
"downloads": -1,
"filename": "collider_dashboard-1.4.2.0.tar.gz",
"has_sig": false,
"md5_digest": "8d2d6219a71976540e21ef1dcb559a4a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.10",
"size": 3772771,
"upload_time": "2024-09-06T07:33:25",
"upload_time_iso_8601": "2024-09-06T07:33:25.353273Z",
"url": "https://files.pythonhosted.org/packages/dc/54/825d72b8a8732fdbfe42e7050f4391605cd7b6a9ecd2be05af2301c6e54c/collider_dashboard-1.4.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-06 07:33:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ColasDroin",
"github_project": "simulation-dashboard",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "collider-dashboard"
}