bugGNU Octave - Bugs: bug #46662, improve missing function hook to...

 
 

bug #46662: improve missing function hook to be able to report class methods by name in packages

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Thu 10 Dec 2015 09:05:12 PM UTC
   
 
Category:  Interpreter Severity:  1 - Wish
Priority:  1 - Later Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Nicholas Jankowski Open/Closed:  * Open
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 26 Feb 2019 09:07:59 PM UTC, comment #6: 

Trying to re-summarize this accurately as an Octave feature request.

The 'taylor' function in the symbolic package is actually a method of the '@sym' class. If a user calls 'taylor(x)' on a symbolic argument, it works, but if a user calls 'help taylor' or 'taylor(x)' where 'x' is a numeric argument, Octave only reports that the function is not defined.

This bug is solely about adding a better error message to indicate that users should load the appropriate package.

Mike Miller <mtmiller>
Group Member
Mon 14 Dec 2015 07:58:24 PM UTC, comment #5: 

I agree this would be a good change in Octave, but to re-iterate what @jwe and others have said: this isn't a problem that can be fixed the symbolic package.  This is because the "@sym/taylor.m" code is only run when at least one input is symbolic type.


Colin Macdonald <cbm>
Thu 10 Dec 2015 10:50:48 PM UTC, comment #4: 

The thing that needs to happen is a change to Octave, not individual function files.

John W. Eaton <jwe>
Group administrator
Thu 10 Dec 2015 10:35:57 PM UTC, comment #3: 

ok. I didn't know if there was something specific that had to be done for it to set off a

'xyz' not defined for class 'foo'

type of error instead.

Nicholas Jankowski <nrjank>
Group Member
Thu 10 Dec 2015 10:28:49 PM UTC, comment #2: 

This is not the kind of change that needs or even should be made to individual functions.  It's a generic problem with the way the Octave looks up functions compared to the way that Matlab appears to do it now, even for built-in functions.

John W. Eaton <jwe>
Group administrator
Thu 10 Dec 2015 10:21:55 PM UTC, comment #1: 

minor comment, this is also one of those cases where the first error could be more helpful by giving a "hey, you need to load the package with 'taylor' in it"  message.

Nicholas Jankowski <nrjank>
Group Member
Thu 10 Dec 2015 09:05:12 PM UTC, original submission:  

when calling taylor from the symbolic package with an incorrect argument type, it produces an error message that makes it seem more like the function isn't loaded than that it just isn't being called correctly. Don't know if this also applies to other functions/packages in Octave / Octave Forge:


>> b = [1:10];
>> taylor(sin(b))
error: 'taylor' undefined near line 1 column 1
>> pkg load symbolic
>> a = sym('a');
OctSymPy v2.2.2: this is free software without warranty, see source.
Initializing communication with SymPy using a popen2() pipe.
Detected Windows: using "winwrapy.bat" to workaround Octave bug #43036
Some output from the Python subprocess (pid 14012) might appear next.

OctSymPy: Communication established.  SymPy v0.7.6.
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)]
>> taylor(sin(a))
ans = (sym)

    5    3
   a    a
  --- - -- + a
  120   6

>> taylor(sin(b))
error: 'taylor' undefined near line 1 column 1
>>


run in Octave 4.0.0 on Windows , symbolic package 2.2.2

Also, FYI calling taylor in Matlab with a non-symbolic argument provides the following feedback:

Undefined function 'taylor' for input arguments of type 'double'.

Seems like Octave should give a type error, too, here.

related to this help discussion thread:
http://octave.1599824.n4.nabble.com/Taylor-expansion-does-not-expand-well-tp4673968.html

Nicholas Jankowski <nrjank>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 jwe (Posted a comment)
  • -email is unavailable- added by nrjank (package maintainer)
  • -email is unavailable- added by nrjank (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 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-26 mtmiller CategoryOctave Package Interpreter
        Severity3 - Normal 1 - Wish
        Priority5 - Normal 1 - Later
        Item GroupOther Feature Request
        Release4.0.0 dev
        Operating SystemMicrosoft Windows Any
        Summary[octave forge] (symbolic) requesting better error message from taylor, possibly other functions? improve missing function hook to be able to report class methods by name in packages
    2017-08-13 jwe Summaryrequesting better error message from taylor in symbolic, possibly other functions? [octave forge] (symbolic) requesting better error message from taylor, possibly other functions?
    2015-12-10 nrjank Carbon-Copy- Added cbm

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code