Closed gschivley closed 5 years ago
@gschivley I do not get this error, but I agree this is a potential issue. According to stewi format specs, FacilityIDs are always a string. In electricitylci I tried to stick with this rule. In this case I just modified eia923_generation.py at ln 45. so that if the EIA923 csv file already exists on the users machine, it will read it in and set Plant Id to a string. If the file didn't exist, it was already set to a string from the excel read in ln 27.
Good to know. I've always used EIA plant id/codes as integers but maybe they are better as strings.
Probably not worth the effort, but parameter dictionaries for reading each file type could be stored in a parameters file. Could even include the expected file path.
eia923_gen_fuel_excel_kwargs = dict(
sheet_name='Page 1 Generation and Fuel Data',
header=5,
na_values=['.'],
dtype={'Plant Id': str,
'YEAR': str}
)
eia923_gen_fuel_csv_kwargs = dict(
dtype={'Plant Id': str,
'YEAR': str}
)
These would be used as kwargs when reading data files.
eia = pd.read_excel(eia923_path, **eia923_gen_fuel_excel_kwargs)
When trying to run lines in the build_model.py script I encountered the following exception:
Upon inspection it appears that the eGRID
FacilityID
values are strings and the EIA923Plant Id
values are integers.