Just a note down of the upcoming changes to pytave - GSoC 2016

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Just a note down of the upcoming changes to pytave - GSoC 2016

Abhinav Tripathi

Hi,
Since most of our discussed updates are done (a major setback has been windows build), I would like to note down the upcoming changes into PyTave and Symbolic which will be carried out.
This mail is meant to be an update on what is planned to be carried out in the project and take suggestions on whether/how to implement those.
.
1- Provide an option to set execution namespace in pyexec to allow symbolic to run everything in its own namespace. Also it will provide an alternative for the hypothetical 'pystore' function that I proposed.
2- Drop the conversion of python objects to a bare minimum. (hence dictionaries, lists, tuples will remain as pyobjects)
3- Use (1) to implement calling of pyobjects with multiple arguments and probably extend the same logic to pycall.
Or maybe we can extend pycall so that a pyobject maybe passed instead of a function name. This will reduce duplicate code.
4- Edit all BIST tests in pytave and symbolic to adapt to these changes.
5- Solve a few more pytave bugs.
6- Try to reduce latency of Symbolic functions such as 'vpa'.
7- Fix the errors on travis which are causing build fail for symbolic.
8- work on merging pytave branch to master such that tests work on all IPCs (currently error messages differ on different IPCs and hence tests may fail on some IPC other than pytave)
.
I have been at my hometown for the past few weeks and due to lack of proper internet connection, the work done has been quite slow. From this Tuesday onwards I can work again with full freedom and I intend to complete the above mentioned tasks within 10 days (starting Wednesday).
.
Also, I will write the blog and wiki on windows build on Wednesday.
I have tried the windows build using DLLs from some other sites too (just out of curiosity) but didn't get any closer.
.
As there are only a few weeks left for GSoC, please mention any other important tasks that should be given priority. And please give comments/suggestions on the tasks (or their order) I proposed here.
I fully intend to work on PyTave and Symbolic after GSoC too but I would like to complete as much work possible before GSoC ends.
.
Just one more question (more of an octave question than pytave) -
If I write "s = 1" then s is considered to be double (not an integer!) in octave. Why is the default type double when there is no decimal point supplied?!
This caused some trouble for me. Because if I send it to pytave it will be converted to python float and hence I won't be able to use that variable as an index to a list.
I have to do "s = int8(1)"  or some other int type for this simple thing...
.
Regards,
Abhinav

Reply | Threaded
Open this post in threaded view
|

Re: Just a note down of the upcoming changes to pytave - GSoC 2016

Mike Miller-4
On Sat, Jul 23, 2016 at 20:09:37 +0530, Abhinav Tripathi wrote:

> Hi,
> Since most of our discussed updates are done (a major setback has been
> windows build), I would like to note down the upcoming changes into PyTave
> and Symbolic which will be carried out.
> This mail is meant to be an update on what is planned to be carried out in
> the project and take suggestions on whether/how to implement those.
> .
> 1- Provide an option to set execution namespace in pyexec to allow symbolic
> to run everything in its own namespace. Also it will provide an alternative
> for the hypothetical 'pystore' function that I proposed.

This is https://bitbucket.org/mtmiller/pytave/issues/25, right? Can you
or Colin explain this a bit more? I'm not sure I understand the concrete
changes to be made here and what the user interface will look like.

> 2- Drop the conversion of python objects to a bare minimum. (hence
> dictionaries, lists, tuples will remain as pyobjects)

Yes.

> 3- Use (1) to implement calling of pyobjects with multiple arguments and
> probably extend the same logic to pycall.
> Or maybe we can extend pycall so that a pyobject maybe passed instead of a
> function name. This will reduce duplicate code.

This is mostly done already.

> 4- Edit all BIST tests in pytave and symbolic to adapt to these changes.
> 5- Solve a few more pytave bugs.
> 6- Try to reduce latency of Symbolic functions such as 'vpa'.
> 7- Fix the errors on travis which are causing build fail for symbolic.
> 8- work on merging pytave branch to master such that tests work on all IPCs
> (currently error messages differ on different IPCs and hence tests may fail
> on some IPC other than pytave)

This all sounds good.

> I have been at my hometown for the past few weeks and due to lack of proper
> internet connection, the work done has been quite slow. From this Tuesday
> onwards I can work again with full freedom and I intend to complete the
> above mentioned tasks within 10 days (starting Wednesday).
> .
> Also, I will write the blog and wiki on windows build on Wednesday.
> I have tried the windows build using DLLs from some other sites too (just
> out of curiosity) but didn't get any closer.

Yes, please document the progress you made and the blockers here. If the
major blocker is boost, for example, then maybe working on making pytave
not depend on boost can be an important next task.

> As there are only a few weeks left for GSoC, please mention any other
> important tasks that should be given priority. And please give
> comments/suggestions on the tasks (or their order) I proposed here.
> I fully intend to work on PyTave and Symbolic after GSoC too but I would
> like to complete as much work possible before GSoC ends.

The bug I filed about seg faults with Python 3.5 is an important task
you can work on next. I'm trying to set the priority accordingly on the
issue tracker, so use that.

> Just one more question (more of an octave question than pytave) -
> If I write "s = 1" then s is considered to be double (not an integer!) in
> octave. Why is the default type double when there is no decimal point
> supplied?!

