SimLogger.FigLogger module

The FigLogger is designed to solve the problem of not being able to easily view detailed graphs through a command line interface with remote computing systems. To solve this, an integration between the SimLogger for data archiving and kachery were combined to give remote access to data through a web interface.

Installation

After following the initial installation steps for the SimLogger package. Ensure the machine is setup to access the kachery cloud

kachery-cloud-init

and follow the steps to setup the connection.

With that you can now generate your own graphs, and then remotely view them. The graphs are also saved to file using the SimLogger so you can always simply load up the pickled version of the graph and show it again on a local machine if desired.

The simplest method is to let FigLogger generate the plot for you. This is great for when you want a simple scatter or line plot without much specifics.

Which will automatically generate a line plot with the data given, and will give a link to the graph in the log file.

SimLogger.FigLogger functions

SimLogger.FigLogger.createPlot(simTag, objTag, x, y, objFolder='data/obj', z=None, plotType='scatter', title='Plot', labels={'x': 'x', 'y': 'y', 'z': 'z'}, makeNote=True, **kwargs)[source]

Generate a plot that will automatically be saved (using SimLogger) and will generate a url to access the graph through the cloud (see kachery-cloud-init)

Parameters:
  • simTag (str) – Unique id for the simulation

  • objTag (str) – Unique id for this graph within the simulation

  • x ([int|float]) – x values for the graph

  • y ([int|float]) – y values for the graph

  • objFolder (str) – location where the pickled objects should go

  • z ([int|float[) – z values for the graph (optional, but only for 3d scatter)

  • plotType (str) – Either “scatter” for scatter plots Or “line” for line plots (not for 3d plots)

  • title (str) – Title for the plot

  • ({str (labels) – str}): Key value pairs for the keys “x”, “y”, (“z”) that go to the values corresponding to the axis labels

  • makeNote (bool) – Whether the log should be noted with the saved files

  • **kwargs – Additional args for the plotly express graph

Returns:

The figurl link to access the graph

Return type:

url (str)

SimLogger.FigLogger.savePlotly(simTag, objTag, ff, label='', objFolder='data/obj', makeNote=True)[source]

Save a previously created plotly graph to the cloud for remote access and pickle the graph for access later

Parameters:
  • simTag (str) – Unique id for the simulation

  • objTag (str) – Unique id for the graph within the simulation

  • ff (plotly figure) – User created figure (with plotly)

  • label (str) – Optional label for the figurl cloud saved graph

  • objFolder (str) – location where the pickled objects should go

  • makeNote (str) – Note in the log that the pickled file was saved

Returns:

The figurl link to access the graph

Return type:

url (str)