Closed casinocullen closed 3 months ago
Bigger issue found: update_marginal_costs
doesn't work on Texas.. Solving the bug now.
I found the reason that update_marginal_costs
doesn't work for Texas. The fuel_region_type
in ng_fuel_prices.csv
doesn't have any balancing area columns for ERCOT, therefore the dataframe gen
would be empty, and cause the problem for the following codes:
# fuel_costs.set_index(fuel_region_type, inplace=True)
for fuel_region in gen[fuel_region_type].unique():
gens_in_region = gen[gen[fuel_region_type] == fuel_region].index.to_list()
dfs.append(
pd.DataFrame({gen_: fuel_costs[fuel_region] for gen_ in gens_in_region})
)
df = pd.concat(dfs, axis=1)
Now, I added
if len(gen) == 0:
continue
before running the above code to avoid the issue.
Checklist
master
branchpypsa-usa
environment. Update viaconda env update -f envs/environment.yaml
The Issue
In
add_electricity.py
, the codegen[f"{fuel_region_type}"] = gen.bus.map(bus_region_mapper)
has an issue because the column type doesn't match (the bus column ingen
is integer while inbus_region_mapper
is string)Steps To Reproduce
No response
Expected Behavior
No response
Error Message
No response
Anything else?
No response