bencher.bench_cfg
Module Contents
Classes
Base class for named objects that support Parameters and message |
|
A Class to store options for how to run a benchmark parameter sweep |
|
A class for storing the arguments to configure a benchmark protocol If the inputs variables are the same the class should return the same hash and same filename. This is so that historical data can be referenced and ensures that the generated plots are unique per benchmark |
|
A class to store data about the sampling and result dimensions |
- class bencher.bench_cfg.BenchPlotSrvCfg(**params)
Bases:
param.Parameterized
Base class for named objects that support Parameters and message formatting.
Automatic object naming: Every Parameterized instance has a name parameter. If the user doesn’t designate a name=<str> argument when constructing the object, the object will be given a name consisting of its class name followed by a unique 5-digit number.
Automatic parameter setting: The Parameterized __init__ method will automatically read the list of keyword parameters. If any keyword matches the name of a Parameter (see Parameter class) defined in the object’s class or any of its superclasses, that parameter in the instance will get the value given as a keyword argument. For example:
- class Foo(Parameterized):
xx = Parameter(default=1)
foo = Foo(xx=20)
in this case foo.xx gets the value 20.
When initializing a Parameterized instance (‘foo’ in the example above), the values of parameters can be supplied as keyword arguments to the constructor (using parametername=parametervalue); these values will override the class default values for this one instance.
If no ‘name’ parameter is supplied, self.name defaults to the object’s class name with a unique number appended to it.
Message formatting: Each Parameterized instance has several methods for optionally printing output. This functionality is based on the standard Python ‘logging’ module; using the methods provided here, wraps calls to the ‘logging’ module’s root logger and prepends each message with information about the instance from which the call was made. For more information on how to set the global logging level and change the default message prefix, see documentation for the ‘logging’ module.
- port: int
- allow_ws_origin
- show: bool
- class bencher.bench_cfg.BenchRunCfg(**params)
Bases:
BenchPlotSrvCfg
A Class to store options for how to run a benchmark parameter sweep
- repeats: bool
- over_time: bool
- debug: bool
- use_optuna: bool
- summarise_constant_inputs
- print_bench_inputs: bool
- print_bench_results: bool
- clear_history: bool
- print_pandas: bool
- print_xarray: bool
- serve_pandas: bool
- serve_pandas_flat: bool
- serve_xarray: bool
- auto_plot: bool
- raise_duplicate_exception: bool
- use_cache: bool
- clear_cache: bool
- use_sample_cache: bool
- only_hash_tag: bool
- clear_sample_cache: bool
- overwrite_sample_cache: bool
- only_plot: bool
- use_holoview: bool
- nightly: bool
- time_event: str
- headless: bool
- render_plotly
- level
- run_tag
- run_date
- executor
- plot_size
- plot_width
- plot_height
- static from_cmd_line() BenchRunCfg
create a BenchRunCfg by parsing command line arguments
- Returns:
parsed args
- Return type:
parsed args
- class bencher.bench_cfg.BenchCfg(**params)
Bases:
BenchRunCfg
A class for storing the arguments to configure a benchmark protocol If the inputs variables are the same the class should return the same hash and same filename. This is so that historical data can be referenced and ensures that the generated plots are unique per benchmark
- input_vars
- result_vars
- const_vars
- result_hmaps
- meta_vars
- all_vars
- iv_time
- iv_time_event
- over_time: param.Boolean(False, doc='A parameter to control whether the function is sampled over time')
- name: str
- title: str
- raise_duplicate_exception: str
- bench_name: str
- description: str
- post_description: str
- has_results: bool
- pass_repeat: bool
- tag: str
- hash_value: str
- hash_persistent(include_repeats) str
override the default hash function becuase the default hash function does not return the same value for the same inputs. It references internal variables that are unique per instance of BenchCfg
- Parameters:
include_repeats (bool) – by default include repeats as part of the hash execpt with using the sample cache
- inputs_as_str() List[str]
- describe_sweep(width: int = 800) panel.pane.Markdown
Produce a markdown summary of the sweep settings
- describe_benchmark() str
Generate a string summary of the inputs and results from a BenchCfg
- Returns:
summary of BenchCfg
- Return type:
str
- to_title(panel_name: str = None) panel.pane.Markdown
- to_description(width: int = 800) panel.pane.Markdown
- to_post_description(width: int = 800) panel.pane.Markdown
- to_sweep_summary(name=None, description=True, describe_sweep=True, results_suffix=True, title: bool = True) panel.pane.Markdown
Produce panel output summarising the title, description and sweep setting
- optuna_targets(as_var=False) List[str]