Skip to content

Commit

Permalink
Update class doc for dm_converter_mpc2/legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
rdzman committed Oct 10, 2023
1 parent 85387b8 commit a047bc9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
13 changes: 10 additions & 3 deletions lib/+mp/dm_converter_mpc2.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
classdef dm_converter_mpc2 < mp.dm_converter
% mp.dm_converter_mpc2 - |MATPOWER| **data model converter** for MATPOWER case v2.
%
% This concrete class implements importing/exporting of data models for
% version 2 of the classic |MATPOWER| case format. That is, the *data
% source* **d** for this class is expected to be a |MATPOWER| case struct.
% This class implements importing/exporting of data models for version 2
% of the classic |MATPOWER| case format. That is, the *data source* **d**
% for this class is expected to be a |MATPOWER| case struct.
%
% mp.dm_converter_mpc2 Methods:
% * dm_converter_mpc2 - constructor
% * format_tag - return char array identifier for data source/format (``'mpc2'``)
% * import - import data from a |MATPOWER| case struct into a data model
% * export - export data from a data model to a |MATPOWER| case struct
% * save - save |MATPOWER| case struct to a file
%
% See also mp.dm_converter.

Expand Down
12 changes: 9 additions & 3 deletions lib/+mp/dm_converter_mpc2_legacy.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
% Adds to mp.dm_converter_mpc2 the ability to handle legacy user
% customization.
%
% mp.dm_converter_mpc2_legacy Methods:
% * legacy_user_mod_inputs - pre-process legacy inputs for use-defined customization
% * legacy_user_nln_constraints - pre-process legacy inputs for user-defined nonlinear constraints
%
% See also mp.dm_converter, mp.dm_converter_mpc2, mp.task_opf_legacy.

% MATPOWER
Expand All @@ -19,10 +23,10 @@

methods
function dm = legacy_user_mod_inputs(obj, dm, mpopt, dc)
% Handles pre-processing of inputs related to legacy user-defined
% Handle pre-processing of inputs related to legacy user-defined
% variables, costs, and constraints. This includes optional
% ``mpc`` fields ``A``, ``l``, ``u``, ``N``, ``fparm``, ``H1``,
% ``Cw``, ``z0``, ``zl``, and ``zu``.
% ``Cw``, ``z0``, ``zl``, ``zu`` and ``user_constraints``.

%% create (read-only) copies of individual fields for convenience
mpc = dm.source;
Expand Down Expand Up @@ -111,9 +115,11 @@
end

function uc = legacy_user_nln_constraints(obj, dm, mpopt)
% Handles pre-processing of inputs related to legacy user-defined
% Handle pre-processing of inputs related to legacy user-defined
% non-linear constraints, specifically optional ``mpc`` fields
% ``user_constraints.nle`` and ``user_constraints.nli``.
%
% Called by legacy_user_mod_inputs() method.

mpc = dm.source;

Expand Down

0 comments on commit a047bc9

Please sign in to comment.