Accert Code Reference#

This section provides detailed information on the Accert codebase. The Accert codebase is divided into two main sections: the main Accert class and utility functions. The main Accert class contains the main functions and methods for the Accert model, while the utility functions contain helper functions for the Accert model.

Accert Class#

Main.Accert.__init__(input_path, accert_path)

Initialize the Accert class.

Main.Accert.setup_table_names(xml2obj)

Setup different table names in the database.

Main.Accert.load_obj(input_path, accert_path)

Convert son file to xml stream and creates a python data structure.

Main.Accert.get_current_COAs(c, inp_id)

Get current Code of Accounts based on the input ID of Super Account.

Main.Accert.update_account_before_insert(c, ...)

Updates the current COAs ind.

Main.Accert.insert_new_COA(c, ind, ...[, ...])

Insert a new COA in between an index in the account table.

Main.Accert.insert_COA(c, sup_coa, ...)

Insert a new COA into the account table.

Main.Accert.extract_variable_info_on_name(c, ...)

Extracts variable info based on a specific variable name.

Main.Accert.extract_super_val(c, var_id)

Extracts information on the super variable based on a specific variable name.

Main.Accert.update_input_variable(c, var_id, ...)

Updates an input variable value and unit based on variable's ID.

Main.Accert.update_variable_info_on_name(c, ...)

Updates variable info based on variable name.

Main.Accert.update_super_variable(c, var_id)

Updates super variable info based on variable name.

Main.Accert.extract_total_cost_on_name(c, tc_id)

Extracts information of the total cost based on a specific total cost's ID.

Main.Accert.cal_LCOE(c, ut, accert)

Calculates the Levelized Cost of Energy (LCOE) based on the input data.

Main.Accert.check_unit_conversion(org_unit, ...)

Checks if unit conversion is needed.

Main.Accert.convert_unit(current_value, ...)

Converts the current unit to a new unit.

Main.Accert.convert_unit_scale(current_unit, ...)

Converts the current unit to a new unit in a scale pattern.

Main.Accert.update_total_cost(c, tc_id, ...)

Updates the total cost based on a total cost ID.

Main.Accert.update_total_cost_on_name(c, ...)

Updates the total cost based on a total cost ID, without checking for unit conversion.

Main.Accert.get_var_value_by_name(c, var_name)

Get a variable value based on a specific variable name.

Main.Accert.run_pre_alg(alg, **kwargs)

Runs pre-algorithms.

Main.Accert.update_account_value(alg_py, ...)

Calls the specified algorithm with the given variables.

Main.Accert.update_cost_element_on_name(c, ...)

Updates the cost element based on cost element name.

Main.Accert.update_new_cost_elements(c)

Calculates and updates affected cost elements based on the user input.

Main.Accert.update_new_accounts(c)

Updates the affected accounts based on the variables.

Main.Accert.update_account_table_by_cost_elements(c)

Updates the account table based on the sum of the cost elements.

Main.Accert.roll_up_cost_elements(c)

Rolls up cost elements from level 3 to 0 for pwr.

Main.Accert.roll_up_cost_elements_by_level(c, ...)

Rolls up cost elements from an input lower level to a higher level.

Main.Accert.roll_up_account_table(c[, ...])

Rolls up the account table from level 3 to 0.

Main.Accert.roll_up_account_table_by_level(c, ...)

Rolls up the account table from an input lower level to a higher level.

Main.Accert.roll_up_account_table_GNCOA(c)

Rolls up the account table for the reactor model that only has limited accounts.

Main.Accert.sum_cost_elements_2C(c)

Sums the cost elements for COA 2C (Calculated cost).

Main.Accert.roll_up_lmt_account_2C(c)

Sums up total cost of account 2C for the reactor model that only has limited accounts.

Main.Accert.roll_up_lmt_direct_cost(c)

Sums up the total cost of account 2 from account 2C for the reactor model that only has limited accounts.

Main.Accert.cal_direct_cost_elements(c)

Calculates the direct cost elements for the ABR including the factory, labor, and material costs.

Main.Accert.roll_up_lmt_account_table(c)

Rolls up the account table for the reactor model that only has limited accounts.

