4.1. bca_tool_code package

4.1.1. Subpackages

4.1.2. Submodules

4.1.3. bca_tool_code.cost_calcs module

class CostCalcs[source]

Bases: object

__init__()[source]
calc_results(settings)[source]
update_object_dict(key, update_dict)[source]
Parameters
  • key – tuple; (vehicle_id, option_id, modelyear_id, age_id, discount_rate).

  • update_dict – Dictionary; represents the attribute-value pairs to be updated.

Returns

Updates the object dictionary with each attribute updated with the appropriate value.

get_attribute_values(key, *attribute_names)[source]
Parameters
  • key – tuple; (vehicle_id, option_id, model_year, age_id, discount_rate).

  • attribute_names – str(s); the attribute names for which values are sought.

Returns

A list of attribute values associated with attribute_names for the given key.

get_attribute_value(key, attribute_name)[source]
Parameters
  • key – tuple; (vehicle_id, option_id, model_year, age_id, discount_rate).

  • attribute_name – str; the attribute name for which a value is sought.

Returns

The attribute value associated with attribute_name for the given key.

static create_new_attributes(settings)[source]
Parameters

settings – object; the SetInputs class object.

Returns

A list of new attributes to be added to the data_object dictionary.

add_keys_for_discounting(general_inputs, input_dict)[source]
Parameters
  • general_inputs – object; the GeneralInputs class object.

  • input_dict – Dictionary; into which new keys will be added that provide room for discounting data.

Returns

The passed dictionary with new keys added.

4.1.4. bca_tool_code.set_inputs module

class SetInputs[source]

Bases: object

The SetInputs class establishes the input files to use and other input settings set in the BCA_Inputs file and needed within the tool.

__init__()[source]

4.1.5. bca_tool_code.set_paths module

class SetPaths[source]

Bases: object

The SetPaths class sets the paths and run_id info used by the tool.

__init__()[source]
files_in_code_folder()[source]

This is just a generator that allows for copy/paste of tool code into a bundle of folders and files saved to the outputs folder.

Returns

A generator object.

copy_code_to_destination(destination)[source]

This is just a generator that allows for copy/paste of tool code into a bundle of folders and files saved to the outputs folder.

Parameters

destination – Path; the destination folder; destination folder must exist prior to method call.

Returns

Nothing, but copies contents of code folder to the destination.

static run_id()[source]

This method allows for a user-interactive identifier (name) for the given run.

Returns

A console prompt to enter a run identifier; entering “test” sends outputs to a test folder; if left blank a default name is used.

create_output_paths(start_time_readable, run_id)[source]
Parameters::

start_time_readable: str; the start time of the run, in text readable format.

run_id: str; the run ID entered by the user or the default value if the user does not provide an ID.

Returns

Output paths into which to save outputs of the given run.

4.1.6. bca_tool_code.tool_main module

main()[source]

This is the main module of the tool.

Returns

The results of the current run of the tool.