Skip to content

OverflowError: cannot convert float infinity to integer in reading case_RTS_GMLC #30

@yasirroni

Description

@yasirroni

In reading case_RTS_GMLC.m,

from matpowercaseframes import CaseFrames


case_name = "case_RTS_GMLC"
cf = CaseFrames(case_name)

But, it works using load_case_engine.

cf = CaseFrames(case_name, load_case_engine=m)

But, using .infer_numpy() cause warning

cf.infer_numpy()
# RuntimeWarning: invalid value encountered in cast
#   if (arr.astype(int) == arr).all():
# RuntimeWarning: invalid value encountered in cast
#   if (arr.astype(int) == arr).all():

Also, I think it would be better to use C..., X..., and Y... as described in here.

header = {"MODEL", "STARTUP", "SHUTDOWN", "NCOST"};
if mpc.gencost(1, MODEL) == PW_LINEAR
  N = (size(mpc.gencost, 2) - NCOST) / 2;
  for i = 1:N
    header{end+1} = sprintf('X%d', i);
    header{end+1} = sprintf('Y%d', i);
  end
else
  N = size(mpc.gencost, 2) - NCOST;
  for i = N-1:-1:0
    header{end+1} = sprintf('C%d', i);
  end
endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions