From glenn.caltech at gmail.com  Thu Mar  2 15:58:03 2017
From: glenn.caltech at gmail.com (G Jones)
Date: Thu, 2 Mar 2017 15:58:03 -0500
Subject: [IPython-dev] add tab completion for arguments dynamically
Message-ID: <CAGK_ABcT=HV9VtJQfP0CimJnwrVsmmr_0_mDnz=YZ1SNsoZpgA@mail.gmail.com>

Hi,
Is it possible to customize the completion list when typing keyword
arguments?
For example suppose I have a function like:
def myfunc(**kwargs):
    val = kwargs['val']

is there a way to tell ipython that when it sees me type:
myfunc(va<tab>

it suggests "val="?

Thanks,
Glenn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170302/24431e81/attachment.html>

From bussonniermatthias at gmail.com  Thu Mar  2 16:25:33 2017
From: bussonniermatthias at gmail.com (Matthias Bussonnier)
Date: Thu, 2 Mar 2017 13:25:33 -0800
Subject: [IPython-dev] add tab completion for arguments dynamically
In-Reply-To: <CAGK_ABcT=HV9VtJQfP0CimJnwrVsmmr_0_mDnz=YZ1SNsoZpgA@mail.gmail.com>
References: <CAGK_ABcT=HV9VtJQfP0CimJnwrVsmmr_0_mDnz=YZ1SNsoZpgA@mail.gmail.com>
Message-ID: <CANJQusUbWbMntsnHNLzMof5Ck1RGBn90UwNKN92qAtdP1LyLKg@mail.gmail.com>

Hi Glenn,

You can set the `__signature__` of your object. likely possible with a
decorator.
Here is a short example of how you could do it in a REPL.


In [21]: from inspect import Signature, Parameter

In [22]: def foo(*kwargs):
    ...:     pass

In [23]: foo?
Signature: foo(*kwargs)
Docstring: <no docstring>
File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
Type:      function

In [24]: foo.__signature__ = Signature(parameters={Parameter('a',
Parameter.POSITIONAL_OR_KEYWORD):None})

In [25]: foo?
Signature: foo(a)
Docstring: <no docstring>
File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
Type:      function


That should  not only work with IPython, but with anything that use
the Python inspect library.

Note that what I do above is imperfect as you should use an
OrderedDict instead of a dict for `parameters=...`

Does that helps ?

-- 
M


On Thu, Mar 2, 2017 at 12:58 PM, G Jones <glenn.caltech at gmail.com> wrote:
> Hi,
> Is it possible to customize the completion list when typing keyword
> arguments?
> For example suppose I have a function like:
> def myfunc(**kwargs):
>     val = kwargs['val']
>
> is there a way to tell ipython that when it sees me type:
> myfunc(va<tab>
>
> it suggests "val="?
>
> Thanks,
> Glenn
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>


From glenn.caltech at gmail.com  Thu Mar  2 22:20:01 2017
From: glenn.caltech at gmail.com (G Jones)
Date: Thu, 2 Mar 2017 22:20:01 -0500
Subject: [IPython-dev] add tab completion for arguments dynamically
In-Reply-To: <CANJQusUbWbMntsnHNLzMof5Ck1RGBn90UwNKN92qAtdP1LyLKg@mail.gmail.com>
References: <CAGK_ABcT=HV9VtJQfP0CimJnwrVsmmr_0_mDnz=YZ1SNsoZpgA@mail.gmail.com>
 <CANJQusUbWbMntsnHNLzMof5Ck1RGBn90UwNKN92qAtdP1LyLKg@mail.gmail.com>
Message-ID: <CAGK_ABdVVx55KgoKBwXM_Xw0cKmpgEpQavao7NwQNSZhMDg-RQ@mail.gmail.com>

Hi Matthias,
This seems to be exactly what I'm looking for, and it works fine when I
attach a __signature__ attribute to a simple function. I had to install
funcsigs because the project I'm working on is stuck with py2.7.
However, I am having trouble making it work for a callable class:

In [53]: class callme(object):
    ...:     def __call__(self,**kwargs):
    ...:         return kwargs
    ...:     __signature__ =
funcsigs.Signature(parameters=[funcsigs.Parameter('long_arg',funcsigs.Parameter.POSITIONAL_OR_KEYWORD)])

In [54]: c = callme()

In [55]: c?
Type:           callme
String form:    <__main__.callme object at 0x7f63e7124350>
Signature:      c(long_arg)
Docstring:      <no docstring>
Call signature: c(**kwargs)

So far so good, the signature is seen as expected. However, when I try to
tab complete with "c(long<tab>", long_arg is not in the list of suggestions.

Is there a way to accomplish this for a callable class?

Thanks,
Glenn

On Thu, Mar 2, 2017 at 4:25 PM, Matthias Bussonnier <
bussonniermatthias at gmail.com> wrote:

> Hi Glenn,
>
> You can set the `__signature__` of your object. likely possible with a
> decorator.
> Here is a short example of how you could do it in a REPL.
>
>
> In [21]: from inspect import Signature, Parameter
>
> In [22]: def foo(*kwargs):
>     ...:     pass
>
> In [23]: foo?
> Signature: foo(*kwargs)
> Docstring: <no docstring>
> File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
> Type:      function
>
> In [24]: foo.__signature__ = Signature(parameters={Parameter('a',
> Parameter.POSITIONAL_OR_KEYWORD):None})
>
> In [25]: foo?
> Signature: foo(a)
> Docstring: <no docstring>
> File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
> Type:      function
>
>
> That should  not only work with IPython, but with anything that use
> the Python inspect library.
>
> Note that what I do above is imperfect as you should use an
> OrderedDict instead of a dict for `parameters=...`
>
> Does that helps ?
>
> --
> M
>
>
> On Thu, Mar 2, 2017 at 12:58 PM, G Jones <glenn.caltech at gmail.com> wrote:
> > Hi,
> > Is it possible to customize the completion list when typing keyword
> > arguments?
> > For example suppose I have a function like:
> > def myfunc(**kwargs):
> >     val = kwargs['val']
> >
> > is there a way to tell ipython that when it sees me type:
> > myfunc(va<tab>
> >
> > it suggests "val="?
> >
> > Thanks,
> > Glenn
> >
> >
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > https://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170302/945323dd/attachment.html>

From bussonniermatthias at gmail.com  Thu Mar  2 22:50:44 2017
From: bussonniermatthias at gmail.com (Matthias Bussonnier)
Date: Thu, 2 Mar 2017 19:50:44 -0800
Subject: [IPython-dev] add tab completion for arguments dynamically
In-Reply-To: <CAGK_ABdVVx55KgoKBwXM_Xw0cKmpgEpQavao7NwQNSZhMDg-RQ@mail.gmail.com>
References: <CAGK_ABcT=HV9VtJQfP0CimJnwrVsmmr_0_mDnz=YZ1SNsoZpgA@mail.gmail.com>
 <CANJQusUbWbMntsnHNLzMof5Ck1RGBn90UwNKN92qAtdP1LyLKg@mail.gmail.com>
 <CAGK_ABdVVx55KgoKBwXM_Xw0cKmpgEpQavao7NwQNSZhMDg-RQ@mail.gmail.com>
Message-ID: <CANJQusVmo1qqyZ+a3J5_Z=+oiRDos=ytuQY5SXNeUfoPCKJqxw@mail.gmail.com>

Hi Glenn,

Almost there, you need to set signature on __call__ not on the class.

In [3]: import inspect
   ...: class callme(object):
   ...:     def __call__(self,**kwargs):
   ...:         return kwargs
   ...:
   ...:
   ...: callme.__call__.__signature__ = inspect.Signature(parameters={
   ...:     inspect.Parameter('self',inspect.Parameter.POSITIONAL_OR_KEYWORD):1,
   ...:     inspect.Parameter('long_arg',inspect.Parameter.POSITIONAL_OR_KEYWORD):2
   ...:                                                            })
   ...:

In [4]: c = callme()

In [5]: c?
Signature:   c(long_arg)
Type:        callme
String form: <__main__.callme object at 0x11020fb00>
Docstring:   <no docstring>

This seem to work for me on tab completion.
-- 
M

On Thu, Mar 2, 2017 at 7:20 PM, G Jones <glenn.caltech at gmail.com> wrote:
> Hi Matthias,
> This seems to be exactly what I'm looking for, and it works fine when I
> attach a __signature__ attribute to a simple function. I had to install
> funcsigs because the project I'm working on is stuck with py2.7.
> However, I am having trouble making it work for a callable class:
>
> In [53]: class callme(object):
>     ...:     def __call__(self,**kwargs):
>     ...:         return kwargs
>     ...:     __signature__ =
> funcsigs.Signature(parameters=[funcsigs.Parameter('long_arg',funcsigs.Parameter.POSITIONAL_OR_KEYWORD)])
>
> In [54]: c = callme()
>
> In [55]: c?
> Type:           callme
> String form:    <__main__.callme object at 0x7f63e7124350>
> Signature:      c(long_arg)
> Docstring:      <no docstring>
> Call signature: c(**kwargs)
>
> So far so good, the signature is seen as expected. However, when I try to
> tab complete with "c(long<tab>", long_arg is not in the list of suggestions.
>
> Is there a way to accomplish this for a callable class?
>
> Thanks,
> Glenn
>
> On Thu, Mar 2, 2017 at 4:25 PM, Matthias Bussonnier
> <bussonniermatthias at gmail.com> wrote:
>>
>> Hi Glenn,
>>
>> You can set the `__signature__` of your object. likely possible with a
>> decorator.
>> Here is a short example of how you could do it in a REPL.
>>
>>
>> In [21]: from inspect import Signature, Parameter
>>
>> In [22]: def foo(*kwargs):
>>     ...:     pass
>>
>> In [23]: foo?
>> Signature: foo(*kwargs)
>> Docstring: <no docstring>
>> File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
>> Type:      function
>>
>> In [24]: foo.__signature__ = Signature(parameters={Parameter('a',
>> Parameter.POSITIONAL_OR_KEYWORD):None})
>>
>> In [25]: foo?
>> Signature: foo(a)
>> Docstring: <no docstring>
>> File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
>> Type:      function
>>
>>
>> That should  not only work with IPython, but with anything that use
>> the Python inspect library.
>>
>> Note that what I do above is imperfect as you should use an
>> OrderedDict instead of a dict for `parameters=...`
>>
>> Does that helps ?
>>
>> --
>> M
>>
>>
>> On Thu, Mar 2, 2017 at 12:58 PM, G Jones <glenn.caltech at gmail.com> wrote:
>> > Hi,
>> > Is it possible to customize the completion list when typing keyword
>> > arguments?
>> > For example suppose I have a function like:
>> > def myfunc(**kwargs):
>> >     val = kwargs['val']
>> >
>> > is there a way to tell ipython that when it sees me type:
>> > myfunc(va<tab>
>> >
>> > it suggests "val="?
>> >
>> > Thanks,
>> > Glenn
>> >
>> >
>> >
>> > _______________________________________________
>> > IPython-dev mailing list
>> > IPython-dev at scipy.org
>> > https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>


From glenn.caltech at gmail.com  Thu Mar  2 23:04:08 2017
From: glenn.caltech at gmail.com (G Jones)
Date: Thu, 2 Mar 2017 23:04:08 -0500
Subject: [IPython-dev] add tab completion for arguments dynamically
In-Reply-To: <CANJQusVmo1qqyZ+a3J5_Z=+oiRDos=ytuQY5SXNeUfoPCKJqxw@mail.gmail.com>
References: <CAGK_ABcT=HV9VtJQfP0CimJnwrVsmmr_0_mDnz=YZ1SNsoZpgA@mail.gmail.com>
 <CANJQusUbWbMntsnHNLzMof5Ck1RGBn90UwNKN92qAtdP1LyLKg@mail.gmail.com>
 <CAGK_ABdVVx55KgoKBwXM_Xw0cKmpgEpQavao7NwQNSZhMDg-RQ@mail.gmail.com>
 <CANJQusVmo1qqyZ+a3J5_Z=+oiRDos=ytuQY5SXNeUfoPCKJqxw@mail.gmail.com>
Message-ID: <CAGK_ABfZ+qAfh0e=2otrg5BVX-psfFoO+cw90BJfPE_xLeeoyw@mail.gmail.com>

Hi,
Unfortunately in py2.7 it looks like I can't assign to
callme.__call__.__signature__

AttributeError: 'instancemethod' object has no attribute '__signature__'

I was surprised that providing __signature__ for the class doesn't work,
since what little documentation I could find for doing this (i.e. PEP362
and the python 3 inspect.signature documentation) all refers to "a callable
object" and PEP362 lists "If the [callable] object has a __signature__
attribute and if it is not None - return it".

Anyway, it looks like I may need to use another trick for python2. I
appreciate any ideas.

Thank you again,
Glenn

On Thu, Mar 2, 2017 at 10:50 PM, Matthias Bussonnier <
bussonniermatthias at gmail.com> wrote:

> Hi Glenn,
>
> Almost there, you need to set signature on __call__ not on the class.
>
> In [3]: import inspect
>    ...: class callme(object):
>    ...:     def __call__(self,**kwargs):
>    ...:         return kwargs
>    ...:
>    ...:
>    ...: callme.__call__.__signature__ = inspect.Signature(parameters={
>    ...:     inspect.Parameter('self',inspect.Parameter.POSITIONAL_
> OR_KEYWORD):1,
>    ...:     inspect.Parameter('long_arg',inspect.Parameter.POSITIONAL_
> OR_KEYWORD):2
>    ...:                                                            })
>    ...:
>
> In [4]: c = callme()
>
> In [5]: c?
> Signature:   c(long_arg)
> Type:        callme
> String form: <__main__.callme object at 0x11020fb00>
> Docstring:   <no docstring>
>
> This seem to work for me on tab completion.
> --
> M
>
> On Thu, Mar 2, 2017 at 7:20 PM, G Jones <glenn.caltech at gmail.com> wrote:
> > Hi Matthias,
> > This seems to be exactly what I'm looking for, and it works fine when I
> > attach a __signature__ attribute to a simple function. I had to install
> > funcsigs because the project I'm working on is stuck with py2.7.
> > However, I am having trouble making it work for a callable class:
> >
> > In [53]: class callme(object):
> >     ...:     def __call__(self,**kwargs):
> >     ...:         return kwargs
> >     ...:     __signature__ =
> > funcsigs.Signature(parameters=[funcsigs.Parameter('long_arg'
> ,funcsigs.Parameter.POSITIONAL_OR_KEYWORD)])
> >
> > In [54]: c = callme()
> >
> > In [55]: c?
> > Type:           callme
> > String form:    <__main__.callme object at 0x7f63e7124350>
> > Signature:      c(long_arg)
> > Docstring:      <no docstring>
> > Call signature: c(**kwargs)
> >
> > So far so good, the signature is seen as expected. However, when I try to
> > tab complete with "c(long<tab>", long_arg is not in the list of
> suggestions.
> >
> > Is there a way to accomplish this for a callable class?
> >
> > Thanks,
> > Glenn
> >
> > On Thu, Mar 2, 2017 at 4:25 PM, Matthias Bussonnier
> > <bussonniermatthias at gmail.com> wrote:
> >>
> >> Hi Glenn,
> >>
> >> You can set the `__signature__` of your object. likely possible with a
> >> decorator.
> >> Here is a short example of how you could do it in a REPL.
> >>
> >>
> >> In [21]: from inspect import Signature, Parameter
> >>
> >> In [22]: def foo(*kwargs):
> >>     ...:     pass
> >>
> >> In [23]: foo?
> >> Signature: foo(*kwargs)
> >> Docstring: <no docstring>
> >> File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
> >> Type:      function
> >>
> >> In [24]: foo.__signature__ = Signature(parameters={Parameter('a',
> >> Parameter.POSITIONAL_OR_KEYWORD):None})
> >>
> >> In [25]: foo?
> >> Signature: foo(a)
> >> Docstring: <no docstring>
> >> File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
> >> Type:      function
> >>
> >>
> >> That should  not only work with IPython, but with anything that use
> >> the Python inspect library.
> >>
> >> Note that what I do above is imperfect as you should use an
> >> OrderedDict instead of a dict for `parameters=...`
> >>
> >> Does that helps ?
> >>
> >> --
> >> M
> >>
> >>
> >> On Thu, Mar 2, 2017 at 12:58 PM, G Jones <glenn.caltech at gmail.com>
> wrote:
> >> > Hi,
> >> > Is it possible to customize the completion list when typing keyword
> >> > arguments?
> >> > For example suppose I have a function like:
> >> > def myfunc(**kwargs):
> >> >     val = kwargs['val']
> >> >
> >> > is there a way to tell ipython that when it sees me type:
> >> > myfunc(va<tab>
> >> >
> >> > it suggests "val="?
> >> >
> >> > Thanks,
> >> > Glenn
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > IPython-dev mailing list
> >> > IPython-dev at scipy.org
> >> > https://mail.scipy.org/mailman/listinfo/ipython-dev
> >> >
> >> _______________________________________________
> >> IPython-dev mailing list
> >> IPython-dev at scipy.org
> >> https://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> >
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > https://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170302/92f946bc/attachment.html>

From bussonniermatthias at gmail.com  Thu Mar  2 23:06:42 2017
From: bussonniermatthias at gmail.com (Matthias Bussonnier)
Date: Thu, 2 Mar 2017 20:06:42 -0800
Subject: [IPython-dev] add tab completion for arguments dynamically
In-Reply-To: <CAGK_ABfZ+qAfh0e=2otrg5BVX-psfFoO+cw90BJfPE_xLeeoyw@mail.gmail.com>
References: <CAGK_ABcT=HV9VtJQfP0CimJnwrVsmmr_0_mDnz=YZ1SNsoZpgA@mail.gmail.com>
 <CANJQusUbWbMntsnHNLzMof5Ck1RGBn90UwNKN92qAtdP1LyLKg@mail.gmail.com>
 <CAGK_ABdVVx55KgoKBwXM_Xw0cKmpgEpQavao7NwQNSZhMDg-RQ@mail.gmail.com>
 <CANJQusVmo1qqyZ+a3J5_Z=+oiRDos=ytuQY5SXNeUfoPCKJqxw@mail.gmail.com>
 <CAGK_ABfZ+qAfh0e=2otrg5BVX-psfFoO+cw90BJfPE_xLeeoyw@mail.gmail.com>
Message-ID: <CANJQusXpQ3d61KybqDpMZGXDaNNmd33NXbSN8f0-dvHd5vaWGg@mail.gmail.com>

Hum, sorry about that. I'm unsure how to do it in Python 2 then.

Let us know if you figured it out.
-- 
<

On Thu, Mar 2, 2017 at 8:04 PM, G Jones <glenn.caltech at gmail.com> wrote:
> Hi,
> Unfortunately in py2.7 it looks like I can't assign to
> callme.__call__.__signature__
>
> AttributeError: 'instancemethod' object has no attribute '__signature__'
>
> I was surprised that providing __signature__ for the class doesn't work,
> since what little documentation I could find for doing this (i.e. PEP362 and
> the python 3 inspect.signature documentation) all refers to "a callable
> object" and PEP362 lists "If the [callable] object has a __signature__
> attribute and if it is not None - return it".
>
> Anyway, it looks like I may need to use another trick for python2. I
> appreciate any ideas.
>
> Thank you again,
> Glenn
>
> On Thu, Mar 2, 2017 at 10:50 PM, Matthias Bussonnier
> <bussonniermatthias at gmail.com> wrote:
>>
>> Hi Glenn,
>>
>> Almost there, you need to set signature on __call__ not on the class.
>>
>> In [3]: import inspect
>>    ...: class callme(object):
>>    ...:     def __call__(self,**kwargs):
>>    ...:         return kwargs
>>    ...:
>>    ...:
>>    ...: callme.__call__.__signature__ = inspect.Signature(parameters={
>>    ...:
>> inspect.Parameter('self',inspect.Parameter.POSITIONAL_OR_KEYWORD):1,
>>    ...:
>> inspect.Parameter('long_arg',inspect.Parameter.POSITIONAL_OR_KEYWORD):2
>>    ...:                                                            })
>>    ...:
>>
>> In [4]: c = callme()
>>
>> In [5]: c?
>> Signature:   c(long_arg)
>> Type:        callme
>> String form: <__main__.callme object at 0x11020fb00>
>> Docstring:   <no docstring>
>>
>> This seem to work for me on tab completion.
>> --
>> M
>>
>> On Thu, Mar 2, 2017 at 7:20 PM, G Jones <glenn.caltech at gmail.com> wrote:
>> > Hi Matthias,
>> > This seems to be exactly what I'm looking for, and it works fine when I
>> > attach a __signature__ attribute to a simple function. I had to install
>> > funcsigs because the project I'm working on is stuck with py2.7.
>> > However, I am having trouble making it work for a callable class:
>> >
>> > In [53]: class callme(object):
>> >     ...:     def __call__(self,**kwargs):
>> >     ...:         return kwargs
>> >     ...:     __signature__ =
>> >
>> > funcsigs.Signature(parameters=[funcsigs.Parameter('long_arg',funcsigs.Parameter.POSITIONAL_OR_KEYWORD)])
>> >
>> > In [54]: c = callme()
>> >
>> > In [55]: c?
>> > Type:           callme
>> > String form:    <__main__.callme object at 0x7f63e7124350>
>> > Signature:      c(long_arg)
>> > Docstring:      <no docstring>
>> > Call signature: c(**kwargs)
>> >
>> > So far so good, the signature is seen as expected. However, when I try
>> > to
>> > tab complete with "c(long<tab>", long_arg is not in the list of
>> > suggestions.
>> >
>> > Is there a way to accomplish this for a callable class?
>> >
>> > Thanks,
>> > Glenn
>> >
>> > On Thu, Mar 2, 2017 at 4:25 PM, Matthias Bussonnier
>> > <bussonniermatthias at gmail.com> wrote:
>> >>
>> >> Hi Glenn,
>> >>
>> >> You can set the `__signature__` of your object. likely possible with a
>> >> decorator.
>> >> Here is a short example of how you could do it in a REPL.
>> >>
>> >>
>> >> In [21]: from inspect import Signature, Parameter
>> >>
>> >> In [22]: def foo(*kwargs):
>> >>     ...:     pass
>> >>
>> >> In [23]: foo?
>> >> Signature: foo(*kwargs)
>> >> Docstring: <no docstring>
>> >> File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
>> >> Type:      function
>> >>
>> >> In [24]: foo.__signature__ = Signature(parameters={Parameter('a',
>> >> Parameter.POSITIONAL_OR_KEYWORD):None})
>> >>
>> >> In [25]: foo?
>> >> Signature: foo(a)
>> >> Docstring: <no docstring>
>> >> File:      ~/dev/docathon/<ipython-input-22-086da1400d07>
>> >> Type:      function
>> >>
>> >>
>> >> That should  not only work with IPython, but with anything that use
>> >> the Python inspect library.
>> >>
>> >> Note that what I do above is imperfect as you should use an
>> >> OrderedDict instead of a dict for `parameters=...`
>> >>
>> >> Does that helps ?
>> >>
>> >> --
>> >> M
>> >>
>> >>
>> >> On Thu, Mar 2, 2017 at 12:58 PM, G Jones <glenn.caltech at gmail.com>
>> >> wrote:
>> >> > Hi,
>> >> > Is it possible to customize the completion list when typing keyword
>> >> > arguments?
>> >> > For example suppose I have a function like:
>> >> > def myfunc(**kwargs):
>> >> >     val = kwargs['val']
>> >> >
>> >> > is there a way to tell ipython that when it sees me type:
>> >> > myfunc(va<tab>
>> >> >
>> >> > it suggests "val="?
>> >> >
>> >> > Thanks,
>> >> > Glenn
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > IPython-dev mailing list
>> >> > IPython-dev at scipy.org
>> >> > https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >> >
>> >> _______________________________________________
>> >> IPython-dev mailing list
>> >> IPython-dev at scipy.org
>> >> https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >
>> >
>> >
>> > _______________________________________________
>> > IPython-dev mailing list
>> > IPython-dev at scipy.org
>> > https://mail.scipy.org/mailman/listinfo/ipython-dev
>> >
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>


From fperez.net at gmail.com  Sat Mar  4 00:16:39 2017
From: fperez.net at gmail.com (Fernando Perez)
Date: Fri, 3 Mar 2017 21:16:39 -0800
Subject: [IPython-dev] Problem with I-Search when Using IPython in
 VSCode's Integrated Terminal
In-Reply-To: <CAP-uhDeiW+U=JwFEk1s614GHfdWKh=C2sePUzYwZs4tZp6wGGw@mail.gmail.com>
References: <CAP-uhDeeTdx53-UgWASfkVhiwERfJAWHnH34+yhmTjnchnTpPQ@mail.gmail.com>
 <CAOvn4qjSv9yQ5XXpLZ3=3os6sSm7JgbH75brBUaRzBu5a3aX-Q@mail.gmail.com>
 <CAP-uhDeiW+U=JwFEk1s614GHfdWKh=C2sePUzYwZs4tZp6wGGw@mail.gmail.com>
Message-ID: <CAHAreOqcEtarYVYBUN7OLtSuC9kF52uF6iFzJYhqCsiaS1ARFg@mail.gmail.com>

On Sat, Feb 4, 2017 at 10:31 AM, Carl Smith <carl.input at gmail.com> wrote:

> Thanks Thomas. I'll see if I can figure it out first. Just thought it was
> worth asking here, as I was at a loss, and it's one of those things that
> are hard to search for on Google.


FWIW, Carl, I use VSCode regularly and just tested, and at least with
current VSC (1.10) and master IPython, I can't seem to reproduce the
problem you mention.  Do let us know if it recurs, I think there's a few of
us who have switched to VSCode and may be able to help.

Cheers,

f


-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170303/362d5cef/attachment.html>

From carl.input at gmail.com  Sat Mar  4 10:29:31 2017
From: carl.input at gmail.com (Carl Smith)
Date: Sat, 4 Mar 2017 15:29:31 +0000
Subject: [IPython-dev] Problem with I-Search when Using IPython in
 VSCode's Integrated Terminal
In-Reply-To: <CAHAreOqcEtarYVYBUN7OLtSuC9kF52uF6iFzJYhqCsiaS1ARFg@mail.gmail.com>
References: <CAP-uhDeeTdx53-UgWASfkVhiwERfJAWHnH34+yhmTjnchnTpPQ@mail.gmail.com>
 <CAOvn4qjSv9yQ5XXpLZ3=3os6sSm7JgbH75brBUaRzBu5a3aX-Q@mail.gmail.com>
 <CAP-uhDeiW+U=JwFEk1s614GHfdWKh=C2sePUzYwZs4tZp6wGGw@mail.gmail.com>
 <CAHAreOqcEtarYVYBUN7OLtSuC9kF52uF6iFzJYhqCsiaS1ARFg@mail.gmail.com>
Message-ID: <CAP-uhDf8-U5H6sPtCautA4O4JSxkqO-whFKaHTM+bpBRnFwAaA@mail.gmail.com>

> FWIW, Carl, I use VSCode regularly and just tested, and at least with
> current VSC (1.10) and master IPython, I can't seem to reproduce the
> problem you mention.  Do let us know if it recurs, I think there's a few of
> us who have switched to VSCode and may be able to help.
>

?Thanks mate. Will do. To be honest, I pretty sure now that it's something
wrong with my local setup. I do have some keyboard hacks configured, so may
have just shot myself in the foot. Sorry for the noise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170304/b5e6d6ea/attachment.html>

From mhearne at usgs.gov  Wed Mar  8 11:48:32 2017
From: mhearne at usgs.gov (Hearne, Mike)
Date: Wed, 8 Mar 2017 08:48:32 -0800
Subject: [IPython-dev] Scipy 2017 Jupyter Tutorials
Message-ID: <CALf5BBsYPQ8Y9A8+oj_7sufCbJezmynj7HXkXUOODdKmC266_Q@mail.gmail.com>

Greetings to all Jupyter developers and devotees!  The 2017 Scipy
Tutorial Committee is looking for proposals for tutorials for this
summers SciPy Conference.  In particular, we were hoping that someone
from the Jupyter community would be interested in putting together a
tutorial(s) on Jupyter.  Primarily we think a tutorial focusing on an
introduction to Jupyter would be helpful, as well as (possibly) a
second tutorial for more experienced users, focusing on widgets or
other more advanced functionality.

One note:  In years past, we have gotten comments that a lot of
attendees at Scipy are not as interested in JavaScript-heavy
tutorials, so perhaps factor that into any planning.

The web page below has all of the information for tutorial submitters,
including guidance on what should be in the proposal, schedules, and
stipends (!)

http://scipy2017.scipy.org/ehome/220975/493424/

Information about SciPy:

SciPy 2017, the 16th annual Scientific Computing with Python
conference, will be held July 10-16, 2017 in Austin, Texas. The annual
SciPy Conference brings together over 700 participants from industry,
academia, and government to showcase their latest projects, learn from
skilled users and developers, and collaborate on code development. The
full program will consist of 2 days of tutorials (July 10-11), 3 days
of talks (July 12-14), and 2 days of developer sprints (July 15-16).

--The SciPy 2017 Tutorials Committee


From mattwcraig at gmail.com  Wed Mar  8 12:20:37 2017
From: mattwcraig at gmail.com (Matt Craig)
Date: Wed, 8 Mar 2017 11:20:37 -0600
Subject: [IPython-dev] Scipy 2017 Jupyter Tutorials
In-Reply-To: <CALf5BBsYPQ8Y9A8+oj_7sufCbJezmynj7HXkXUOODdKmC266_Q@mail.gmail.com>
References: <CALf5BBsYPQ8Y9A8+oj_7sufCbJezmynj7HXkXUOODdKmC266_Q@mail.gmail.com>
Message-ID: <CAKxiDYkiH6x9GESWFWKiWvzpu4QTUHxnW8DsNqnWyQawHzKRpA@mail.gmail.com>

Hi,

Good news -- Sylvain Corley, Jason Grout and I are working on a
widget tutorial. If others are interested please let me know.

Matt Craig


On Wed, Mar 8, 2017 at 10:48 AM, Hearne, Mike <mhearne at usgs.gov> wrote:

> Greetings to all Jupyter developers and devotees!  The 2017 Scipy
> Tutorial Committee is looking for proposals for tutorials for this
> summers SciPy Conference.  In particular, we were hoping that someone
> from the Jupyter community would be interested in putting together a
> tutorial(s) on Jupyter.  Primarily we think a tutorial focusing on an
> introduction to Jupyter would be helpful, as well as (possibly) a
> second tutorial for more experienced users, focusing on widgets or
> other more advanced functionality.
>
> One note:  In years past, we have gotten comments that a lot of
> attendees at Scipy are not as interested in JavaScript-heavy
> tutorials, so perhaps factor that into any planning.
>
> The web page below has all of the information for tutorial submitters,
> including guidance on what should be in the proposal, schedules, and
> stipends (!)
>
> http://scipy2017.scipy.org/ehome/220975/493424/
>
> Information about SciPy:
>
> SciPy 2017, the 16th annual Scientific Computing with Python
> conference, will be held July 10-16, 2017 in Austin, Texas. The annual
> SciPy Conference brings together over 700 participants from industry,
> academia, and government to showcase their latest projects, learn from
> skilled users and developers, and collaborate on code development. The
> full program will consist of 2 days of tutorials (July 10-11), 3 days
> of talks (July 12-14), and 2 days of developer sprints (July 15-16).
>
> --The SciPy 2017 Tutorials Committee
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170308/9f216303/attachment.html>

From mattwcraig at gmail.com  Wed Mar  8 12:23:19 2017
From: mattwcraig at gmail.com (Matt Craig)
Date: Wed, 8 Mar 2017 11:23:19 -0600
Subject: [IPython-dev] Scipy 2017 Jupyter Tutorials
In-Reply-To: <CAKxiDYkiH6x9GESWFWKiWvzpu4QTUHxnW8DsNqnWyQawHzKRpA@mail.gmail.com>
References: <CALf5BBsYPQ8Y9A8+oj_7sufCbJezmynj7HXkXUOODdKmC266_Q@mail.gmail.com>
 <CAKxiDYkiH6x9GESWFWKiWvzpu4QTUHxnW8DsNqnWyQawHzKRpA@mail.gmail.com>
Message-ID: <CAKxiDY=9=w6QwozBOxw6ZmbD4JSBfzzvyE4Eoi_ABDYjDSXubg@mail.gmail.com>

Oops, misspelled one of the names...sorry about that, Sylvain Corlay.

Matt Craig


On Wed, Mar 8, 2017 at 11:20 AM, Matt Craig <mattwcraig at gmail.com> wrote:

> Hi,
>
> Good news -- Sylvain Corley, Jason Grout and I are working on a
> widget tutorial. If others are interested please let me know.
>
> Matt Craig
>
>
> On Wed, Mar 8, 2017 at 10:48 AM, Hearne, Mike <mhearne at usgs.gov> wrote:
>
>> Greetings to all Jupyter developers and devotees!  The 2017 Scipy
>> Tutorial Committee is looking for proposals for tutorials for this
>> summers SciPy Conference.  In particular, we were hoping that someone
>> from the Jupyter community would be interested in putting together a
>> tutorial(s) on Jupyter.  Primarily we think a tutorial focusing on an
>> introduction to Jupyter would be helpful, as well as (possibly) a
>> second tutorial for more experienced users, focusing on widgets or
>> other more advanced functionality.
>>
>> One note:  In years past, we have gotten comments that a lot of
>> attendees at Scipy are not as interested in JavaScript-heavy
>> tutorials, so perhaps factor that into any planning.
>>
>> The web page below has all of the information for tutorial submitters,
>> including guidance on what should be in the proposal, schedules, and
>> stipends (!)
>>
>> http://scipy2017.scipy.org/ehome/220975/493424/
>>
>> Information about SciPy:
>>
>> SciPy 2017, the 16th annual Scientific Computing with Python
>> conference, will be held July 10-16, 2017 in Austin, Texas. The annual
>> SciPy Conference brings together over 700 participants from industry,
>> academia, and government to showcase their latest projects, learn from
>> skilled users and developers, and collaborate on code development. The
>> full program will consist of 2 days of tutorials (July 10-11), 3 days
>> of talks (July 12-14), and 2 days of developer sprints (July 15-16).
>>
>> --The SciPy 2017 Tutorials Committee
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> https://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170308/3fb9c797/attachment.html>

From damianavila at gmail.com  Sun Mar 19 21:22:04 2017
From: damianavila at gmail.com (=?UTF-8?Q?Dami=C3=A1n_Avila?=)
Date: Sun, 19 Mar 2017 22:22:04 -0300
Subject: [IPython-dev] [ANN ] Jupyter tools: tex2ipy and ipyaml
In-Reply-To: <CAHAreOpyckrk_qwZZ-OVTp94PyGKT7xotgEd0SY4hKbz8G1P2g@mail.gmail.com>
References: <5c7c9601-620c-36f1-7a93-50b5bd9f6045@aero.iitb.ac.in>
 <CAH4pYpTwzaF0p4vW+Chz7QaGa65FA_X1g=BjWzPi=Hq9P2KYOQ@mail.gmail.com>
 <CAHAreOpyckrk_qwZZ-OVTp94PyGKT7xotgEd0SY4hKbz8G1P2g@mail.gmail.com>
Message-ID: <CAH+mRR0v0BEWcS1r==erScALjcy_ns6QZ8fTgesZeHQf0usm5g@mail.gmail.com>

> tex2ipy:  https://github.com/prabhuramachandran/tex2ipy
>This simple tool makes it relatively easy to convert a LaTeX beamer
presentation
to a Jupyter/IPython notebook using RISE[1].

Really interesting (some bias here ;-)
Thanks for sharing it!


2017-02-22 22:17 GMT-03:00 Fernando Perez <fperez.net at gmail.com>:

>
> On Tue, Feb 21, 2017 at 2:05 PM, Brian Granger <ellisonbg at gmail.com>
> wrote:
>
>> Very cool! Thanks for sharing!
>
>
> +1!
>
> Which reminds me of this:
>
> https://github.com/pypa/pypi-legacy/issues/210
>
> It would be really nice to have a "Jupyter" trove classifier for PyPI, so
> we could quickly find Jupyter-related packages... That would be useful on
> multiple fronts for us...
>
> Cheers
>
> f
> --
> Fernando Perez (@fperez_org; http://fperez.org)
> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> fernando.perez-at-berkeley: contact me here for any direct mail
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>


-- 
*Dami?n Avila*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170319/ac464621/attachment.html>

From knowsuchagency at gmail.com  Sun Mar 19 23:04:38 2017
From: knowsuchagency at gmail.com (Stephan Fitzpatrick)
Date: Sun, 19 Mar 2017 20:04:38 -0700
Subject: [IPython-dev] Integrating mypy with IPython using custom magic
Message-ID: <CAAz-ZnaKqXsLT-BZDAs9UeySgHLEuUaacYpvbK9En9J6PmcZ6g@mail.gmail.com>

For those interested, I wrote a cell magic to allow one to run a cell
through
mypy <http://mypy-lang.org/>.

The link to the gist is here
<https://gist.github.com/knowsuchagency/f7b2203dd613756a45f816d6809f01a6>.

Anyone interested in the article on how/why I wrote it with example code
can find it here
<http://journalpanic.com/post/spice-up-thy-jupyter-notebooks-with-mypy/>.

Cheers.

-- 
*Stephan Fitzpatrick*
*Software Developer*
Facebook <https://facebook.com/stephan.fitzpatrick>
LinkedIn <http://www.linkedin.com/in/fitzpatrickstephan>
Twitter <https://twitter.com/knowsuchagency>
Github <https://github.com/knowsuchagency>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170319/302068f8/attachment.html>

From didaci at diee.unica.it  Mon Mar 20 08:10:16 2017
From: didaci at diee.unica.it (Luca Didaci)
Date: Mon, 20 Mar 2017 13:10:16 +0100
Subject: [IPython-dev] pdf slides from a Jupyter/IPython notebook using RISE
Message-ID: <B19983D6-DCD7-4A01-B3D9-C73DEE756389@diee.unica.it>

Dear All,

there is a way to obtain pdf slides from a  Jupyter/IPython notebook using damianavila/RISE ?

Using nbconvert I CAN'T obtain pdf slides with a page for each page shown in RISE.

Thanks!
Luca



From takowl at gmail.com  Mon Mar 20 10:51:58 2017
From: takowl at gmail.com (Thomas Kluyver)
Date: Mon, 20 Mar 2017 14:51:58 +0000
Subject: [IPython-dev] Integrating mypy with IPython using custom magic
In-Reply-To: <CAAz-ZnaKqXsLT-BZDAs9UeySgHLEuUaacYpvbK9En9J6PmcZ6g@mail.gmail.com>
References: <CAAz-ZnaKqXsLT-BZDAs9UeySgHLEuUaacYpvbK9En9J6PmcZ6g@mail.gmail.com>
Message-ID: <CAOvn4qi8mLWmLUxjRxk8k+1nNGAGqPkSD5sXXcbTRTXFDJ2KnQ@mail.gmail.com>

Neat, thanks Stephan!

On 20 March 2017 at 03:04, Stephan Fitzpatrick <knowsuchagency at gmail.com>
wrote:

> For those interested, I wrote a cell magic to allow one to run a cell
> through
> mypy <http://mypy-lang.org/>.
>
> The link to the gist is here
> <https://gist.github.com/knowsuchagency/f7b2203dd613756a45f816d6809f01a6>.
>
> Anyone interested in the article on how/why I wrote it with example code
> can find it here
> <http://journalpanic.com/post/spice-up-thy-jupyter-notebooks-with-mypy/>.
>
> Cheers.
>
> --
> *Stephan Fitzpatrick*
> *Software Developer*
> Facebook <https://facebook.com/stephan.fitzpatrick>
> LinkedIn <http://www.linkedin.com/in/fitzpatrickstephan>
> Twitter <https://twitter.com/knowsuchagency>
> Github <https://github.com/knowsuchagency>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170320/a0d127be/attachment.html>

From davidgshi at yahoo.co.uk  Mon Mar 20 10:54:50 2017
From: davidgshi at yahoo.co.uk (David Shi)
Date: Mon, 20 Mar 2017 14:54:50 +0000 (UTC)
Subject: [IPython-dev] How to search out all Zip codes and replace with the
 first 2 digits, in a Pandas dataframe, with the use of regex?
References: <1986072713.6500604.1490021690461.ref@mail.yahoo.com>
Message-ID: <1986072713.6500604.1490021690461@mail.yahoo.com>

Hi, there,
Can anyone help?
How to search out all Zip codes and replace with the first 2 digits, in a Pandas dataframe, with the use of regex?

For instance, a ZIP code 33132 was found and replaced with 33.
Looking forward to hearing from you.
Regards.
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170320/c2f6a135/attachment.html>

From takowl at gmail.com  Mon Mar 20 11:07:15 2017
From: takowl at gmail.com (Thomas Kluyver)
Date: Mon, 20 Mar 2017 15:07:15 +0000
Subject: [IPython-dev] pdf slides from a Jupyter/IPython notebook using
	RISE
In-Reply-To: <B19983D6-DCD7-4A01-B3D9-C73DEE756389@diee.unica.it>
References: <B19983D6-DCD7-4A01-B3D9-C73DEE756389@diee.unica.it>
Message-ID: <CAOvn4qgWx11O7-gzgpxYeQhkEmjjzQVTPEVujwcc-JYaXzhTSQ@mail.gmail.com>

You can try going into slideshow mode and then using the browser's print
function. I think this has been a problem in the past, though, and I don't
know if it's any better now.

On 20 March 2017 at 12:10, Luca Didaci <didaci at diee.unica.it> wrote:

> Dear All,
>
> there is a way to obtain pdf slides from a  Jupyter/IPython notebook using
> damianavila/RISE ?
>
> Using nbconvert I CAN'T obtain pdf slides with a page for each page shown
> in RISE.
>
> Thanks!
> Luca
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170320/377ac992/attachment.html>

From fperez.net at gmail.com  Mon Mar 20 13:24:00 2017
From: fperez.net at gmail.com (Fernando Perez)
Date: Mon, 20 Mar 2017 10:24:00 -0700
Subject: [IPython-dev] pdf slides from a Jupyter/IPython notebook using
	RISE
In-Reply-To: <CAOvn4qgWx11O7-gzgpxYeQhkEmjjzQVTPEVujwcc-JYaXzhTSQ@mail.gmail.com>
References: <B19983D6-DCD7-4A01-B3D9-C73DEE756389@diee.unica.it>
 <CAOvn4qgWx11O7-gzgpxYeQhkEmjjzQVTPEVujwcc-JYaXzhTSQ@mail.gmail.com>
Message-ID: <CAHAreOqHBkgaEq24=wNAMs5BRf71+9ZGDLeuB864ohM-XXqMHA@mail.gmail.com>

On Mon, Mar 20, 2017 at 8:07 AM, Thomas Kluyver <takowl at gmail.com> wrote:

> You can try going into slideshow mode and then using the browser's print
> function. I think this has been a problem in the past, though, and I don't
> know if it's any better now.


Supposedly adding `?print-pdf` to the URL makes this possible, but I know I
and others have struggled with making it work reliably; e.g.
https://github.com/hakimel/reveal.js/issues/1252.  Some more (old)
background is here: https://github.com/ipython/ipython/issues/3993.  I
haven't tested recently, so I have no idea if it's any better. Would love
to hear if anyone has a reliable solution for this, coincidentally a
colleague was asking me about this very problem just a few days ago.

Cheers

f
-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170320/83f5a7c0/attachment.html>

From fperez.net at gmail.com  Mon Mar 20 13:45:55 2017
From: fperez.net at gmail.com (Fernando Perez)
Date: Mon, 20 Mar 2017 10:45:55 -0700
Subject: [IPython-dev] Integrating mypy with IPython using custom magic
In-Reply-To: <CAAz-ZnaKqXsLT-BZDAs9UeySgHLEuUaacYpvbK9En9J6PmcZ6g@mail.gmail.com>
References: <CAAz-ZnaKqXsLT-BZDAs9UeySgHLEuUaacYpvbK9En9J6PmcZ6g@mail.gmail.com>
Message-ID: <CAHAreOonA=qAmDV6_mBQjSBR2JYUYjmTJD33uJPEedyV7Cb-5A@mail.gmail.com>

On Sun, Mar 19, 2017 at 8:04 PM, Stephan Fitzpatrick <
knowsuchagency at gmail.com> wrote:

> For those interested, I wrote a cell magic to allow one to run a cell
> through
> mypy <http://mypy-lang.org/>.
>
> The link to the gist is here
> <https://gist.github.com/knowsuchagency/f7b2203dd613756a45f816d6809f01a6>.
>

Cool, thanks! This would make for a nice newsletter item!


> Anyone interested in the article on how/why I wrote it with example code
> can find it here
> <http://journalpanic.com/post/spice-up-thy-jupyter-notebooks-with-mypy/>.
>

Quick q: you mention you configured IPython to print not only the last
evaluated statement but more than that.  I admit I didn't realize we'd made
that configurable! (not too surprising, the project has grown so much
there's quite a bit of the codebase, even in the IPython kernel, I don't
recognize anymore).  Can you point me to how you did it? Would love to
learn :)

Cheers

f


-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170320/d94c2f62/attachment.html>

From fperez.net at gmail.com  Mon Mar 20 14:32:41 2017
From: fperez.net at gmail.com (Fernando Perez)
Date: Mon, 20 Mar 2017 11:32:41 -0700
Subject: [IPython-dev] [IPython-User] ipyparallel: Can't pickly
	memoryview objects
In-Reply-To: <oadkkr$jf4$1@blaine.gmane.org>
References: <oadkkr$jf4$1@blaine.gmane.org>
Message-ID: <CAHAreOrMgE0zBs9uwvHOf9Z6PmHXBYYdaX9Ysg_HfQ+MTqEd_g@mail.gmail.com>

Hi Florian,

sorry, this list is mostly deprecated, with all IPython discussions now
happening on a single list:

https://mail.scipy.org/mailman/listinfo/ipython-dev

The issue is the closure over xs in your lambda; pickle doesn't know how to
serialize closures.  You can make it work if you enable the cloudpickle
serializer instead:

    dview.use_cloudpickle()

as indicated here:
http://ipyparallel.readthedocs.io/en/latest/details.html#closures

An interesting tidbit is that if you move the code in `main` out to the
top-level of the script and manually push `xs` as well, the code works fine
even without the cloudpickle change.  That's because names that require a
lookup into globals() don't require the creation of a closure object, as
explained in the link above.

Cheers,

f


On Thu, Mar 16, 2017 at 2:07 AM, Florian Lindner <mailinglists at xgm.de>
wrote:

> Hello,
>
> I have this small sample program:
>
> import ipyparallel as ipp, numpy as np
>
> class X:
>     def __init__(self, x, xs):
>         self.A = np.full((10, 10), x)
>         np.fill_diagonal(self.A, x*10)
>
>     def norm(self):
>         return np.linalg.norm(self.A)
>
>
> def main():
>     rc = ipp.Client()
>     lview = rc.load_balanced_view()
>     dview = rc[:]
>     dview.push({"X" : X})
>     dview.execute("import numpy as np")
>
>     xs = np.linspace(1, 100, 10)
>     sqxs = []
>
>     sqxs = lview.map(lambda x: X(x, xs), xs)
>     sqxs.wait()
>
>     for i in sqxs:
>         print(i.norm())
>
> if __name__ == "__main__":
>     main()
>
>
> trying it to run gives TypeError: can't pickle memoryview objects.
> Probably because I provide the xs array to X.
>
> How can I work around this situation?
>
> Thanks,
> Florian
>
> Complete traceback:
>
> Traceback (most recent call last):
>   File "ipython_parallel.py", line 30, in <module>
>     main()
>   File "ipython_parallel.py", line 23, in main
>     sqxs = lview.map(lambda x: X(x, xs), xs)
>   File "<decorator-gen-136>", line 2, in map
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/view.py",
> line 50, in sync_results
>     ret = f(self, *args, **kwargs)
>   File "<decorator-gen-135>", line 2, in map
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/view.py",
> line 35, in save_ids
>     ret = f(self, *args, **kwargs)
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/view.py",
> line 1109, in map
>     return pf.map(*sequences)
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/remotefunction.py",
> line 285, in map
>     return self(*sequences, __ipp_mapping=True)
>   File "<decorator-gen-118>", line 2, in __call__
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/remotefunction.py",
> line 76, in sync_view_results
>     return f(self, *args, **kwargs)
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/remotefunction.py",
> line 259, in __call__
>     ar = view.apply(f, *args)
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/view.py",
> line 211, in apply
>     return self._really_apply(f, args, kwargs)
>   File "<decorator-gen-134>", line 2, in _really_apply
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/view.py",
> line 47, in sync_results
>     return f(self, *args, **kwargs)
>   File "<decorator-gen-133>", line 2, in _really_apply
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/view.py",
> line 35, in save_ids
>     ret = f(self, *args, **kwargs)
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/view.py",
> line 1037, in _really_apply
>     metadata=metadata)
>   File "/usr/lib/python3.6/site-packages/ipyparallel/client/client.py",
> line 1395, in send_apply_request
>     item_threshold=self.session.item_threshold,
>   File "/usr/lib/python3.6/site-packages/ipyparallel/serialize/serialize.py",
> line 166, in pack_apply_message
>     serialize_object(arg, buffer_threshold, item_threshold) for arg in
> args))
>   File "/usr/lib/python3.6/site-packages/ipyparallel/serialize/serialize.py",
> line 166, in <genexpr>
>     serialize_object(arg, buffer_threshold, item_threshold) for arg in
> args))
>   File "/usr/lib/python3.6/site-packages/ipyparallel/serialize/serialize.py",
> line 112, in serialize_object
>     buffers.insert(0, pickle.dumps(cobj, PICKLE_PROTOCOL))
> TypeError: can't pickle memoryview objects
>
> _______________________________________________
> IPython-User mailing list
> IPython-User at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-user
>



-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170320/3e17f429/attachment.html>

From takowl at gmail.com  Wed Mar 22 09:38:37 2017
From: takowl at gmail.com (Thomas Kluyver)
Date: Wed, 22 Mar 2017 13:38:37 +0000
Subject: [IPython-dev] [SciPy-User] migration of all scipy.org mailing
	lists
In-Reply-To: <CABL7CQi+eAA=vCXdZ8pxXiAo4SsWAq6y+NFDEHqXu5zaJU3m-w@mail.gmail.com>
References: <CABL7CQjaNPV_dOX07cvk-YpWuhapHvM1c0jv5Js0WK95qfhOuA@mail.gmail.com>
 <CABL7CQi+eAA=vCXdZ8pxXiAo4SsWAq6y+NFDEHqXu5zaJU3m-w@mail.gmail.com>
Message-ID: <CAOvn4qiHATrjQ6SJV80_9t+m+SjdVOEHCEZ0wAhX5bzb8DjTHQ@mail.gmail.com>

We may ask you to move ipython-user into the 'retire' bucket; we've been
gradually winding it down for a couple of years, and this seems to me like
a good moment to finally shutter it. IPython people, does this sound
reasonable to you?

ipython-dev is still in active use, so +1 to migrating that.

On 22 March 2017 at 09:24, Ralf Gommers <ralf.gommers at gmail.com> wrote:

> (and now with Didrik on Cc - apologies)
>
>
>
>
> On Wed, Mar 22, 2017 at 10:23 PM, Ralf Gommers <ralf.gommers at gmail.com>
> wrote:
>
>> Hi all,
>>
>> The server for the scipy.org mailing list is in very bad shape, so we
>> (led by Didrik Pinte) are planning to complete the migration of active
>> mailing lists to the python.org infrastructure and to decommission the
>> lists than seem dormant/obsolete.
>>
>> The scipy-user mailing list was already moved to python.org a month or
>> two ago, and that migration went smoothly.
>>
>> These are the lists we plan to migrate:
>>
>> astropy
>> ipython-dev
>> ipython-user
>> numpy-discussion
>> numpy-svn
>> scipy-dev
>> scipy-organizers
>> scipy-svn
>>
>> And these we plan to retire:
>>
>> Announce
>> APUG
>> Ipython-tickets
>> Mailman
>> numpy-refactor
>> numpy-refactor-git
>> numpy-tickets
>> Pyxg
>> scipy-tickets
>> NiPy-devel
>>
>> There will be a short period (<24 hours) where messages to the list may
>> be refused, with an informative message as to why. The mailing list address
>> will change from listname at scipy.org to listname at python.org
>>
>> This will happen asap, likely within a day or two. So two requests:
>> 1.  If you see any issue with this plan, please reply and keep Didrik and
>> myself on Cc (we are not subscribed to all lists).
>> 2. If you see this message on a numpy/scipy list, but not on another list
>> (could be due to a moderation queue) then please forward this message again
>> to that other list.
>>
>> Thanks,
>> Ralf
>>
>>
>>
>>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at python.org
> https://mail.python.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170322/b701a432/attachment.html>

From benjaminrk at gmail.com  Wed Mar 22 11:50:32 2017
From: benjaminrk at gmail.com (MinRK)
Date: Wed, 22 Mar 2017 16:50:32 +0100
Subject: [IPython-dev] [SciPy-User] migration of all scipy.org mailing
	lists
In-Reply-To: <CAOvn4qiHATrjQ6SJV80_9t+m+SjdVOEHCEZ0wAhX5bzb8DjTHQ@mail.gmail.com>
References: <CABL7CQjaNPV_dOX07cvk-YpWuhapHvM1c0jv5Js0WK95qfhOuA@mail.gmail.com>
 <CABL7CQi+eAA=vCXdZ8pxXiAo4SsWAq6y+NFDEHqXu5zaJU3m-w@mail.gmail.com>
 <CAOvn4qiHATrjQ6SJV80_9t+m+SjdVOEHCEZ0wAhX5bzb8DjTHQ@mail.gmail.com>
Message-ID: <CAHNn8BWqiySt22uEfmLYJq2fwycbqNUaj8xfbwLRpe459Dx-sQ@mail.gmail.com>

On Wed, Mar 22, 2017 at 2:38 PM, Thomas Kluyver <takowl at gmail.com> wrote:

> We may ask you to move ipython-user into the 'retire' bucket; we've been
> gradually winding it down for a couple of years, and this seems to me like
> a good moment to finally shutter it. IPython people, does this sound
> reasonable to you?
>
> ipython-dev is still in active use, so +1 to migrating that.
>

sounds good to me.


>
> On 22 March 2017 at 09:24, Ralf Gommers <ralf.gommers at gmail.com> wrote:
>
>> (and now with Didrik on Cc - apologies)
>>
>>
>>
>>
>> On Wed, Mar 22, 2017 at 10:23 PM, Ralf Gommers <ralf.gommers at gmail.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> The server for the scipy.org mailing list is in very bad shape, so we
>>> (led by Didrik Pinte) are planning to complete the migration of active
>>> mailing lists to the python.org infrastructure and to decommission the
>>> lists than seem dormant/obsolete.
>>>
>>> The scipy-user mailing list was already moved to python.org a month or
>>> two ago, and that migration went smoothly.
>>>
>>> These are the lists we plan to migrate:
>>>
>>> astropy
>>> ipython-dev
>>> ipython-user
>>> numpy-discussion
>>> numpy-svn
>>> scipy-dev
>>> scipy-organizers
>>> scipy-svn
>>>
>>> And these we plan to retire:
>>>
>>> Announce
>>> APUG
>>> Ipython-tickets
>>> Mailman
>>> numpy-refactor
>>> numpy-refactor-git
>>> numpy-tickets
>>> Pyxg
>>> scipy-tickets
>>> NiPy-devel
>>>
>>> There will be a short period (<24 hours) where messages to the list may
>>> be refused, with an informative message as to why. The mailing list address
>>> will change from listname at scipy.org to listname at python.org
>>>
>>> This will happen asap, likely within a day or two. So two requests:
>>> 1.  If you see any issue with this plan, please reply and keep Didrik
>>> and myself on Cc (we are not subscribed to all lists).
>>> 2. If you see this message on a numpy/scipy list, but not on another
>>> list (could be due to a moderation queue) then please forward this message
>>> again to that other list.
>>>
>>> Thanks,
>>> Ralf
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at python.org
>> https://mail.python.org/mailman/listinfo/scipy-user
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170322/2e36b189/attachment.html>

From fperez.net at gmail.com  Wed Mar 22 12:12:10 2017
From: fperez.net at gmail.com (Fernando Perez)
Date: Wed, 22 Mar 2017 09:12:10 -0700
Subject: [IPython-dev] [SciPy-User] migration of all scipy.org mailing
	lists
In-Reply-To: <CAHNn8BWqiySt22uEfmLYJq2fwycbqNUaj8xfbwLRpe459Dx-sQ@mail.gmail.com>
References: <CABL7CQjaNPV_dOX07cvk-YpWuhapHvM1c0jv5Js0WK95qfhOuA@mail.gmail.com>
 <CABL7CQi+eAA=vCXdZ8pxXiAo4SsWAq6y+NFDEHqXu5zaJU3m-w@mail.gmail.com>
 <CAOvn4qiHATrjQ6SJV80_9t+m+SjdVOEHCEZ0wAhX5bzb8DjTHQ@mail.gmail.com>
 <CAHNn8BWqiySt22uEfmLYJq2fwycbqNUaj8xfbwLRpe459Dx-sQ@mail.gmail.com>
Message-ID: <CAHAreOo5=ahu=czR4S09=ZogeV2i-9x_s-wxwLipgHLpSErk+A@mail.gmail.com>

On Wed, Mar 22, 2017 at 8:50 AM, MinRK <benjaminrk at gmail.com> wrote:

> On Wed, Mar 22, 2017 at 2:38 PM, Thomas Kluyver <takowl at gmail.com> wrote:
>
>> We may ask you to move ipython-user into the 'retire' bucket; we've been
>> gradually winding it down for a couple of years, and this seems to me like
>> a good moment to finally shutter it. IPython people, does this sound
>> reasonable to you?
>>
>> ipython-dev is still in active use, so +1 to migrating that.
>>
>
> sounds good to me.
>

I was also thinking of using this as an opportunity to stop ipython-user,
activity there has truly slowed to a trickle.

We should announce prominently that on ipython-user *before* it stops
working, though :), and point people to ipython-dev at python.org for
IPython-specific material, and the general Jupyter list for the rest.

