bugGNU Octave - Bugs: bug #45643, symbolic pkg function_handle rhs...

 
 

bug #45643: symbolic pkg function_handle rhs problems

Submitter:  Doug Stewart <dastew>
Submitted:  Tue 28 Jul 2015 01:44:27 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Doug Stewart Open/Closed:  * Closed
Release:  * 4.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 04 Jan 2016 01:03:38 PM UTC, comment #3: 

Your work around did not work for me.
But I don't need it. As long as it is fixed in the source then that is ok for me.



syms y(x)
 f=y(x)==1
 #ff=function_handle(rhs(f))
 findsymbols(f)
 ff=function_handle(f, 'vars', findsymbols(f))

f = (sym) y(x) = 1
ans =
{
(sym) x
}
error: function_handle: python codegen failed: y(x) == 1
error: called from
    function_handle at line 175 column 11
    testrhs1 at line 5 column 4


Doug Stewart <dastew>
Mon 04 Jan 2016 08:44:50 AM UTC, comment #2: 

By the way, here is a workaround for the current version of Symbolic:


f = sym(2)
function_handle(f, 'vars', findsymbols(f))


Also, I've added tests, as per my TODO below.

Colin Macdonald <cbm>
Sun 03 Jan 2016 06:20:17 PM UTC, comment #1: 

maintainers: this can be closed

Thanks for the report, this is fixed when using a dev version of SymPy (0.7.7).

But I've worked around it for the next release of Symbolic pkg:
https://github.com/cbm755/octsympy/commit/bec7b3071a3ff1e6c7203b969793ab8afefec96d

A related bug remains: "findsym(sym([]))" (and I think for symvar and findsymbols).  TODO: I should add xtests.  Will be fixed with SymPy 0.7.7.

Colin Macdonald <cbm>
Tue 28 Jul 2015 01:44:27 PM UTC, original submission:  

When the rhs is a constant, as in this example,
then the function_handle code does not know what to do.


>> syms y(x)
>> f=y==1
f = (sym) y(x) = 1
>> ff=function_handle(rhs(f))
Traceback (most recent call last):
  File "<stdin>", line 18, in <module>
  File "<stdin>", line 13, in _fcn
  File "/usr/local/lib/python2.7/dist-packages/sympy/matrices/matrices.py", line 1145, in free_symbols
PYTHON: Error in cmd
Resetting the octsympy communication mechanism
Closing the Python pipe...
    return set.union(*[i.free_symbols for i in self])
TypeError: descriptor 'union' of 'set' object needs an argument

error: python_cmd: unexpected return
error: called from
    python_cmd at line 143 column 6
    findsymbols at line 77 column 7
    symvar at line 80 column 11
    findsym at line 45 column 5
    codegen>codegen_input_parser at line 207 column 14
    codegen at line 24 column 35
    function_handle at line 87 column 12
>>


Doug Stewart <dastew>

 

(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 mtmiller (Updated the item)
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by dastew (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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-01-04 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code