Tue 25 Oct 2016 08:41:21 PM UTC, comment #9:
Ping!
The first half of this report, adding the addParameter method to inputParser, has been done.
The second half, implementing PartialMatching, has not been done in part because the code changes necessary were not presented in a Mercurial changeset format, or at the very least a diff, so that we could accurately understand what was happening.
If the original poster could submit a changeset or diff with the PartialMatching support the Octave devs can review and finish this issue report.
|
Sat 02 Jul 2016 02:09:40 AM UTC, comment #8:
Retagging as "In progress".
|
Thu 05 May 2016 04:45:05 PM UTC, comment #7:
That seems like a very bad reason to change recommend against the use of addParamValue. Anyway, then let's get this things merged one at a time.
I have added the addParameter method without the PartialMatching option. The submitted file was incorrect because it assumes that a validator argument must be submitted before the PartialMatching option. Matlab documentation suggests that the validator is optional. I have submitted a modified http://hg.savannah.gnu.org/hgweb/octave/rev/1cd04fb745f6 that does the input check but does not yet does anything yet.
If you could submit a cset instead of a modified version of an old mfile that would help to move this faster.
|
Thu 05 May 2016 11:29:57 AM UTC, comment #6:
I wrote the original patch and have quite some codebase in Matlab. In my code I replaced all occurences of addParamValue with addParameter and never had any issues. Thus, it seems that whatever worked with addParamValue, will also work with addParameter in an identical way.
Besides, the autocorrector in Matlab suggests to replace addParamValue with addParameter without changing anything else on its input variables. So it really seems that addParameter is an alias for addParamValue with an additional option.
Regards,
Laurent
|
Wed 04 May 2016 03:34:52 PM UTC, comment #5:
Like you, I do not see any difference in the doc.
If the behaviour was really different, they should have given informations to ease the migration to the new, recommended, function.
Perhaps they just found that "addParamValue" was an ugly name.
|
Wed 04 May 2016 02:57:09 PM UTC, comment #4:
I was not very clear the first time.
In this patch, the addParameter option is pretty much an alias for addParamValue and only has an extra option at the end for PartialMatchPriority. Is it true that Matlab really behaves that way?
If I was doing this myself at Mathworks, and the only difference was an extra option at the end, I could just add that extra option to addParamValue. The new extra option would still be backwards compatibility. To me, that suggests that AddParamValue and addParameter must behave somewhat different internally otherwise the deprecation of addParamValue makes no sense.
The problem is that I can't see what the difference is from their help text. And if it is true that they behave different in some way, then the patch is incorrect and addParameter needs to be implemented different than addParamValue.
|
Wed 04 May 2016 11:44:41 AM UTC, comment #3:
@carandraug
The proposed function seems useful
especially since addParamValue is "not recommended".
http://fr.mathworks.com/help/matlab/ref/inputparser.addparamvalue.html
But there would be no harm to have "PartialMatching" for addParamValue as well. Your choice.
|
Sun 21 Jun 2015 05:38:44 PM UTC, comment #2:
Hi,
my goal was to be matlab compatible. If I understand their documentation correctly, then the partial matching with priority is only available for addParameter. addParamValue only allows a partial matching without priority. Except for this difference both methods should behave identically in Matlab.
Regards,
Laurent
|
Sun 21 Jun 2015 12:24:50 PM UTC, comment #1:
So is there any difference between addParameter and addParamValue? From your patch it seems that Parameter simply adds an extra option "PartialMatching". Why not have it for ParamValue as well?
|
Sun 21 Jun 2015 09:02:58 AM UTC, original submission:
The inputParser class in octave is missing the addParameter method recently introduced in Matlab. In addition, partial matching is not implemented.
The attached file adds these two features with additional tests.
|