Cheers

f
-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170322/bf5db5f0/attachment.html>

From damianavila at gmail.com  Wed Mar 22 12:50:37 2017
From: damianavila at gmail.com (=?UTF-8?Q?Dami=C3=A1n_Avila?=)
Date: Wed, 22 Mar 2017 13:50:37 -0300
Subject: [IPython-dev] [SciPy-User] migration of all scipy.org mailing
	lists
In-Reply-To: <CAHAreOo5=ahu=czR4S09=ZogeV2i-9x_s-wxwLipgHLpSErk+A@mail.gmail.com>
References: <CABL7CQjaNPV_dOX07cvk-YpWuhapHvM1c0jv5Js0WK95qfhOuA@mail.gmail.com>
 <CABL7CQi+eAA=vCXdZ8pxXiAo4SsWAq6y+NFDEHqXu5zaJU3m-w@mail.gmail.com>
 <CAOvn4qiHATrjQ6SJV80_9t+m+SjdVOEHCEZ0wAhX5bzb8DjTHQ@mail.gmail.com>
 <CAHNn8BWqiySt22uEfmLYJq2fwycbqNUaj8xfbwLRpe459Dx-sQ@mail.gmail.com>
 <CAHAreOo5=ahu=czR4S09=ZogeV2i-9x_s-wxwLipgHLpSErk+A@mail.gmail.com>
