Skip to content

mala-project/malaWeb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

malaWeb

Web app to visualize on-the-fly MALA predictions.

Description

malaWeb is a Plotly Dash based web application used for the visualization of 3D volumetric data. By giving atom positions and cell information in ASE-accepted data formats, an inference can be run via MALA to make predictions on the volumetric data inside the given cell. This application is meant to be hosted for private access / in institutions and only in intranet. Security concerns have not been part of the development process so far and they definetly exist. \

Be aware that larger model predictions will take a lot of time. The default atom limit for predictions is 200.

Installation

Running a MALA inference requires a working installation of MALA and its dependencies (torch, LAMMPS, QuantumEspresso, ..), as well as model data.
See https://github.com/mala-project/mala/blob/develop/docs/source/install/installing\_mala.rst on how to install.
Some model data is currently included in this malaWeb repository, stored in "models"-folder and listed in "model_list.json". After MALA is installed, just run the setup.py file to install malaWebs dependencies.

Options for installing malaWeb are:

  • As recommended for MALA too, use a conda environment: run conda env create --name <environment name> --file environment.yaml.
  • Install via pip: In the install directory, run pip install -e .
  • Install and deploy with Docker: ...

Make sure the installed version of the dash uploader component is the pre-release version 0.7.0 or newer, as this introduces new syntax.

Make sure the installed version of packaging is not higher than 21. For a version check, the dash uploader component uses an attribute "LegacyVersion" that has been deprecated in later versions. See this thread: pypa/packaging#321

Usage

After installing with conda or pip on host, run gunicorn app:server -w 4 -b [host-ip]:8050 Change 8050 to whatever port you want and exchange [host-ip] for the IP adress of the server. Other devices on the same network can now access malaWeb via that IP:port.

If you plan to install and deploy with docker, in line X of the Dockerfile, change "0.0.0.0:8050" to you desired IP-adress and port as with the gunicorn command above.


In the File-Upload section, upload an ASE-readable file
(See: https://wiki.fysik.dtu.dk/ase/ase/io/io.html -> Table -> Formats with either R or RW capabilities).
The data read by ASE will be displayed in a popup window for running an Inference

Inference popup

  • A dropdown lists all uploaded atom positions
  • The given cell is rendered with given atom positions inside
  • A model has to be chosen for running the MALA inference. Some models support varying temperatures, so make sure to edit if necessary, before running (calculation heavy) predictions
  • Run MALA

Overview of malaWeb

  • (1) The interactive visualization will open up.
  • (2) The Sidebar to the left contains:
    • Upload section
    • [new] Download button that saves MALA's results locally (needs work)
    • The edit button for opening up the Inference pop up again, to enable running another inference (f.e. same data, different model)
    • The reset button to delete the uploaded data and reset the visualization
  • (3) The Settings panel on the right hand side gives options for:
    • Predefined camera angles
    • Rendering options for the 'voxels' and their size, opacity and outlines as well as atoms and cell boundaries.
    • [new] Import of config (settings, tools, camera angle) in JSON format
    • [new] Download of config (settings, tools, camera angle) in JSON format
  • (4) The Tools panel just below the visualization lets you render layers in all 3 axis, as well as filter voxels by their density value. Layer settings can quickly be en- and disabled by pressing the respective axis button and reset by pressing X to the sliders right.
  • (5) The bottom of the page has a button for opening up information on different energies and a graph of the density of state.

Todos

  • Explore Client-Side plot updates for slicing
  • Fix Download of MALA's data

Long Term:

  • Create a MALA-API that grants access to a (powerful / optimized) MALA-Host, to reduce load on App-host and improve inference speed
  • Import option for MALA data, so that malaWeb can also be used for just visualizing