Main.Accert.print_logo()

Prints the ACCERT logo.

Main.Accert.execute_accert(c, ut)

Executes the ACCERT program.

Main.Accert.process_reference_model(c, ut, ...)

Processes the reference model.

Main.Accert.process_power_inputs(c, accert)

Processes the power inputs.

Main.Accert.process_variables(c, accert)

Processes the variables.

Main.Accert.process_super_values(c, var_id)

Processes the super variables.

Main.Accert.process_COA(c, accert)

Change the total cost of the account table by user inputs.

Main.Accert.process_level_accounts(c, ...[, ...])

Processes the level accounts and begins the calculation.

Main.Accert.process_ce(c, account)

Processes the cost elements, either by changing variables or algorithms.

Main.Accert.process_var(c, var_inp)

Processes the variables, changing the variables by user inputs, and updating the super values.

Main.Accert.process_alg(c, alg_inp)

Processes the variables with algorithm.

Main.Accert.check_and_process_total_cost(c, ...)

Checks and processes the total cost at the end of the calculation, if the total cost has changed by user inputs.

Main.Accert.check_total_cost_changed(c, accert)

Checks if the total cost has changed.

Main.Accert.check_total_cost_accounts(c, ...)

Checks if the total cost has changed for the accounts.

Main.Accert.process_total_cost(c, accert)

Changes the total cost for the accounts using the user inputs.

Main.Accert.process_total_cost_accounts(c, ...)

Changes the total cost for the accounts using the user inputs for different levels.

Main.Accert.exit_with_error(accert)

Exits the program with an error message.

Main.Accert.finalize_process(c, ut, accert)

Finalizes the process by extracting the affected variables, cost elements, and accounts.

Main.Accert.generate_results(c, ut, accert)

Generates the results.

Main.Accert._generate_common_results(c, ut, ...)

Generates the common results for the models.

Main.Accert._common_cost_processing(c, accert)

Common cost processing for the models with limited accounts.

Main.Accert._print_results(ut, c, fac, lab, ...)

Prints the results.

Main.Accert._pwr12be_processing(c, ut, accert)

Processing for the pwr12-be model.

Main.Accert._no_cost_element_processing(c, ...)

Processing for the fusion model.

Main.Accert.generate_results_table_with_cost_elements(c, conn)

Generates the results table with cost elements.

Main.Accert._generate_excel(c, ...[, ...])

Generate an Excel file from stored procedure results.

Main.Accert.generate_results_table(c, conn)

Generates the results tables.

Accert Utility Functions#

utility_accert.Utility_methods.__init__()

utility_accert.Utility_methods.setup_table_names(c, ...)

utility_accert.Utility_methods.print_table(c)

Prints the table in an organized format via the PrettyTable library.

utility_accert.Utility_methods.print_account(c)

Prints the account table.

utility_accert.Utility_methods.print_leveled_accounts(c)

Prints the output account table with COA line up as a nested list.

utility_accert.Utility_methods.print_leveled_accounts_gncoa(c)

Prints the output account table with GNCOA line up as a nested list.

utility_accert.Utility_methods.print_algorithm(c)

Prints the output algorithm table.

utility_accert.Utility_methods.print_cost_element(c)

Prints the output cost element table.

utility_accert.Utility_methods.print_facility(c)

Prints the output facility table.

utility_accert.Utility_methods.print_escalation(c)

Prints the output escalation table.

utility_accert.Utility_methods.print_variable(c)

Prints the output variable table.

utility_accert.Utility_methods.print_user_request_parameter(c)

Prints the output user request parameter table.

utility_accert.Utility_methods.print_updated_cost_elements(c)

Prints the output updated cost elements table.

utility_accert.Utility_methods.extract_affected_cost_elements(c)

Extracts affected cost elements from cost element table and groups them by changed variables.

utility_accert.Utility_methods.extract_affected_accounts(c)

Extracts affected accounts from account table.

utility_accert.Utility_methods.extract_user_changed_variables(c)

Extracts user changed variables from variable table.

utility_accert.Utility_methods.extract_changed_cost_elements(c)

Extracts changed cost elements from the cost element table.