LabPal User Manual
  • Easily run experiments on a computer
  • A quick tutorial
    • Creating an experiment
    • Creating a lab
    • Creating a lab
    • Adding a table
    • Adding a plot
    • Wrapping up
    • Advanced functionalities
  • Using the web console
    • Typical usage of the web console
    • The elements of the web console
    • Running a lab on a remote machine
    • Changing the server port
    • Changing the color scheme
  • Using the text console
  • Experiments: advanced features
    • Use multiple types of experiments in the same lab
    • Use table transformations
    • Make experiments that depend on external resources
    • Dealing with errors
    • Update a progress indicator for long experiments
    • Guess the execution time of an experiment
    • Generate multiple data points in a single experiment
    • Group experiments
  • Creating and transforming tables
  • Creating plots
    • Plot libraries
    • Two-dimensional plots
    • Customizing GRAL plots
    • Palettes
  • Managing files
    • Using the FileHelper
    • Bundling external resources
  • Saving, loading, merging labs
    • Save a lab
    • Load a lab
    • Merge labs
    • Preload a lab with results stored internally
    • Export a lab notebook
    • Be careful with serialization
  • Adding metadata
    • To the lab
    • To each experiment group
    • To each experiment
    • To each parameter
  • Creating regions
    • Iterating over regions
    • Irregular regions
    • Regions are objects
    • Filtering experiments
    • Counting points
  • Calling external commands
  • Including external results
    • By hand
    • Automatically from a file
  • Running LabPal on multiple machines
    • Auto-reporting
    • Filtering
    • Auto-start
  • Data Provenance and Traceability
  • Verifying claims on experiments
    • The Claim object
    • Viewing claims
    • Explaining violations
    • Claims as integrity checks
  • Playing with the lab's parameters
    • Change the code
    • Edit experiments in the web console
  • Other features
    • Passing command-line parameters
    • Customizing the web console
    • Checking the environment
    • Creating a lab in Python
Powered by GitBook
On this page
  • Lab description
  • Group description
  • Experiment description
  • Parameter description

Adding metadata

An important part of creating experiments with LabPal is to enable an external user to re-run them easily. To this end, it is crucial to properly document your experimental setup, so that other people can understand what you are experimenting, and what all the values, tables and plots mean.

LabPal offers various ways to define metadata for your lab --that is, data about its data. You can set descriptions for:

  • The lab

  • Each experiment group

  • Each experiment

  • Each parameter

Lab description

A first metadata is about the lab itself. You can enter a textual description for the lab using method setDescription:

public void setup() {
  ...
  setDescription("This is a lab for comparing sorting algorithms.");
}

If a description is defined, it will be displayed in the web console in the Home page, replacing the default help text that shows up otherwise. This description can include any valid HTML markup, and can be as long as you wish.

A recommended tip is to write the description in a separate HTML file that you place in the same folder as your source code. You can then use FileHelper to load that file's contents into the description:

public void setup() {
  ...
  setDescription(FileHelper.internalFileToString("description.html",
    this.getClass());
}

Group description

If the lab has any experiment groups, each group can be given a description using the setDescription method:

public void setup() {
  ...
  Group g = new Group("Gnome Sort");
  g.setDescription("Experiments that use the Gnome sort algorithm");
  ...
}

The group description, if any, is displayed in the experiment list, under the group's name.

Experiment description

A description can be entered for each experiment separately. This can be done in two ways:

  • Using the experiment's setDescription method to set the text

  • By overriding the getDescription method to return whatever text you want

In both cases, the description string should be valid HTML. This description is displayed in the Experiment page.

The description can be made dynamic, and depend on the experiment's input parameters. In the sorting example we used throughout this manual, one could hence write:

public String getDescription() {
  return "Sorts an array of size " + readInt("Size") +
    " using " + readString("Algorithm");
}

Parameter description

Each individual parameter (input and output) can also be given a description. To this end, an experiment can use the method describe:

public abstract class SortExperiment extends Experiment {
  public SortExperiment(int n) {
    setInput("Size", n);
    describe("Size", "The size of the array to sort");
    describe("Time", "The time (in ms) it takes to sort the array");
    describe("Algorithm", "The algorithm used to sort the array");
  }
  ...
}

One can see how the describe method has been used to associate a short description of the input parameter "Size", as well as the output parameter "Time" and the input parameter "Algorithm". These last two parameters have not yet received a value, but they can already get a description.

In the web console, the description of parameters shows as tooltips wherever the parameter name appears (except in tables). Hovering the mouse over the name displays the description. This makes it easy for an external user to understand the meaning of each value, and in particular to know the units (if any) used for that value.

PreviousBe careful with serializationNextTo the lab

Last updated 6 years ago