[jupyter] Re: How to design JupyterLab extension that reacts to pandas function calls

2018-09-18 Thread Tony Fast
You could likely achieve this with a custom profiler 
.  The profiler 
would provide you with the calling function and the return value; you'd 
have to implement the other business logic.  MonkeyType 
 is a good example a custom 
profiler.  Have a look at the call tracer 

 
to understand arguments returned by a custom profiler.  This approach would 
allow this hinting tool to work as a cell magic or context manager.


-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/55e0cb09-9901-4618-a5b0-56009b63035c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] How to design JupyterLab extension that reacts to pandas function calls

2018-09-18 Thread Adam Rule
Thanks! I've been keeping an eye on that thread and agree, there is a lot 
of overlap.

On Tuesday, September 18, 2018 at 8:56:34 AM UTC-7, Michael Milligan wrote:
>
> FYI you might take a look at the Jupyterlab variable inspector work being 
> tracked here: https://github.com/jupyterlab/jupyterlab/issues/443
>
> Seems like there could be some overlap with what you are trying to do.
>
> Cheers,
> Michael
>
> On Mon, Sep 17, 2018 at 7:42 PM, Adam Rule 
> > wrote:
>
>> Great point Brian. For prototyping's sake monkey patching should be 
>> enough to test if the interaction is valuable or not.
>>
>>
>> On Monday, September 17, 2018 at 4:45:19 PM UTC-7, ellisonbg wrote:
>>>
>>> I think it could be regular python code that uses the Jupyter display 
>>> system to display the information. The challenge is to figure out how to 
>>> detect the pandas function calls and add the needed logic before and after. 
>>> A good starting point might be to just monkey patch the relevant pandas 
>>> calls and wrap them in the logic you need. That would allow you to get 
>>> started quickly and explore the problem space.
>>>
>>> On Mon, Sep 17, 2018 at 3:40 PM Adam Rule  wrote:
>>>
 I have noticed that a number of Jupyter users call df.head(), df.shape, 
 df.describe(), or something similar almost every time they load or 
 manipulate a dataframe to inspect what their manipulation did. I would 
 like 
 to develop an extension or kernel magic that prints useful information to 
 a 
 cell's output based on the pandas function called in that cell. For 
 example, running pd.read_csv() might automatically print the shape and 
 column names of the loaded dataframe and df.drop_duplicates() might 
 automatically print how many duplicates were dropped and how many unique 
 rows remain.

 How might I architect such an extension (e.g., a JupyterLab extension, 
 an iPython kernel magic, or something else)? I think I would need to 
 detect 
 when certain pandas functions are about to be run by the kernel and gather 
 information about the dataframe immediately before and after execution. 
 Would that even be feasible?

 -- 
 You received this message because you are subscribed to the Google 
 Groups "Project Jupyter" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to jupyter+u...@googlegroups.com.
 To post to this group, send email to jup...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jupyter/9e1dfb92-87e0-4a8b-b170-370ab7cfabc7%40googlegroups.com
  
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>> -- 
>>> Brian E. Granger
>>> Associate Professor of Physics and Data Science
>>> Cal Poly State University, San Luis Obispo
>>> @ellisonbg on Twitter and GitHub
>>> bgra...@calpoly.edu and elli...@gmail.com
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jupyter+u...@googlegroups.com .
>> To post to this group, send email to jup...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/69c48c2c-2c9f-4ce1-8491-5c98399eb8ff%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Michael Milligan, Ph.D. | Supercomputing Institute
> Assistant Director for  | University of Minnesota
>Application Development  | mill...@umn.edu 
> www.msi.umn.edu/staff/milligan  | Phone: 612-624-8857
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/f5e0aa2b-da70-4ad8-abc9-f525736db1e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jupyter] How to design JupyterLab extension that reacts to pandas function calls

2018-09-18 Thread Michael Milligan
FYI you might take a look at the Jupyterlab variable inspector work being
tracked here: https://github.com/jupyterlab/jupyterlab/issues/443

Seems like there could be some overlap with what you are trying to do.

Cheers,
Michael

On Mon, Sep 17, 2018 at 7:42 PM, Adam Rule  wrote:

