bugGNU Octave - Bugs: bug #57627, Validator functions (mustBe*)...

 
 

bug #57627: Validator functions (mustBe*) implementation

Submitter:  Andrew Janke <apjanke>
Submitted:  Sat 18 Jan 2020 04:32:57 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  siko1056
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 21 Jan 2020 04:25:45 PM UTC, comment #13: 

You're welcome! Glad to help out!

Andrew Janke <apjanke>
Tue 21 Jan 2020 04:23:45 PM UTC, comment #12: 

Andrew, with these two changesets your contribution should receive the necessary attention in the Octave manual.

https://hg.savannah.gnu.org/hgweb/octave/rev/8f33435cfb00
https://hg.savannah.gnu.org/hgweb/octave/rev/8a07553faf2b

Closing report with big thanks.

Kai Torben Ohlhus <siko1056>
Group Member
Tue 21 Jan 2020 12:54:30 PM UTC, comment #11: 

Oops, some idiocy on my part, sorry for the noise!

Colin Macdonald <cbm>
Tue 21 Jan 2020 12:42:31 PM UTC, comment #10: 

You're welcome!

Andrew Janke <apjanke>
Tue 21 Jan 2020 12:34:22 PM UTC, comment #9: 

Regarding comment #7 I did not see this string either in the patches.

Thank you again Andrew.  I finally confirmed all your BISTs with Matlab R2019a and pushed them to default

https://hg.savannah.gnu.org/hgweb/octave/rev/c9dd91b438fd
https://hg.savannah.gnu.org/hgweb/octave/rev/a9a8699a3749

Last remaining item for me is mentioning them in the docs, that is my TODO for now ;-)  Brew some coffee

Kai Torben Ohlhus <siko1056>
Group Member
Tue 21 Jan 2020 11:50:13 AM UTC, comment #8: 

You're welcome!

LOL, looks like someone was accidentally typing in the wrong window.

Maybe it was you, actually? I don't see that string anywhere in either the repo or the patch file attached here.

Andrew Janke <apjanke>
Tue 21 Jan 2020 11:06:50 AM UTC, comment #7: 

Thanks for this feature!

Surely this is a syntax error?

%! mustBeMember (4The question is, why do we have2, 38:50)


Colin Macdonald <cbm>
Mon 20 Jan 2020 05:15:30 AM UTC, comment #6: 

Here is a patch with BISTs for all the validator functions: https://savannah.gnu.org/bugs/download.php?file_id=48255

This patch also removes the output arguments from the validator functions. That was a non-Matlab-compatible extension that I pulled over from Validoozy by mistake.

Andrew Janke <apjanke>
Sun 19 Jan 2020 01:10:38 AM UTC, comment #5: 

First part done:

https://hg.savannah.gnu.org/hgweb/octave/rev/3b8d21ff0ca6

The renaming items are:

- BIST
- short section in the manual

The latter one I can take care of.

Kai Torben Ohlhus <siko1056>
Group Member
Sat 18 Jan 2020 06:30:17 PM UTC, comment #4: 

Sounds good! Thanks.

Andrew Janke <apjanke>
Sat 18 Jan 2020 06:22:44 PM UTC, comment #3: 


> Based on the discussion at https://lists.gnu.org/archive/html/octave-maintainers/2020-01/msg00075.html, I thought we were no longer including copyright notices in the individual files? I actually had copyright headers in there originally, and went through and removed them. :) Did I misunderstand what was meant by moving to centralized copyright notices?


Yes Octave core has a "standard" copyright header now.  Then maintaining the copyright year becomes even more scriptable.
 

> Sorry for causing you additional work. Some day I'll get good enough with Octave code style that my patches won't require futzing with for style purposes.


Actually, I am no 100% expert either.  I just orient myself in the neighboring files and the wiki ;-)

> If this gets merged, I'll go through and add BISTs for all of them. I just didn't know what was the right form for writing a BIST that tests "such-and-such should raise an error".


Then you can wait until tomorrow (JST), then after building Octave again (seeing if I broke something). I push patch v2 and you can provide a second patch with only BIST tests if I am too lazy to write them.

Kai Torben Ohlhus <siko1056>
Group Member
Sat 18 Jan 2020 06:12:42 PM UTC, comment #2: 

Based on the discussion at https://lists.gnu.org/archive/html/octave-maintainers/2020-01/msg00075.html, I thought we were no longer including copyright notices in the individual files? I actually had copyright headers in there originally, and went through and removed them. :) Did I misunderstand what was meant by moving to centralized copyright notices?

Sorry for causing you additional work. Some day I'll get good enough with Octave code style that my patches won't require futzing with for style purposes.

If this gets merged, I'll go through and add BISTs for all of them. I just didn't know what was the right form for writing a BIST that tests "such-and-such should raise an error".

Andrew Janke <apjanke>
Sat 18 Jan 2020 06:04:59 PM UTC, comment #1: 

Thank you for your patch Andrew.  Lots of redundant but meditative work.  With file #48246 I tried to come even closer to the Octave standards and basically the patch can go into Octave 6.

To be 100% nice, we need some BISTs for each file.  But for now I am fed up with 12x copy&paste.

Kai Torben Ohlhus <siko1056>
Group Member
Sat 18 Jan 2020 04:32:57 PM UTC, original submission:  

Here's a Matlab-compatible implementation of the mustBe* family of validator functions.

This is based on the Validatinator library (https://github.com/apjanke/octave-validatinator). But this patch only includes Matlab-matching behavior; it does not include the Validatinator extensions like "label" arguments or additional validator functions.

This patch is based on default. Maybe it could make it in for Octave 6?

Andrew Janke <apjanke>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #48255:  validator-functions-bists.patch added by apjanke (33KiB - application/octet-stream - BISTs for the validator functions)
file #48245:  validator-functions.patch added by apjanke (18KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by apjanke (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-21 siko1056 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2020-01-20 apjanke Attached File- Added validator-functions-bists.patch, #48255
    2020-01-18 siko1056 Attached File- Added validator-functions-v2.patch, #48246
        StatusNone In Progress
        Assigned toNone siko1056
    2020-01-18 apjanke Attached File- Added validator-functions.patch, #48245

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code