MATPOWER / most

MOST – MATPOWER Optimal Scheduling Tool, for steady-state power systems scheduling problems.
https://matpower.org/
Other
31 stars 12 forks source link

xgd changes in profile #1

Closed rdzman closed 7 years ago

rdzman commented 7 years ago

Thanks @ssuffian for catching this. I'm copying what you submitted in MATPOWER/matpower#27 here, since it's a MOST issue, rather than a core MATPOWER issue.

I have tried to update the CommitKey using a profile. Using example 6, but adding the following profile:

xgd_profile = struct( ...
    'type', 'xGenData', ...
    'table', 'CommitKey', ...
    'rows', 0, ...
    'col', 0, ...
    'chgtype', CT_REP, ...
    'values', [] );
xgd_profile.values = ones(12,1);

Results in the following error:

Operands to the || and && operators must be convertible to logical scalar values.

I believe I fixed it by changing line 190 from ng = dim; to ng = dim(3), since dim is an array of [nt nj_max ng] that is passed from line 575 in loadmd. However since this is such a small change, I wasn't sure whether to go through the pull request process or simply put the issue here.

most_issue1.m.txt

rdzman commented 7 years ago

This is a perfect example of the motto:

If you didn't test it, it doesn't work

MOST clearly needs better test coverage. Thanks @ssuffian!