outputs#

Write output files.

wip.modules.outputs.define_optimization_results(solver_path: str, scalers: Dict[str, MinMaxScaler], datasets: Dict[str, DataFrame], solver)[source]#
Parameters
wip.modules.outputs.get_pisystem_tag_name(pims_tag_name: str) str[source]#

Get the PI System tag name from the PIMS tag name.

This function starts by cleaning the pims_tag_name string. The cleaning process performs the following operations:

  1. If the pims_tag_name has the “@” symbol, then the string is split

    into two parts: the first part is the prefix and the second part is the rest of the string. Then all ‘_’ are replaced with ‘-‘ for the second part of the string. Finally, the prefix and the second part of the string are rejoined together with the ‘@’ symbol between them.

  2. All ‘___’ are replaced with ‘ - ‘.

  3. All ‘__’ are replaced with ‘_’.

  4. Function removes leading ‘_’.

After the cleaning process, the function checks if the pims_tag_name is in the pims_to_pisystem_dict dictionary. If it’s, then the corresponding PI System tag name is returned. If it’s not, then the function tries to find the key in the pims_to_pisystem_dict dictionary that’s the most similar to the pims_tag_name. If a similar key is found, then the corresponding PI System tag name is returned. If a similar key isn’t found, then the function logs an error message and returns the cleaned tag name.

Parameters

pims_tag_name (str) – Tag name in the PIMS format.

Returns

PI System tag name or clean tag name if the PI System tag name isn’t found in the pims_to_pisystem_dict dictionary.

Return type

str

Notes

This function is intended to be used to convert the variables’ names post-optimization, to include them in the final results file.

wip.modules.outputs.increasing_temp_gq(solver_path, scalers, datasets)[source]#
wip.modules.outputs.lp_variables_to_excel(lp_problem: LpProblem, output_path: str, format: str = 'xlsx')[source]#

Save the LP variables to an Excel file.

Parameters
  • lp_problem (LpProblem) –

  • output_path (str) –

  • format (str) –

wip.modules.outputs.replace_symbols(name: str) str[source]#

Replace certain words in a string with mathematical symbols.

This function takes a string and replaces occurrences of the words ‘equal’, ‘div’, and ‘mult’ with the mathematical symbols ‘=’, ‘/’, and ‘*’, respectively.

Parameters

name (str) – Input string which may contain the words ‘equal’, ‘div’, and ‘mult’ that need to be replaced with their corresponding mathematical symbols.

Returns

Output string after replacing the words with the corresponding mathematical symbols.

Return type

str

Examples

>>> replace_symbols("x mult y div z equal 10")
'x * y / z = 10'
wip.modules.outputs.rot_pot_filtragem(solver_path, scalers, datasets)[source]#
wip.modules.outputs.write_objective_function_coef(solver_path, scalers)[source]#