4.1.1.3. bca_tool_code.general_input_modules package
4.1.1.3.1. Submodules
4.1.1.3.2. bca_tool_code.general_input_modules.average_speed module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the average speed, in miles per hour, for the indicated MOVES sourcetypes.
- File Type
comma-separated values (CSV)
- Sample Data Columns
sourceTypeID
AvgSpeed MPH
11
41.4
21
41.5
31
42.9
- Data Column Name and Description
- sourceTypeID:
The MOVES source type ID, an integer.
- AvgSpeed MPH:
The average speed of the associated source type ID, a float or integer.
CODE
- class AverageSpeed[source]
Bases:
objectThe AverageSpeed class reads the average speed input file and provides methods to query its contents.
4.1.1.3.3. bca_tool_code.general_input_modules.cost_factors module
This module was not used to support the HD2027 FRM so there is no input file(s).
- class CostFactors[source]
Bases:
objectThe CostFactors class reads the cost factors input file and provides methods to query contents.
- init_from_file(filepath, general_inputs, deflators=None)[source]
- Parameters:
filepath – Path to the specified file.
general_inputs – object; the GeneralInputs class object.
deflators – object; the appropriate deflators object (CPI or GDP-based).
- Returns:
Reads file at filepath, creates a dictionary and other attributes specified in the class __init__.
- get_factors(year_id)[source]
- Parameters:
year_id – int; the calendar year for which emission cost factors are needed.
- Returns:
A dictionary of dollar per ton cost factors for the passed year_id.
Note
Note that the BCA_General_Inputs file contains a toggle to stipulate whether to estimate emission (pollution) costs or not. This function is called only if that toggle is set to ‘Y’ (yes). The default setting is ‘N’ (no).
4.1.1.3.4. bca_tool_code.general_input_modules.def_prices module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the retail price of diesel exhaust fluid (DEF).
- File Type
comma-separated values (CSV)
- Sample Data Columns
yearID
DEF_USDperGal
DollarBasis
2012
2.6
2011
2013
2.55
2011
2014
2.5
2011
- Data Column Name and Description
- yearID:
The calendar year, an integer.
- DEF_USDperGal:
The DEF retail price per gallon.
- DollarBasis:
The dollar value of the associated price; prices are converted to analysis dollars in code.
CODE
- class DefPrices[source]
Bases:
objectThe DefPrices class reads the DEF prices file and provides methods to query contents.
- init_from_file(filepath, general_inputs, deflators)[source]
- Parameters:
filepath – Path to the specified file.
general_inputs – object; the GeneralInputs class object.
deflators – object; the Deflators class object.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
4.1.1.3.5. bca_tool_code.general_input_modules.deflators module
INPUT FILE FORMAT
The file format consists of ‘Table 1.1.9. Implicit Price Deflators for Gross Domestic Product’ from the Bureau of Economic Analysis.
The data represent price deflators for use in valuing dollars expressed in a different dollar basis than that desire for analysis. The code uses the Gross Domestic Product row of data only.
- File Type
comma-separated values (CSV)
CODE
- class Deflators[source]
Bases:
objectThe Deflators class reads the GDP Implicit Price Deflators file, generates factors for use in adjusting monetized values to a consistent cost basis, and provides methods to query the data.
Note
This class assumes a file structured like those published by the Bureau of Economic Analysis.
- init_from_file(filepath, general_inputs)[source]
- Parameters:
filepath – Path to the specified file.
general_inputs – object; the GeneralInputs class object
- Returns:
Reads file at filepath; creates a dictionary and other attributes specified in the class __init__.
- static deflator_df(df, id_col, id_value)[source]
- Parameters:
df – DataFrame; price deflator data.
id_col – str; the column name where id data can be found.
id_value – str; the identifier for the values within id_col to return.
- Returns:
A DataFrame consisting of only the data for the given AEO case; the name of the AEO case is also removed from the ‘full name’ column entries.
- static calc_adjustment_factors(general_inputs, df)[source]
- Parameters:
general_inputs – object; the GeneralInputs class object.
df – DataFrame; price deflator data.
- Returns:
A dictionary of deflators and adjustment_factors to apply to monetized values to put them all on a consistent dollar basis.
- convert_dollars_to_analysis_basis(general_inputs, df, *args)[source]
This function converts dollars into a consistent dollar basis as set via the General Inputs file.
- Parameters:
general_inputs – object; the GeneralInputs class object.
df – DataFrame; contains the monetized values and their associated input cost basis.
args – str(s); the attributes within the passed df to be adjusted into ‘dollar_basis’ dollars.
- Returns:
The passed DataFrame will all args adjusted into dollar_basis dollars.
4.1.1.3.6. bca_tool_code.general_input_modules.fuel_prices module
INPUT FILE FORMAT
The file format consists of the ‘Components of Selected Petroleum Product Prices’ from the Energy Information Administration’s Annual Energy Outlook.
The data represent liquid fuel prices for use in calculating operating costs. Which AEO fuel price case to use is set via the General Inputs file. Fuel prices are converted to analysis dollars in-code.
- File Type
comma-separated values (CSV)
CODE
- class FuelPrices[source]
Bases:
objectThe FuelPrices class grabs the appropriate fuel prices from the aeo folder, cleans up some naming and creates a fuel_prices DataFrame for use in operating costs. The class also converts AEO fuel prices to dollar_basis_analysis dollars and provides methods to query contents.
Note
This class assumes a file structured like those published by the Energy Information Administration in the Annual Energy Outlook (AEO).
- init_from_file(filepath, general_inputs, deflators)[source]
- Parameters:
filepath – Path to the specified file.
general_inputs – object; the GeneralInputs class object.
deflators – object; the Deflators class object.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_price(yearID, fuelTypeID, *series)[source]
- Parameters:
yearID – int; the calendar year.
fuelTypeID – int; 1, 2, or 3 for gasoline, diesel, or CNG, respectively.
series – str; ‘retail_fuel_price’ and/or ‘pretax_fuel_price.
- Returns:
A list of the price(s) sought expressed in dollar_basis_analysis dollars.
- static aeo_dollars(df)[source]
- Parameters:
df – DataFrame; the AEO fuel prices as read from the CSV file.
- Returns:
An integer value representing the dollar basis of the AEO report.
- static select_aeo_table_rows(df_source, row, id_col)[source]
- Parameters:
df_source – DataFrame; contains the AEO fuel prices.
row – str; the specific row to select.
id_col – str; the name of the column from which to find data (e.g., ‘full name’).
- Returns:
A DataFrame of the specific fuel price row.
- static row_dict(general_inputs, id_col, fuel)[source]
- Parameters:
general_inputs – object; the GeneralInputs class object.
id_col – str; the name of the column from which to find data (e.g., ‘full name’).
fuel – str; the fuel (e.g., gasoline or diesel).
- Returns:
A dictionary of fuel prices.
- static melt_df(df, id_col, value_name)[source]
- Parameters:
df – DataFrame; the fuel prices to melt.
id_col – str; the name of the column from which to find data (e.g., ‘full name’).
value_name – str; the name of the melted values.
- Returns:
A DataFrame of melted value_name data by year.
- get_prices_from_file(general_inputs, df, id_col, *fuels)[source]
- Parameters:
general_inputs – object; the GeneralInputs class object.
df – DataFrame; the fuel prices.
id_col – str; the name of the column from which to find data (e.g., ‘full name’).
fuels – str(s); the fuels to include in the returned DataFrame.
- Returns:
A DataFrame of fuel prices for the given AEO case with fueltype_id data included. Note that CNG prices are set equivalent to gasoline prices.
4.1.1.3.7. bca_tool_code.general_input_modules.general_functions module
- inputs_filenames(input_files_pathlist)[source]
- Parameters:
input_files_pathlist – List; those input files that are specified in the Input_Files.csv file contained in the inputs folder.
- Returns:
A list of input file full paths - these will be copied directly to the output folder so that inputs and outputs end up bundled together in the output folder associated with the given run.
- get_file_datetime(list_of_files)[source]
- Parameters:
list_of_files – List; the files for which datetimes are required.
- Returns:
A DataFrame of input files (full path) and corresponding datetimes (date stamps) for those files.
- read_input_file(path, usecols=None, index_col=None, skiprows=None, reset_index=False)[source]
- Parameters:
path – Path to the specified file.
usecols – List; the columns to use in the returned DataFrame.
index_col – int; the column to use as the index column of the returned DataFrame.
skiprows – int; the number of rows to skip when reading the file.
reset_index – Boolean; True resets index, False does not.
- Returns:
A DataFrame of the desired data from the passed input file.
Note
If a file is not found, the code issues an exit command and stops.
- save_dict(dict_to_save, save_path, row_header=None, stamp=None, index=False)[source]
- Parameters:
dict_to_save – Dictionary; the dictionary to be saved to CSV.
save_path – Path object; the path for saving the passed dict_to_save.
row_header – List; the column names to use as the row header for the preferred structure of the output file.
stamp – str; an identifier for inclusion in the filename, e.g., datetime stamp.
index – Boolean; True includes the index; False excludes the index.
- Returns:
Saves the passed dictionary to a CSV file.
- save_dict_return_df(dict_to_save, save_path, row_header=None, stamp=None, index=False)[source]
- Parameters:
dict_to_save – Dictionary; the dictionary to be saved to CSV.
save_path – Path object; the path for saving the passed dict_to_save.
row_header – List; the column names to use as the row header for the preferred structure of the output file.
stamp – str; an identifier for inclusion in the filename, e.g., datetime stamp.
index – Boolean; True includes the index; False excludes the index.
- Returns:
Saves the passed dictionary to a CSV file and returns a DataFrame based on the passed dictionary.
4.1.1.3.8. bca_tool_code.general_input_modules.general_inputs module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the general input settings for the given run.
- File Type
comma-separated values (CSV)
- Sample Data Columns
Metric
UserEntry
Notes
dollar_basis_analysis
2017
enter the dollar basis for the analysis (all monetized inputs will be converted to this basis provided the deflators input file contains necessary years)
no_action_alt
0
The optionID of the ‘no action’ option
aeo_fuel_price_case
Reference case
enter one of: “Reference case”; “High oil price”; “Low oil price” (exactly as shown)
social_discount_rate_1
0.03
social_discount_rate_2
0.07
- Data Column Name and Description
- Metric:
The input setting name.
- UserEntry:
The user provided value for the associated Metric.
- Notes:
Optional notes provided by the user; notes are ignored in-code.
CODE
- class GeneralInputs[source]
Bases:
objectThe GeneralInputs class reads the BCA_General_Inputs file and provides methods to query its contents.
4.1.1.3.9. bca_tool_code.general_input_modules.input_files module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the input file names to use for the given run.
- File Type
comma-separated values (CSV)
- Sample Data Columns
DoNotChange
UserEntry.csv
Notes
bca_inputs
BCA_General_Inputs.csv
options
Options_CAP_os0622.csv
fuel_prices
Components_of_Selected_Petroleum_Product_Prices.csv
deflators
Table_1.1.9_ImplicitPriceDeflators.csv
- Data Column Name and Description
- DoNotChange:
The file type associated, in-code, with the UserEntry.csv file name; these entries should not be changed.
- UserEntry.csv:
The user provided file name to use, including the ‘.csv’ extension. Files must be CSV format.
- Notes:
Optional notes provided by the user; notes are ignored in-code.
CODE
- class InputFiles[source]
Bases:
objectThe InputFiles class reads the InputFiles.csv file and provides methods to query its contents.
- input_files_df = Empty DataFrame Columns: [] Index: []
- input_files_pathlist = []
- init_from_file(filepath)[source]
- Parameters:
filepath – Path to the specified file.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
4.1.1.3.10. bca_tool_code.general_input_modules.markups module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent indirect cost contributors to the Retail Price Equivalent markup factor. The contributors are used to calculate the indirect cost portion of the tech cost. The data also represent the scalers, the scaling metric and the number of years of applicability that can be applied to each individual contribution factor to estimate increases due to the associated policy option.
- File Type
comma-separated values (CSV)
- Sample Data Columns
optionID
fuelTypeID
Markup_Factor
Value
Scaler
Scaled_by
NumberOfYears
0
1
Warranty
0
None
None
0
1
RnD
0.05
None
None
0
1
Other
0.36
None
None
0
1
Profit
0.06
None
None
- Data Column Name and Description
- optionID:
The option or alternative number.
- fuelTypeID:
The MOVES fuel type ID, an integer, where 1=Gasoline, 2=Diesel, etc.
- Markup_Factor:
The indirect cost contribution factor name.
- Value:
The indirect cost contribution factor value.
- Scaler:
The scaling approach to use, whether absolute or relative.
- Scaled_by:
The policy provision that impacts the scaling of the contribution factor, i.e., ‘Warranty’ or ‘R&D’.
- NumberOfYears:
The number of year, an integer, to including the scaling factor.
CODE
- class Markups[source]
Bases:
objectThe Markups class reads the Markups input file and provides methods to query its contents.
- init_from_file(filepath)[source]
- Parameters:
filepath – Path to the specified file.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_attribute_value(key, attribute_name)[source]
- Parameters:
key – tuple; (fueltype_id, option_id, markup_factor), where markup_factor is, e.g., ‘Warranty’, RnD’.
attribute_name – str; the attribute name for which a value is sought.
- Returns:
A single value associated with the attribute name for the given key.
- get_attribute_values(key)[source]
- Parameters:
key – tuple; (fueltype_id, option_id, markup_factor), where markup_factor is, e.g., ‘Warranty’, ‘RnD’.
- Returns:
A list of values for the given key.
- update_contribution_factors(vehicle, update_dict)[source]
- Parameters:
vehicle – object; a vehicle object of the Vehicles class.
update_dict – Dictionary; represents the attribute-value pairs to be updated.
- Returns:
Updates the object dictionary with each attribute updated with the appropriate value.
4.1.1.3.11. bca_tool_code.general_input_modules.moves_adjustments module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent adjustments (multipliers) to be applied to certain MOVES data attributes (e.g., ‘VPOP’, ‘VMT’) to account for vehicles covered or not covered in the analysis.
- File Type
comma-separated values (CSV)
- Sample Data Columns
optionID
sourceTypeName
sourceTypeID
regClassName
regClassID
FuelName
fuelTypeID
percent
growth
0
Long-Haul Combination Trucks
62
Urban Bus
48
Gasoline
1
1
0
0
Passenger Trucks
31
LHD
41
Diesel
2
0.051
0
0
Passenger Trucks
31
LHD45
42
Diesel
2
1
0
- Data Column Name and Description
- optionID:
The option or alternative number.
- sourceTypeName:
The MOVES source type name corresponding to the sourceTypeID.
- sourceTypeID:
The MOVES source type ID, an integer.
- regClassName:
The MOVES regulatory class name corresponding to the regClassID.
- regClassID:
The MOVES regClass ID, an integer.
- FuelName:
The MOVES fuel type name corresponding to the fuelTypeID.
- fuelTypeID:
The MOVES fuel type ID, an integer, where 1=Gasoline, 2=Diesel, etc.
- percent:
The multiplicative factor to be applied where appropriate.
- growth:
Not used.
CODE
- class MovesAdjustments[source]
Bases:
objectThe MovesAdjustments class reads the MOVES adjustments file and provides methods to query its contents.
- init_from_file(filepath)[source]
- Parameters:
filepath – Path to the specified file.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_attribute_value(vehicle, alt, attribute_name)[source]
- Parameters:
vehicle – tuple; (sourcetype_id, regclass_id, fueltype_id), option_id.
alt – int; the option_id.
attribute_name – str; the attribute name for which a value is sought.
- Returns:
A single value associated with the attribute name for the given key.
4.1.1.3.12. bca_tool_code.general_input_modules.options module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the option_id numbers and corresponding option names.
- File Type
comma-separated values (CSV)
- Sample Data Columns
optionID
optionName
0
FRM Baseline
1
FRM Final Control
- Data Column Name and Description
- optionID:
The option or alternative number.
- optionName:
The option name that corresponds to the corresponding optionID.
CODE
- class Options[source]
Bases:
objectThe Options class reads the options file and provides methods to query contents.
- init_from_file(filepath)[source]
- Parameters:
filepath – Path to the specified file.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_option_name(alt)[source]
- Parameters:
alt – int; the option_id for which the option_name is sought.
- Returns:
A string associated with the given alt (i.e., option_id).
4.1.1.3.13. bca_tool_code.general_input_modules.piece_costs module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the cost of the applicable piece of technology, indicated by the TechDescription, and the dollar basis for the cost.
- File Type
comma-separated values (CSV)
- Sample Data Columns
optionID
regClassName
regClassID
FuelName
fuelTypeID
TechDescription
2027
2031
DollarBasis
Notes
0
LHD
41
Diesel
2
CDA
0
0
0
LHD
41
Diesel
2
ClosedCrankcase
0
0
0
LHD
41
Diesel
2
EngineHardware
1065.75
0
2015
0
LHD
41
Diesel
2
EGR_CoolerBypass
0
0
- Data Column Name and Description
- optionID:
The option or alternative number.
- regClassName:
The MOVES regulatory class name corresponding to the regClassID.
- regClassID:
The MOVES regClass ID, an integer.
- FuelName:
The MOVES fuel type name corresponding to the fuelTypeID.
- fuelTypeID:
The MOVES fuel type ID, an integer, where 1=Gasoline, 2=Diesel, etc.
- TechDescription:
A description or name of the technology.
- 2027:
The cost associated with a new standard that begins in the indicated year (i.e., 2027, if applicable).
- 2031:
The cost associated with a new standard that begins in the indicated year (i.e., 2031, if applicable).
- DollarBasis:
The dollar basis (dollars valued in what year) for the corresponding cost; costs are converted to analysis dollars in-code.
- Notes:
User input area, if desired; ignored in-code.
CODE
- class PieceCosts[source]
Bases:
objectThe PieceCosts class reads the appropriate piece cost input file and converts all dollar values to dollar_basis_analysis dollars and provides methods to query the data.
- init_from_file(filepath, unit_id, general_inputs, deflators)[source]
- Parameters:
filepath – Path to the specified file.
unit_id – str; ‘engine_id’ or ‘vehicle_id’.
general_inputs – object; the GeneralInputs class object.
deflators – object; the Deflators class object.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_start_year_cost(key, attribute_name)[source]
- Parameters:
key – tuple; (unit_id, option_id, start_year) where unit_id is ‘engine_id’ or ‘vehicle_id’.
attribute_name – str; the attribute name associated with the needed cost (e.g., ‘pkg_cost’).
- Returns:
The start_year package cost for the passed engine_id under the option_id option.
- update_package_cost_by_step(vehicle, update_dict)[source]
- Parameters:
vehicle – object; a vehicle object of the Vehicles class.
update_dict – Dictionary; represents the attribute-value pairs to be updated.
- Returns:
Updates the object dictionary with each attribute updated with the appropriate value.
4.1.1.3.14. bca_tool_code.general_input_modules.runtime_options module
INPUT FILE FORMAT
The data represent options for what to include in the given run of the tool.
- File Type
comma-separated values (CSV)
- Sample Data Columns
item
user_entry
notes
calculate_cap_costs
1
1 for YES, 0 for NO
calculate_cap_pollution_effects
0
1 for YES, 0 for NO
discount_values
1
1 for YES, 0 for NO
calculate_deltas
1
1 for YES, 0 for NO
- Data Column Name and Description
- item:
The name of the runtime option; these should not be changed.
- user_entry:
A boolean indication (0 or 1) of what to include in the run.
- Notes:
User input area, if desired; ignored in-code.
CODE
- class RuntimeOptions[source]
Bases:
objectThe RuntimeOptions class reads the runtime_options file and provides methods to query its contents.
- init_from_file(filepath)[source]
- Parameters:
filepath – Path to the specified file.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_attribute_value(attribute_name)[source]
- Parameters:
attribute_name – str; the attribute for which the value is sought.
- Returns:
The UserEntry value for the given attribute_name.
4.1.1.3.15. bca_tool_code.general_input_modules.tech_penetrations module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the percentage of engines complying with the new standard, associated with standardyear_id, and in the given year, indicated by the column headers. In the table below, all engines shown comply with the 2027 standards in 2027 (and continue to do so) while no engines meet the 2031 standards in 2027 since 2027 engines would be sold prior to the 2031 standards being implemented. However, all 2031 engines comply with 2031 and later standards.
- File Type
comma-separated values (CSV)
- Sample Data Columns
optionID
regClassName
regClassID
FuelName
fuelTypeID
standardyear_id
2027
2031
0
LHD45
42
Gasoline
1
2027
1
1
0
LHD45
42
Diesel
2
2027
1
1
0
LHD45
42
CNG
3
2027
1
1
0
LHD45
42
Gasoline
1
2031
1
0
LHD45
42
Diesel
2
2031
1
0
LHD45
42
CNG
3
2031
1
- Data Column Name and Description
- optionID:
The option or alternative number.
- regClassName:
The MOVES regulatory class name corresponding to the regClassID.
- regClassID:
The MOVES regClass ID, an integer.
- FuelName:
The MOVES fuel type name corresponding to the fuelTypeID.
- fuelTypeID:
The MOVES fuel type ID, an integer, where 1=Gasoline, 2=Diesel, etc.
- standardyear_id:
The year in which a new standard or provision (for which a corresponding cost exists) is implemented.
- 2027:
The share of engines meeting a new standard that begins in the standardyear_id.
- 2031:
The share of engines meeting a new standard that begins in the standardyear_id.
CODE
- class TechPenetrations[source]
Bases:
objectThe TechPenetrations class reads the tech penetrations file and provides methods to query its contents.
- init_from_file(filepath, unit_id)[source]
- Parameters:
filepath – Path to the specified file.
unit_id – str; ‘engine_id’ or ‘vehicle_id’.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
4.1.1.3.16. bca_tool_code.general_input_modules.useful_life module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the useful life provisions for the associated optionID.
- File Type
comma-separated values (CSV)
- Sample Data Columns
optionID
regClassName
regClassID
fuelTypeID
period_id
2024
2027
2031
Notes
0
HHD8
47
2
Miles
435000
435000
435000
0
HHD8
47
2
Age
10
10
10
0
HHD8
47
2
Hours
22000
22000
22000
1
HHD8
47
2
Miles
435000
650000
650000
1
HHD8
47
2
Age
10
11
11
1
HHD8
47
3
Hours
22000
32000
32000
- Data Column Name and Description
- optionID:
The option or alternative number.
- regClassName:
The MOVES regulatory class name corresponding to the regClassID.
- regClassID:
The MOVES regClass ID, an integer.
- fuelTypeID:
The MOVES fuel type ID, an integer, where 1=Gasoline, 2=Diesel, etc.
- period_id:
The identifier, i.e., ‘Miles’, ‘Age’ or ‘Hours’
- 2024:
The miles/age/hours provision for MY2024 and later.
- 2027:
The miles/age/hours provision for MY2027 and later.
- 2031:
The miles/age/hours provision for MY2031 and later.
CODE
- class UsefulLife[source]
Bases:
objectThe UsefulLife class reads the useful life input file and provides methods to query its contents.
- init_from_file(filepath)[source]
- Parameters:
filepath – Path to the specified file.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_attribute_value(key, attribute_name)[source]
- Parameters:
key – tuple; ((regclass_id, fueltype_id), option_id, modelyear_id, period), where period_id is ‘Miles’ or ‘Age’ or ‘Hours’.
attribute_name – str; the attribute name for which a value is sought (e.g., period_value).
- Returns:
A single value associated with the period_id for the given key.
4.1.1.3.17. bca_tool_code.general_input_modules.warranty module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the warranty provisions for the associated optionID.
- File Type
comma-separated values (CSV)
- Sample Data Columns
optionID
regClassName
regClassID
fuelTypeID
period_id
2024
2027
2031
0
HHD8
47
1
Miles
50000
50000
50000
0
HHD8
47
1
Age
5
5
5
0
HHD8
47
3
Hours
1
HHD8
47
3
Miles
100000
450000
450000
1
HHD8
47
3
Age
5
7
7
1
HHD8
47
1
Hours
8000
8000
- Data Column Name and Description
- optionID:
The option or alternative number.
- regClassName:
The MOVES regulatory class name corresponding to the regClassID.
- regClassID:
The MOVES regClass ID, an integer.
- fuelTypeID:
The MOVES fuel type ID, an integer, where 1=Gasoline, 2=Diesel, etc.
- period_id:
The identifier, i.e., ‘Miles’, ‘Age’ or ‘Hours’
- 2024:
The miles/age/hours provision for MY2024 and later.
- 2027:
The miles/age/hours provision for MY2027 and later.
- 2031:
The miles/age/hours provision for MY2031 and later.
CODE
- class Warranty[source]
Bases:
objectThe Warranty class reads the warranty input file and provides methods to query its contents.
- init_from_file(filepath)[source]
- Parameters:
filepath – Path to the specified file.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_attribute_value(key, attribute_name)[source]
- Parameters:
key – tuple; ((regclass_id, fueltype_id), option_id, modelyear_id, period_id), where period_id is ‘Miles’ or ‘Age’ or ‘Hours’.
attribute_name – str; the attribute name for which a value is sought (e.g., period_value).
- Returns:
A single value associated with the period_id for the given key.
4.1.1.3.18. bca_tool_code.general_input_modules.warranty_base_costs module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the warranty cost per year of warranty coverage.
- File Type
comma-separated values (CSV)
- Sample Data Columns
regClassName
regClassID
FuelName
fuelTypeID
Cost
DollarBasis
LHD
41
Gasoline
1
0
LHD45
42
Gasoline
1
1000
2018
EMA public comments at page 151
MHD67
46
Gasoline
1
1000
2018
ibid
HHD8
47
Gasoline
1
1000
2018
ibid
UrbanBus
48
Gasoline
1
0
LHD
41
Diesel
2
1000
2018
ibid
LHD45
42
Diesel
2
1000
2018
ibid
MHD67
46
Diesel
2
1000
2018
ibid
HHD8
47
Diesel
2
1000
2018
ibid
UrbanBus
48
Diesel
2
1000
2018
ibid
LHD
41
CNG
3
0
LHD45
42
CNG
3
0
MHD67
46
CNG
3
0
HHD8
47
CNG
3
1000
2018
ibid
UrbanBus
48
CNG
3
1000
2018
ibid
- Data Column Name and Description
- regClassName:
The MOVES regulatory class name corresponding to the regClassID.
- regClassID:
The MOVES regClass ID, an integer.
- FuelName:
The MOVES fuel type name corresponding to the fuelTypeID.
- fuelTypeID:
The MOVES fuel type ID, an integer, where 1=Gasoline, 2=Diesel, etc.
- Cost:
The cost per year of warranty coverage.
- DollarBasis:
The dollar basis (dollars valued in what year) for the corresponding cost; costs are converted to analysis dollars in-code.
CODE
- class BaseWarrantyCosts[source]
Bases:
objectThe BaseWarrantyCosts class reads the appropriate warranty costs input file and converts all dollar values to dollar_basis_analysis dollars and provides methods to query the data.
- init_from_file(filepath, general_inputs, deflators)[source]
- Parameters:
filepath – Path to the specified file.
general_inputs – object; the GeneralInputs class object.
deflators – object; the Deflators class object.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
4.1.1.3.19. bca_tool_code.general_input_modules.warranty_extended module
INPUT FILE FORMAT
The file format consists of a one-row data header and subsequent data rows.
The data represent the share of engines sold with an extended warranty along with the length of that extended warranty.
- File Type
comma-separated values (CSV)
- Sample Data Columns
regClassName
regClassID
FuelName
fuelTypeID
period_id
Share
Base
Extended
HHD8
47
Diesel
2
Miles
1
100000
250000
HHD8
47
CNG
3
Miles
1
100000
250000
MHD67
46
Diesel
2
Miles
0.5
100000
150000
MHD67
46
CNG
3
Miles
0.5
100000
150000
- Data Column Name and Description
- regClassName:
The MOVES regulatory class name corresponding to the regClassID.
- regClassID:
The MOVES regClass ID, an integer.
- FuelName:
The MOVES fuel type name corresponding to the fuelTypeID.
- fuelTypeID:
The MOVES fuel type ID, an integer, where 1=Gasoline, 2=Diesel, etc.
- period_id:
The identifier, i.e., ‘Miles’, ‘Age’ or ‘Hours’
- Share:
The share of engines purchased with extended warranty coverage in the no-action scenario.
- Base:
The required base warranty coverage.
- Extended:
The extended warranty coverage.
CODE
- class WarrantyExtended[source]
Bases:
objectThe WarrantyExtended class reads the appropriate extended_warranty_share input file and provides methods to query the data.
- init_from_file(filepath)[source]
- Parameters:
filepath – Path to the specified file.
- Returns:
Reads file at filepath; converts monetized values to analysis dollars (if applicable); creates a dictionary and other attributes specified in the class __init__.
- get_scaler(vehicle)[source]
- Parameters:
vehicle – object; an object of the Vehicle class.
- Returns:
The share with extended warranty for the passed engine_id under the option_id option and the scaler to apply to the base warranty cost.
- Parameters:
engine_id – tuple; the engine_id (regclass_id, fueltype_id).
- Returns:
The extended warranty miles and the share with extended warranty.
- Parameters:
engine_id – tuple; the engine_id (regclass_id, fueltype_id).
- Returns:
The share with extended warranty.
4.1.1.3.20. bca_tool_code.general_input_modules.warranty_new_tech_adj_factor module
- class WarrantyNewTechAdj[source]
Bases:
objectThis class is not being used. The WarrantyNewTechAdj class reads the warranty_new_tech_adj_factor input file and provides methods to query its contents.