Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Table Data Parser: Fix error thrown on NA fields #1185

Open
ktehranchi opened this issue Sep 4, 2024 · 0 comments
Open

Table Data Parser: Fix error thrown on NA fields #1185

ktehranchi opened this issue Sep 4, 2024 · 0 comments
Assignees

Comments

@ktehranchi
Copy link

Per discussion with @pesap:

The table data parser will throw errors if active_power , min_rated_capacity, fuel_price, heat_rate_aX is NA for thermal generators. There should be some code to catch the NA and throw a warning instead of erroring out:

stack trace:

ERROR: MethodError: no method matching calculate_rating(::@NamedTuple{min::Nothing, max::Float64}, ::Nothing)

Closest candidates are:
  calculate_rating(::Union{Nothing, @NamedTuple{min::Float64, max::Float64}}, ::Union{Nothing, @NamedTuple{min::Float64, max::Float64}})
   @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/common.jl:123

Stacktrace:
 [1] make_thermal_generator(data::PowerSystemTableData, gen::@NamedTuple{…}, cost_colnames::PowerSystems._HeatRateColumns, bus::ACBus)
   @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:1124
 [2] make_generator(data::PowerSystemTableData, gen::@NamedTuple{…}, cost_colnames::PowerSystems._HeatRateColumns, bus::ACBus, gen_storage::Tuple{…})
   @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:796
 [3] gen_csv_parser!(sys::System, data::PowerSystemTableData)
   @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:563
 [4] System(data::PowerSystemTableData; time_series_resolution::Nothing, time_series_in_memory::Bool, time_series_directory::Nothing, runchecks::Bool, kwargs::@Kwargs{})
   @ PowerSystems ~/.julia/packages/PowerSystems/Stu3w/src/parsers/power_system_table_data.jl:279
 [5] top-level scope
   @ REPL[104]:1
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants