MafTracking

class rubin_sim.maf.web.MafTracking(database=None)

Bases: object

Class to read MAF’s tracking SQLite database (tracking a set of MAF runs) and handle the output for web display.

Methods Summary

get_run(maf_run_id)

Set up a mafRunResults object to read and handle the data from an individual run.

run_info(run)

Provide the tracking database information relevant for a given run in a format that the jinja2 templates can use.

sort_runs(runs[, order])

Sort the numpy array of run data.

Methods Documentation

get_run(maf_run_id)

Set up a mafRunResults object to read and handle the data from an individual run. Caches the mafRunResults object, meaning the metric information from a particular run is only read once from disk.

Parameters:
maf_run_idint

maf_run_id value in the tracking database corresponding to a particular MAF run.

Returns:
runPageMafRunResults

A MafRunResults object containing the information about a particular run. Stored internally in self.runs_page dict, but also passed back to the tornado server.

run_info(run)

Provide the tracking database information relevant for a given run in a format that the jinja2 templates can use.

Parameters:
runnumpy.NDarray

One line from self.runs

Returns:
run_infoOrderedDict

Ordered dict version of the numpy structured array.

sort_runs(runs, order=['run_name', 'maf_comment', 'maf_run_id'])

Sort the numpy array of run data.

Parameters:
runsnumpy.NDarray

The runs from self.runs to sort.

orderlist

The fields to use to sort the runs array.

Returns:
runsnumpy.NDarray

A sorted numpy array.