> Great point Brian. For prototyping's sake monkey patching should be enough
> to test if the interaction is valuable or not.
>
>
> On Monday, September 17, 2018 at 4:45:19 PM UTC-7, ellisonbg wrote:
>>
>> I think it could be regular python code that uses the Jupyter display
>> system to display the information. The challenge is to figure out how to
>> detect the pandas function calls and add the needed logic before and after.
>> A good starting point might be to just monkey patch the relevant pandas
>> calls and wrap them in the logic you need. That would allow you to get
>> started quickly and explore the problem space.
>>
>> On Mon, Sep 17, 2018 at 3:40 PM Adam Rule  wrote:
>>
>>> I have noticed that a number of Jupyter users call df.head(), df.shape,
>>> df.describe(), or something similar almost every time they load or
>>> manipulate a dataframe to inspect what their manipulation did. I would like
>>> to develop an extension or kernel magic that prints useful information to a
>>> cell's output based on the pandas function called in that cell. For
>>> example, running pd.read_csv() might automatically print the shape and
>>> column names of the loaded dataframe and df.drop_duplicates() might
>>> automatically print how many duplicates were dropped and how many unique
>>> rows remain.
>>>
>>> How might I architect such an extension (e.g., a JupyterLab extension,
>>> an iPython kernel magic, or something else)? I think I would need to detect
>>> when certain pandas functions are about to be run by the kernel and gather
>>> information about the dataframe immediately before and after execution.
>>> Would that even be feasible?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Project Jupyter" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jupyter+u...@googlegroups.com.
>>> To post to this group, send email to jup...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/jupyter/9e1dfb92-87e0-4a8b-b170-370ab7cfabc7%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Brian E. Granger
>> Associate Professor of Physics and Data Science
>> Cal Poly State University, San Luis Obispo
>> @ellisonbg on Twitter and GitHub
>> bgra...@calpoly.edu and elli...@gmail.com
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+unsubscr...@googlegroups.com.
> To post to this group, send email to jupyter@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/69c48c2c-2c9f-4ce1-8491-5c98399eb8ff%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Michael Milligan, Ph.D. | Supercomputing Institute
Assistant Director for  | University of Minnesota
   Application Development  | milli...@umn.edu
www.msi.umn.edu/staff/milligan  | Phone: 612-624-8857

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAPuy8gpXtbZAyBLTncUg7Mf-f%2BERcapDnLxNC_OAb2fR%2B%2BAUqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] Re: JupyterHub cannot talk to LDAP server

2018-09-18 Thread Dave Hirschfeld
https://github.com/jupyterhub/ldapauthenticator/pull/87

On Tuesday, 18 September 2018 05:45:08 UTC+10, Pasle Choix wrote:
>
> Hello all,
>
> JupyterHub does not trust my LDAP certificate, I have a LDAP cert file 
> from system admin and was advised to use it to communicate to LDAP server, 
> the cert is not trusted and JupyterHub throws out error:
>
> Can't contact LDAP server
>
> Similar error is also reported in 
> https://bneijt.nl/blog/post/connecting-to-ldaps-with-self-signed-cert-using-python/
>  
> but the solution doesn't work out here.
>
> Configuration as below:
> tried three different server_address options, same error.
>
> c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
> #c.LDAPAuthenticator.server_address = 'xxx.xxx.xxx.xxx'
> #c.LDAPAuthenticator.server_address = 'nydc-dc01.company.pri'
> c.LDAPAuthenticator.server_address = 'ldaps://nydc-dc01.company.pri'
> c.LDAPAuthenticator.use_ssl = True
> c.LDAPAuthenticator.server_port = 636
>
> c.LDAPAuthenticator.bind_dn_template = []
> c.LDAPAuthenticator.user_search_base = 'OU=CompanyOU 
> Users,DC=CompanyDC,DC=pri'
> c.LDAPAuthenticator.user_attribute = 'sAMAccountName'
>
> c.LDAPAuthenticator.lookup_dn = True
> c.LDAPAuthenticator.lookup_dn_search_user = 'CN=ldapbind2,OU=Company Users 
> (System),DC=CompanyDC,DC=pri'
> c.LDAPAuthenticator.lookup_dn_search_password = 'x'
>
>
> c.LDAPAuthenticator.allowed_groups = ['CN=wfgo-0081,OU=company 
> Groups,DC=company,DC=pri']
>
>
> It would be greatly appreciated if anyone can share any light here.
>
>
> **
> *Sincerely yours,*
>
>
> *Raymond*
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/4b56b497-823e-419b-b1f0-fdcf885af26d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[jupyter] Jupyter lab Terminal can't copy and paste!

2018-09-18 Thread 铁龙国
Jupyter lab Terminal can't copy and paste!

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jupyter+unsubscr...@googlegroups.com.
To post to this group, send email to jupyter@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/bfd7f69c-0923-4417-aa61-48d384048d09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.