Because this is Matlab's behavior that we must adhere to. The default
numeric data type is a double. The mixed type conversion rules also
reflect this, for example in C a double added to an int produces a
double, but in Octave a double added to an int32 results in an int32.

> This caused some trouble for me. Because if I send it to pytave it will be
> converted to python float and hence I won't be able to use that variable as
> an index to a list.
> I have to do "s = int8(1)"  or some other int type for this simple thing...

Yes. Since the default type in Octave is a double, doubles may be used
as indices as long as they are integer-valued.

At the moment I think this has to be, but we might special case methods
like subsasgn, subsindex, and subsref for indexing if needed.

--
mike

Reply | Threaded
Open this post in threaded view
|

Re: Just a note down of the upcoming changes to pytave - GSoC 2016

tmacchant
<snip> .



>>  Also, I will write the blog and wiki on windows build on Wednesday.
>>  I have tried the windows build using DLLs from some other sites too (just
>>  out of curiosity) but didn't get any closer.
>
> Yes, please document the progress you made and the blockers here. If the
> major blocker is boost, for example, then maybe working on making pytave
> not depend on boost can be an important next task.

From my straggle with build Pytave on windows, boost seems not to be a blocker.
The blocker is a __imp_ symbol issue at linking which will often occur on windows build.

<snip>

> --
> mike


Tasturo

Reply | Threaded
Open this post in threaded view
|

Re: Just a note down of the upcoming changes to pytave - GSoC 2016

Abhinav Tripathi
In reply to this post by Mike Miller-4


On Jul 24, 2016 12:55 AM, "Mike Miller" <[hidden email]> wrote:
>
> This is https://bitbucket.org/mtmiller/pytave/issues/25, right? Can you
> or Colin explain this a bit more? I'm not sure I understand the concrete
> changes to be made here and what the user interface will look like.
>

Yes, it's the same issue. Currently we run every code in 'main_namespace'. So all the imports and variables are defined in that namespace. When using symbolic, all the sympy functions are imported there. It can cause some problems (as Colin explained on the issue). Even "pyexec ('N=1')" will cause the sympy function 'N' to be overwritten.
.
So if we add an optional second argument to pyexec then we can pass that as the local namespace. Hence symbolic can run in its own namespace.

> > 3- Use (1) to implement calling of pyobjects with multiple arguments and
> > probably extend the same logic to pycall.
> > Or maybe we can extend pycall so that a pyobject maybe passed instead of a
> > function name. This will reduce duplicate code.
>
> This is mostly done already.
>

Currently a PyObject can be callled without arguments. We need to add calling a PyObject with arguments.

> The bug I filed about seg faults with Python 3.5 is an important task
> you can work on next. I'm trying to set the priority accordingly on the
> issue tracker, so use that.
>

Sure.

> > Just one more question (more of an octave question than pytave) -
> > If I write "s = 1" then s is considered to be double (not an integer!) in
> > octave. Why is the default type double when there is no decimal point
> > supplied?!
>
> Because this is Matlab's behavior that we must adhere to. The default
> numeric data type is a double. The mixed type conversion rules also
> reflect this, for example in C a double added to an int produces a
> double, but in Octave a double added to an int32 results in an int32.
>
> > This caused some trouble for me. Because if I send it to pytave it will be
> > converted to python float and hence I won't be able to use that variable as
> > an index to a list.
> > I have to do "s = int8(1)"  or some other int type for this simple thing...
>
> Yes. Since the default type in Octave is a double, doubles may be used
> as indices as long as they are integer-valued.
>
> At the moment I think this has to be, but we might special case methods
> like subsasgn, subsindex, and subsref for indexing if needed.
>
> --
> mike

Tatsuro wrote:
> From my straggle with build Pytave on windows, boost seems not to be a blocker.
> The blocker is a __imp_ symbol issue at linking which will often occur on windows build.
>

Definitely. But there should be some solution, right?
I could not find anything solid which would help us get rid of this problem. I will try to start the windows build again from scratch and then probably we can discuss the exact problems.
.

Abhinav

Reply | Threaded
Open this post in threaded view
|

Re: Just a note down of the upcoming changes to pytave - GSoC 2016

Colin Macdonald-2
On 23/07/16 20:45, Abhinav Tripathi wrote:
> Currently a PyObject can be callled without arguments. We need to add
> calling a PyObject with arguments.

Its in progress here:
https://bitbucket.org/mtmiller/pytave/pull-requests/18

Also, a "+1" for Mike's comment about looking at the priority for
issues.  As well as the importance of good docs for the Windows built.

Colin


Reply | Threaded
Open this post in threaded view
|

Re: Just a note down of the upcoming changes to pytave - GSoC 2016

Abhinav Tripathi


On Jul 24, 2016 9:29 AM, "Colin Macdonald" <[hidden email]> wrote:
>
> On 23/07/16 20:45, Abhinav Tripathi wrote:
>>
>> Currently a PyObject can be callled without arguments. We need to add
>> calling a PyObject with arguments.
>
>
> Its in progress here:
> https://bitbucket.org/mtmiller/pytave/pull-requests/18
>

Oh. Sorry didn't check.
Seems great. :)

> Also, a "+1" for Mike's comment about looking at the priority for issues.  As well as the importance of good docs for the Windows built.
>

Definitely. Will do it on/before Wednesday.

> Colin
>
>

Abhinav