Skip to main content

Configuration file support for webviz

Project description

PyPI version Build Status Codacy Badge Python 3.6+

Webviz configuration utility

Introduction

Writing a Webviz application, built on top of dash, gives a lot of flexibility. However, it also requires Python knowledge from the person setting it up.

This utility reduces the skills necessary to configure a Webviz application.

The workflow can be summarized as this:

  1. The user provides a configuration file following the yaml standard.
  2. This utility reads the configuration file and automatically writes the corresponding Webviz Dash code.
  3. The created application can either be viewed locally, or deployed to a cloud provider. Both out of the box.

Creating custom, specialized elements is possible. See the contribution guide for more details.

The yaml configuration file can either be manually created, or it could be auto-generated by some other tool.

Example configuration file and information about the standard containers can be seen in the documentation.

Installation

As dash is using Python3-only functionality, you should use a Python3 (virtual) environment before installation. One way of doing this is

PATH_TO_VENV='./my_new_venv'
python3 -m virtualenv $PATH_TO_VENV
source $PATH_TO_VENV/bin/activate

The simplest way of installing webviz-config is to run

pip install webviz-config

If you want to download the latest source code and install it manually you can run

git clone git@github.com:equinor/webviz-config.git
cd webviz-config
pip install .

Run tests

To run tests it is necessary to first install selenium chrome driver. Then install dev requirements and run pytest:

pip install .[tests]
pytest tests

Linting can be checked by:

pycodestyle webviz_config tests

Build documentation

End-user documentation (i.e. YAML configuration file) be created after installation by

pip install .[tests]
cd ./docs
python3 build_docs.py

Officially updated built end-user documentation (i.e. information to the person setting up the configuration file) is hosted here on github.

Usage

After installation, there is a console script named webviz available in $PATH_TO_VENV/bin. You can test the installation by using the provided test configuration file,

webviz build ./examples/basic_example.yaml

Without any additional arguments, this will

  1. create a temporary folder
  2. write the Webviz Dash application code to that folder
  3. start the server
  4. when stopping the server (press CTRL+C at any time), the temporary folder is deleted

The optional arguments can be seen when running

webviz --help

For example will

webviz build ./examples/basic_example.yaml --portable /scratch/my_field/my_webviz

create a portable instance and store it in the provided folder.

A recent feature in dash is hot reload. When the Dash Python code file is saved, the content seen in the web browser is automatically reloaded (no need for server restart). This feature is passed on to Webviz configuration utility, meaning that if the user runs

webviz build ./examples/basic_example.yaml

and then modifies ./examples/basic_example.yaml while the Webviz application is still running, a hot reload will occur.

By default webviz-config uses https and runs on localhost. In order to create your personal https certificate, run

webviz certificate

Certificate installation guidelines will be given when running the command.

Creating new containers

If you are interested in creating new containers which can be configured through the configuration file, take a look at the contribution guide.

Disclaimer

This is a tool under heavy development. The current configuration file layout will therefore also see large changes.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webviz-config-0.0.10.tar.gz (615.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page