Message-ID: <CAH+mRR3dk4ztHg+ygJ9WQ-_RybxG=uMmYEOBqpzfu0GKhKc+cw@mail.gmail.com>

ipython-dev is still in active use, so +1 to migrating that.

+1

>We should announce prominently that on ipython-user *before* it stops
working, though :), and point people to ipython-dev at python.org for
IPython-specific material, and the general Jupyter list for the rest.

+1 as well.

2017-03-22 13:12 GMT-03:00 Fernando Perez <fperez.net at gmail.com>:

>
> On Wed, Mar 22, 2017 at 8:50 AM, MinRK <benjaminrk at gmail.com> wrote:
>
>> On Wed, Mar 22, 2017 at 2:38 PM, Thomas Kluyver <takowl at gmail.com> wrote:
>>
>>> We may ask you to move ipython-user into the 'retire' bucket; we've been
>>> gradually winding it down for a couple of years, and this seems to me like
>>> a good moment to finally shutter it. IPython people, does this sound
>>> reasonable to you?
>>>
>>> ipython-dev is still in active use, so +1 to migrating that.
>>>
>>
>> sounds good to me.
>>
>
> I was also thinking of using this as an opportunity to stop ipython-user,
> activity there has truly slowed to a trickle.
>
> We should announce prominently that on ipython-user *before* it stops
> working, though :), and point people to ipython-dev at python.org for
> IPython-specific material, and the general Jupyter list for the rest.
>
> Cheers
>
> f
> --
> Fernando Perez (@fperez_org; http://fperez.org)
> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
> fernando.perez-at-berkeley: contact me here for any direct mail
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev
>
>


-- 
*Dami?n Avila*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20170322/b3e976d7/attachment.html>