Skip to main content

A realtime plotting library built using plot.ly

Project description

Crystal

crystal logo

A realtime plotting and project management library built using Plotly

What can it do?

Crystal is an alternative to the amazingly useful visualization tool Tensorboard with some additional features that make it useful not just for Machine Learning but, in any project that needs realtime data visualizations. You can include realtime plots in your python (more languages to come) easily with just two line of code.

Some features provided by crystal include;

  • Centralized database to store the results of all projects.
  • Easy way to download results from the database if needed.
  • Plots supported include scalar, histogram and images with more to come.

To get started just install crystal using pip as follows:

$ pip install crystal

The installation adds a path to crystal script to PATH variable on linux which allows you to run the crystal dashboard from any directory as follows:

$ crystal

Note:

  • If you install it on a virtual environment then you will only be able to run it only when the environment is activated.

Here's how you'd plot a sine wave using crystal:

"""
realtime_sinewave.py
"""

import time
import numpy as np
from crystal import Crystal

cr = Crystal(project_name="Realtime_sine")
x_range = np.arange(0, 1000, 0.1)

for i in x_range:
    value = np.sin(2*np.pi*i)
    cr.scalar(value=value, step=i, name="sine_wave")
    print("step: {} \t value: {}".format(i, value))
    time.sleep(1)  # one value a second

Let's have a closer look at some of the functions used in the above code:

  • cr = Crystal(project_name=..) creates a new project in the database, if no project name is provided then, the script name is used as the project name.
  • cr.scalar(value=..) plots a scalar value and takes three parameters, value stores the y-axis value which in this case is the sin output, step saves the x-axis value and name provides a title for the plot.
  • Each run in a project is assigned a unique run id that contains the time stamp. You can see them in the terminal and also the dashboard (described below).
  • All the data is stores under ~/Crystal_data/crystal.db.

Output:

Run

$ crystal 

and select a project and run name. You will see a plot that looks something like this:

crystal gif

Crystal Dashboard in action

Where can I learn more?

Docs are still being worked on. Feel free to contribute in documenting the usage!

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Project details


Download files

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

Source Distribution

crystal-0.1.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

crystal-0.1.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file crystal-0.1.0.tar.gz.

File metadata

  • Download URL: crystal-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for crystal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cf0a41928ce25fd7f15c5eac02611b440a3d32baca3fd780afac7b5eb2e62d7c
MD5 6e007138f260a157c8974cfc4a0605b0
BLAKE2b-256 79aba685fd1603f0d04bda9ad9509a14bb388f53d947cd037ee929d3e1e4a674

See more details on using hashes here.

File details

Details for the file crystal-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crystal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8314d65dd6efd840549d20daf937d5b94fb52bdd2aca46da8d5815e21d7d926e
MD5 68346ab62dd76a5f9121c8d2c8dfe589
BLAKE2b-256 64825fd3cf3681159ba0b40d64d3a95353f050be38073ddd07d39e7a4d4e9574

See more details on using hashes here.

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