trixi.experiment_browser

browser

trixi.experiment_browser.browser.combine(base_dir)[source]
trixi.experiment_browser.browser.create_flask_app(base_dir)[source]
trixi.experiment_browser.browser.experiment(base_dir)[source]
trixi.experiment_browser.browser.experiment_log(base_dir)[source]
trixi.experiment_browser.browser.experiment_plots(base_dir)[source]
trixi.experiment_browser.browser.experiment_remove(base_dir)[source]
trixi.experiment_browser.browser.experiment_rename(base_dir)[source]
trixi.experiment_browser.browser.experiment_star(base_dir)[source]
trixi.experiment_browser.browser.overview(base_dir)[source]
trixi.experiment_browser.browser.overview_(base_dir)[source]
trixi.experiment_browser.browser.parse_args()[source]
trixi.experiment_browser.browser.register_url_routes(app, base_dir)[source]
trixi.experiment_browser.browser.start_browser()[source]

dataprocessing

trixi.experiment_browser.dataprocessing.group_images(images)[source]
trixi.experiment_browser.dataprocessing.make_graphs(results, trace_options=None, layout_options=None, color_map=<sphinx.ext.autodoc.importer._MockObject object>)[source]

Create plot markups.

This converts results into plotly plots in markup form. Results in a common group will be placed in the same plot.

Parameters:results (dict) – Dictionary
trixi.experiment_browser.dataprocessing.merge_results(experiment_names, result_list)[source]
trixi.experiment_browser.dataprocessing.process_base_dir(base_dir, view_dir='', default_val='-', short_len=25, ignore_keys=('name', 'experiment_dir', 'work_dir', 'config_dir', 'log_dir', 'checkpoint_dir', 'img_dir', 'plot_dir', 'save_dir', 'result_dir', 'time', 'state'))[source]

Create an overview table of all experiments in the given directory.

Parameters:
  • directory (str) – A directory containing experiment folders.
  • default_val (str) – Default value if an entry is missing.
  • short_len (int) – Cut strings to this length. Full string in alt-text.
Returns:

{“ccols”: Columns for config entries,

”rcols”: Columns for result entries, “rows”: The actual data}

Return type:

dict

ExperimentReader

class trixi.experiment_browser.experimentreader.CombiExperimentReader(base_dir, exp_dirs=(), name=None, decode_config_clean_str=True)[source]

Bases: trixi.experiment_browser.experimentreader.ExperimentReader

get_config()[source]
get_result_log_dict()[source]
get_results()[source]

Get the last result item.

Returns:The last result item in the experiment.
Return type:dict
get_results_full()[source]
get_results_log()[source]

Build result dictionary.

During the experiment result items are written out as a stream of quasi-atomic units. This reads the stream and builds arrays of corresponding items. The resulting dict looks like this:

{
    "result group": {
        "result": {
            "counter": x-array,
            "data": y-array
        }
    }
}
Returns:Result dictionary.
Return type:dict
ignore_experiment()[source]

Create a flag file, so the browser ignores this experiment.

read_meta_info()[source]

Reads the meta info of the experiment i.e. new name, stared or ignored

save(target_dir=None)[source]
update_meta_info(name=None, star=None, ignore=None)[source]

Updates the meta info i.e. new name, stared or ignored and saves it in the experiment folder

Parameters:
  • name (str) – New name of the experiment
  • star (bool) – Flag, if experiment is starred/ favorited
  • ignore (boll) – Flag, if experiment should be ignored
class trixi.experiment_browser.experimentreader.ExperimentReader(base_dir, exp_dir='', name=None, decode_config_clean_str=True)[source]

Bases: object

Reader class to read out experiments created by trixi.experimentlogger.ExperimentLogger.

Parameters:
  • work_dir (str) – Directory with the structure defined by trixi.experimentlogger.ExperimentLogger.
  • name (str) – Optional name for the experiment. If None, will try to read name from experiment config.
get_checkpoints()[source]
static get_file_contents(folder, include_subdirs=False)[source]

Get all files in a folder.

Returns:All files joined with folder path.
Return type:list
get_images()[source]
get_log_file_content(file_name)[source]

Read out log file and HTMLify.

Parameters:file_name (str) – Name of the log file.
Returns:Log file contents as HTML ready string.
Return type:str
get_logs()[source]
get_plots()[source]
get_results()[source]

Get the last result item.

Returns:The last result item in the experiment.
Return type:dict
get_results_log()[source]

Build result dictionary.

During the experiment result items are written out as a stream of quasi-atomic units. This reads the stream and builds arrays of corresponding items. The resulting dict looks like this:

{
    "result group": {
        "result": {
            "counter": x-array,
            "data": y-array
        }
    }
}
Returns:Result dictionary.
Return type:dict
ignore_experiment()[source]

Create a flag file, so the browser ignores this experiment.

read_meta_info()[source]

Reads the meta info of the experiment i.e. new name, stared or ignored

update_meta_info(name=None, star=None, ignore=None)[source]

Updates the meta info i.e. new name, stared or ignored and saves it in the experiment folder

Parameters:
  • name (str) – New name of the experiment
  • star (bool) – Flag, if experiment is starred/ favorited
  • ignore (boll) – Flag, if experiment should be ignored
trixi.experiment_browser.experimentreader.group_experiments_by(exps, group_by_list)[source]