cyrxnopt_analysis package

Subpackages

Submodules

cyrxnopt_analysis.AMLROResultsStrategy module

class cyrxnopt_analysis.AMLROResultsStrategy.AMLROResultsStrategy[source]

Bases: ReadResultsStrategy

analyze_results(result_file: str) OptimizerResult[source]

Analyzes results from the AMLRO optimizer.

Parameters:

result_file (str) – File to read the results from. This must be formatted as a JSON file.

Returns:

Aggregated results from the optimization.

Return type:

Results

cyrxnopt_analysis.Analyzer module

class cyrxnopt_analysis.Analyzer.Analyzer(read_strategy: ReadResultsStrategy)[source]

Bases: object

analyze_directory(results_directory: str, file_pattern: str = '*', recursive: bool = False) List[OptimizerResult][source]

Analyzes all files in the given directory that match the provided regex pattern.

The results files must all be in the same format to be read correctly. If results files are in a different format, incorrect results may be collected or the program may crash. The algorithm used to analyze the file is determined by the value of read_strategy provided when the Analyzer was created.

Parameters:
  • results_directory (str) – Full path to the results directory with results files to analyze.

  • file_pattern (str) – Regex pattern that result files must match, defaults to r”*” for all files.

  • recursive (bool, optional) – Whether to find files recursively in subdirectories (True) or not (False). Defaults to “False”.

Returns:

Results object containing the results of the optimization.

Return type:

Results

analyze_results(results_file: str) OptimizerResult[source]

Analyzes the given file, accumulating the results for an optimization algorithm.

The algorithm used to analyze the file is determined by the value of read_strategy provided when the Analyzer was created.

Parameters:

results_file (str) – Full path to the results file to analyze.

Returns:

Results object containing the results of the optimization.

Return type:

Results

cyrxnopt_analysis.EDBOpResultsStrategy module

class cyrxnopt_analysis.EDBOpResultsStrategy.EDBOpResultsStrategy[source]

Bases: ReadResultsStrategy

analyze_results(result_file: str) OptimizerResult[source]

Analyzes results from the EDBOP optimizer.

Parameters:

result_file (str) – File to read the results from. This must be formatted as a JSON file.

Returns:

Aggregated results from the optimization.

Return type:

Results

cyrxnopt_analysis.NMSimplexResultsStrategy module

class cyrxnopt_analysis.NMSimplexResultsStrategy.NMSimplexResultsStrategy[source]

Bases: ReadResultsStrategy

analyze_results(result_file: str) OptimizerResult[source]

Analyzes results from the Nelder-Mead optimizer.

Parameters:

result_file (str) – File to read the results from. This must be formatted as a JSON file.

Returns:

Aggregated results from the optimization.

Return type:

Results

cyrxnopt_analysis.OptimizerResult module

class cyrxnopt_analysis.OptimizerResult.OptimizerResult[source]

Bases: dict

property best_coords
property best_iter
property best_value
property filename: str
property message
property raw_results
property total_iter

cyrxnopt_analysis.RandomResultsStrategy module

class cyrxnopt_analysis.RandomResultsStrategy.RandomResultsStrategy[source]

Bases: ReadResultsStrategy

analyze_results(result_file: str) OptimizerResult[source]

Analyzes results from the Random sampling optimizer.

Parameters:

result_file (str) – File to read the results from. This must be formatted as a JSON file.

Returns:

Aggregated results from the optimization.

Return type:

Results

cyrxnopt_analysis.ReadResultsStrategy module

class cyrxnopt_analysis.ReadResultsStrategy.ReadResultsStrategy[source]

Bases: ABC

analyze_results(result_file: str)[source]

cyrxnopt_analysis.SQSnobFitResultsStrategy module

class cyrxnopt_analysis.SQSnobFitResultsStrategy.SQSnobFitResultsStrategy[source]

Bases: ReadResultsStrategy

analyze_results(result_file: str) OptimizerResult[source]

Analyzes results from the SQSnobFit optimizer.

Parameters:

result_file (str) – File to read the results from. This must be formatted as a JSON file.

Returns:

Aggregated results from the optimization.

Return type:

Results

Module contents