Skip to content

Tool for animating neutrino events in the browser.

License

Notifications You must be signed in to change notification settings

tkerscher/wilson

Repository files navigation

License: MIT Code style: black

Wilson is a 3D visualization tool aimed for (astro) particle physics. It provides a python package for creating event files / catalogues and a static web based app for viewing them in your browser written using TypeScript.

Installation

Install Python Package

The Python package is hosted on PyPI and can simply be installed using pip:

pip install wilson3d

Note that it is wilson3d not wilson.

Install Web App

For deployment, it's enough to just copy the build files onto your server. Since it's a static app, a simple file serving is enough.

You can also run the app locally if you have installed the Python package using a command line:

wilson

You can also pass a file or directory to serve. If you pass a file a new tab in your browser should open showing the file:

wilson event.wlsn

Building

Build Python Package

For building the python package a npm script is provided. On Linux using yarn you can simply run

yarn buildpy

This handles several steps:

  1. Builds the web app, as it is used within the Python package
  2. Bundles the web app into app.zip stored in the package root source directory
  3. Runs python3 -m build
  4. Checks the build via python3 -m twine check dist/wilson*

After building finished, you can install it via

pip install dist/wilson*.whl

Build Web App

  1. Install yarn. It will handle all further steps for you through its CLI.
  2. Fetch dependencies by running yarn from the repository root
  3. Issue the build command via yarn build
  4. The build files are now in the dist subdirectory.

Build Documentation

The documentation is generated via Sphinx. To install the necessary dependencies you can simply run:

pip install -r docs/requirements.txt

Afterwards you can build the documentation via

cd docs
make html

Code Style

The repository uses static code analyzing tools like linters. Namely they are:

There exist yarn scripts for easier use:

yarn lint # typescript
yarn black # python black

File Format

See proto for a detailed description of the event file format.

Dependencies

Python Dependencies

Python Build Dependencies

Python Develop Dependencies

Web App Dependencies

TypeScript Build Dependencies

TypeScript Develop Dependencies