paramcomparison package¶
Module contents¶
-
class
paramcomparison.
ParamComparison
(grid, reader)[source]¶ A class to initiate the generation of pages
Parameters: - grid (dict: str -> (val0, val1, ...)) – A dictionary whose keys are strings of variable names and values are sequences of values to be tried for the corresponding variable.
- reader (
readers.Reader
(or its subclass) object) – The Reader class to load and process data.
Raises TypeError: When
reader
is not an instance ofreaders.Reader
.-
generate_pages
(outdir, writer, row_field, col_field)[source]¶ Generate a set of pages
Parameters: - outdir (str) – The directory to write files to.
- writer (
writers.Writer
(or its subclass) object) – The writer to be used. - row_field (str) – The field to be used in rows.
- col_field (str) – The field to be used in columns.
Returns: None
Raises TypeError: When
writer
is not an instance ofwriters.Writer
.
Submodules¶
paramcomparison.readers module¶
-
class
paramcomparison.readers.
Reader
[source]¶ Bases:
object
The base class for all readers, which define how to read and process data.
-
class
paramcomparison.readers.
UserFunctionReader
(func, data)[source]¶ Bases:
paramcomparison.readers.Reader
A class which relays the reading to a user function.
paramcomparison.writers module¶
-
class
paramcomparison.writers.
RstWriter
(indent_size=4)[source]¶ Bases:
paramcomparison.writers.Writer
A class to write RST output.
-
write_table
(names, params, row_idx, row_values, col_idx, col_values, values)[source]¶ See
Writer.write_table()
.
-
write_title
(comparison_param)[source]¶ See
Writer.write_title()
.
-
-
class
paramcomparison.writers.
Writer
[source]¶ Bases:
object
The base class for all writers, which define how to write output in specific formats.
-
get_file_name
(name)[source]¶ Parameters: name (str) – Comparison parameter name. Returns: The file name given the comparison parameter name Return type: str
-
write_table
(names, params, row_idx, row_values, col_idx, col_values, values)[source]¶ Parameters: - names (sequence of strings) – A sequence of names of fields.
- params (sequence of strings) – A sequence of parameters corresponding to the variable name in the same position of names.
- row_idx (int) – The index of the row field.
- row_values (sequence of strings) – A sequence of all possible values of the row fields.
- col_idx (int) – The index of the column field.
- col_values (sequence of strings) – A sequence of all possible values of the column fields.
- values (dict: (str, str) -> str) – A dictionary whose key is an element of the Cartesion product of row_values and col_values, and value is the corresponding result in the table entry.
Returns: The table string
Return type: str
-