From nicholsonjf at gmail.com Mon May 5 05:21:09 2014 From: nicholsonjf at gmail.com (James Nicholson) Date: Sun, 4 May 2014 20:21:09 -0700 Subject: [Baypiggies] Tonight: Using IPython for Parallel Computing In-Reply-To: References: Message-ID: Hi everyone, Here's a link to the video of last month's talk: Parallel Computing with IPython See you all later this month! -James James Nicholson nicholsonjf.com On Thu, Apr 24, 2014 at 7:23 AM, Glen Jarvis wrote: > > *Speaker: Benjamin Ragan-Kelley * > Topic: Using IPython for Parallel Computing > > *Abstract:* > IPython provides tools for interactive computing ? code introspection, > completion, and environments such as an interactive shell and web-based > notebook. In addition to these environments, IPython provides a suite of > tools for interactive parallel computing on multicore machines or clusters. > We will cover some of the API and architecture for IPython.parallel, using > some example use cases. It will all be presented in IPython notebooks, so > you can follow along if you like. > > > > > *Speaker: * > Min finished his PhD at UC Berkeley in computational plasma physics in > May, 2013. He has been a contributor to IPython since 2006, when the first > implementation of IPython's parallel computing capabilities was his > undergraduate thesis at Santa Clara University. He now works full time on > IPython at UC Berkeley, funded by the Alfred P. Sloan Foundation. He is > also the maintainer of pyzmq, the Python bindings of the ZeroMQ messaging > library > > > > > > *If you wish to post jobs here, please go to : Job Listings > * > Meeting Schedule The meeting begins @ 7:30PM. > The main presentation will start @ 7:40 PM, after the usual announcements. > > LinkedIn Corporation > 2061 (Bldg 6) Stierlin Ct.Mountain View, CA 94043 > > Meeting Room: *Neon Carrot conference room *(subject to change monthly) > > > > -- > > We should be taught not to wait for inspiration to start a thing. Action > always generates inspiration. Inspiration seldom generates action. > > -- Frank Tibolt > > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chityala at gmail.com Tue May 13 05:35:02 2014 From: chityala at gmail.com (Ravi) Date: Mon, 12 May 2014 20:35:02 -0700 Subject: [Baypiggies] Textbook on image acquisition and processing using Python Message-ID: Hi I am Ravi Chityala. I introduced the book that I co-authored during the last meeting. In this email, I would like to provide some information about the book. We chose Python as our programming language, as it is an open source language which is gaining popularity in both academia and industry. It is highly scalable and has a very easy syntax and it is replacing many paid packages and software. The title of the book is ?Image Processing and Acquisition using Python.? It is a comprehensive book which illustrates image processing techniques with Python code and also image acquisition in x-ray, CT, MRI and microscopes. The book details are Title: Image Processing and Acquisition using Python ISBN-10: 1466583754 ISBN-13: 978-1466583757 Link: http://goo.gl/9EtdFN Price: $75.28 Your feedback is very valuable. Thanks, -- Regards Ravi Chityala -------------- next part -------------- An HTML attachment was scrubbed... URL: From wescpy at gmail.com Tue May 13 20:59:46 2014 From: wescpy at gmail.com (wesley chun) Date: Tue, 13 May 2014 11:59:46 -0700 Subject: [Baypiggies] ANN: Intro+Intermediate Python, San Francisco, Jul 30-31, Aug 1 Message-ID: it was great seeing some of you at the last BayPIGgies meeting and few weeks ago. some of you came up to inquire about my next Python course, so i wanted to hand out the formal info to you below. feel free to forward to anyone you know who may be interested, and let me know if you have any questions! cheers, --wesley ------------------- Greetings! I'll be offering another hardcore Python course this summer near the San Francisco airport. If you're somewhat new to or have some Python experience under your belt already but want to fill-in the holes, this course is for you. Why take a real course when you can learn Python online or by reading books? Well, my goal isn't to teach Python syntax, which you can from any teacher, live or online, or from giant books. My job is to create great Python developers and removing the roadblocks that impede your path to getting there. This intensive course is based on my "Core Python" (http://corepython.com) books and is made up of 3 full days complete with lectures and several hands-on coding labs per day. t's also a great excuse to coming to beautiful Northern California for a summer vacation! Groups and development teams are welcome as well as individuals. I do more private gigs and fewer of these public courses lately, so please come join if you can... my next public intro/intermediate course may not be for awhile, so I'm hoping to meet some of you this time around! Sign up soon... there's a special earlybird rate for the rest of this month before going up to the regular rate after that. More details and registration at http://cyberwebconsulting.com as well as in the ad: http://goo.gl/pyJseQ I'm no fan of spam, so I'll only send out one last reminder as the date gets closer... say around the end of June. Cheers, -- Wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "A computer never does what you want... only what you tell it." +wesley chun : wescpy at gmail : @wescpy Python training & consulting : http://CyberwebConsulting.com "Core Python" books : http://CorePython.com Python blog: http://wescpy.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicholsonjf at gmail.com Thu May 15 06:28:22 2014 From: nicholsonjf at gmail.com (James Nicholson) Date: Wed, 14 May 2014 21:28:22 -0700 Subject: [Baypiggies] Links to live stream of next week's talk Message-ID: Hi everyone, As you know, next week on Thursday, May 22nd at 7:30pm Shannon -jj Behrens will give a talk "Best Practices for Software Engineers" at LinkedIn's Mountain View office. We've setup a Google Hangout on Air to live stream the talk, the links are below. Feel free to share the event on your Twitter, Facebook etc. It's best to share the Google+ link, because one can navigate from the Google+ event to the YouTube video, but not vice versa. Google+ event: https://plus.google.com/events/c5lq32ubasinoro5ftgtfa80frs YouTube video: http://www.youtube.com/watch?v=jzQmQDIii14 Let me know if you have any questions or suggestions! -James James Nicholson nicholsonjf.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjinux at gmail.com Sat May 24 00:03:14 2014 From: jjinux at gmail.com (Shannon -jj Behrens) Date: Fri, 23 May 2014 15:03:14 -0700 Subject: [Baypiggies] Best Practices for Software Engineers Message-ID: Thanks to everyone who came to my talk last night! Slides: bit.ly/best_practices_baypiggies Video: https://www.youtube.com/watch?v=jzQmQDIii14 -- In this life we cannot do great things. We can only do small things with great love. -- Mother Teresa -------------- next part -------------- An HTML attachment was scrubbed... URL: From ams.fwd at gmail.com Sat May 31 05:51:01 2014 From: ams.fwd at gmail.com (AM) Date: Fri, 30 May 2014 20:51:01 -0700 Subject: [Baypiggies] Assigning functions as class variables Message-ID: <538951A5.3010000@gmail.com> Hi. What I am trying to do is assign a function to a class variable and use it. For e.g.: def foo(a): print a class X(object): @classmethod def bar(cls, fn): cls.fn = fn @classmethod def baz(cls, a): cls.fn(a) X.bar(foo) X.baz(12) If I run this I get: TypeError: unbound method foo() must be called with X instance as first argument (got int instance instead) I sort of understand why allowing this might cause a bit of trouble as fn could be an unbound method which receives X as the first argument, however I don't quite understand this particular error. Changing foo to accept another argument also does not work. If someone could enlighten me about: 1. Why exactly is calling the method disallowed in pretty much all forms? 2. How do people work around this? that would be great. Thanks. AM From nanshu at gmail.com Sat May 31 06:10:00 2014 From: nanshu at gmail.com (Nanshu Chen) Date: Fri, 30 May 2014 21:10:00 -0700 Subject: [Baypiggies] Assigning functions as class variables In-Reply-To: <538951A5.3010000@gmail.com> References: <538951A5.3010000@gmail.com> Message-ID: <2C634296E96F4CC6B986E464CD17DB03@gmail.com> Do you think the following can be a possible workaround? def foo(a): print a class X(object): fn = [None] @classmethod def bar(cls, fn): cls.fn[0] = fn @classmethod def baz(cls, a): cls.fn[0](a) On Friday, May 30, 2014 at 8:51 PM, AM wrote: > Hi. > > What I am trying to do is assign a function to a class variable and use > it. For e.g.: > > > def foo(a): > print a > > class X(object): > > @classmethod > def bar(cls, fn): > cls.fn = fn > > @classmethod > def baz(cls, a): > cls.fn(a) > > > X.bar(foo) > X.baz(12) > > If I run this I get: > TypeError: unbound method foo() must be called with X instance as first > argument (got int instance instead) > > I sort of understand why allowing this might cause a bit of trouble as > fn could be an unbound method which receives X as the first argument, > however I don't quite understand this particular error. > > Changing foo to accept another argument also does not work. If someone > could enlighten me about: > > 1. Why exactly is calling the method disallowed in pretty much all forms? > > 2. How do people work around this? > > that would be great. > > Thanks. > AM > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org (mailto:Baypiggies at python.org) > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nanshu at gmail.com Sat May 31 06:28:24 2014 From: nanshu at gmail.com (Nanshu Chen) Date: Fri, 30 May 2014 21:28:24 -0700 Subject: [Baypiggies] Assigning functions as class variables In-Reply-To: <2C634296E96F4CC6B986E464CD17DB03@gmail.com> References: <538951A5.3010000@gmail.com> <2C634296E96F4CC6B986E464CD17DB03@gmail.com> Message-ID: Hmmm.. I?d like to call back my previous reply, as I still think although the workaround works, it is not the right way of doing things. The following code is better: ----------------- def foo(a): print a class X(object): @classmethod def bar(cls, fn): cls.fn = staticmethod(fn) @classmethod def baz(cls, a): cls.fn(a) X.bar(foo) X.baz(12) ------------------- Nanshu On Friday, May 30, 2014 at 9:10 PM, Nanshu Chen wrote: > Do you think the following can be a possible workaround? > > def foo(a): > print a > > class X(object): > fn = [None] > > @classmethod > def bar(cls, fn): > cls.fn[0] = fn > > @classmethod > def baz(cls, a): > cls.fn[0](a) > > > > On Friday, May 30, 2014 at 8:51 PM, AM wrote: > > > Hi. > > > > What I am trying to do is assign a function to a class variable and use > > it. For e.g.: > > > > > > def foo(a): > > print a > > > > class X(object): > > > > @classmethod > > def bar(cls, fn): > > cls.fn = fn > > > > @classmethod > > def baz(cls, a): > > cls.fn(a) > > > > > > X.bar(foo) > > X.baz(12) > > > > If I run this I get: > > TypeError: unbound method foo() must be called with X instance as first > > argument (got int instance instead) > > > > I sort of understand why allowing this might cause a bit of trouble as > > fn could be an unbound method which receives X as the first argument, > > however I don't quite understand this particular error. > > > > Changing foo to accept another argument also does not work. If someone > > could enlighten me about: > > > > 1. Why exactly is calling the method disallowed in pretty much all forms? > > > > 2. How do people work around this? > > > > that would be great. > > > > Thanks. > > AM > > _______________________________________________ > > Baypiggies mailing list > > Baypiggies at python.org (mailto:Baypiggies at python.org) > > To change your subscription options or unsubscribe: > > https://mail.python.org/mailman/listinfo/baypiggies > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ams.fwd at gmail.com Sat May 31 06:34:33 2014 From: ams.fwd at gmail.com (AM) Date: Fri, 30 May 2014 21:34:33 -0700 Subject: [Baypiggies] Assigning functions as class variables In-Reply-To: References: <538951A5.3010000@gmail.com> Message-ID: <53895BD9.1070704@gmail.com> That was great. Thanks. On 05/30/2014 09:30 PM, Simeon Franklin wrote: > tl;dr - wrap your new functions in staticmethod and it should work. > > A function attached to a class is a method. If you reference a method > attached to a class it is an unbound method - a method of a class but > not bound to a particular object. If you refer to it on an > instanciated object it is bound to that object. > > >>> class Foo(object): > ... def method(self): > ... pass > ... > >>> Foo.method > > >>> obj = Foo() > >>> obj.method > > > > Either way Python checks methods for the presence of the "self" > argument and it has to be the right kind of thing - an instance of the > class. > > If you don't like this and just want a plain old function you can get > it to work by using the staticmethod decorator which takes a method > and does something complicated to get around normal function > invocation rules. If I remember it correctly staticmethod actually > wraps your function in a callable object but how it does it isn't that > important - it's easy to use. > > >>> Foo.pof = lambda : 1 # just using lambda to save space. This could > be any Plain Old Function > >>> Foo.pof() > Traceback (most recent call last): > File "", line 1, in > Foo.pof() > TypeError: unbound method () must be called with Foo instance > as first argument (got nothing instead) > >>> Foo.pof = staticmethod(lambda : 1) # but if I wrap it in staticmethod > >>> Foo.pof() # I'm ok to call it without passing an instance of Foo > 1 > > Hope that helped! > > -regards > Simeon Franklin > > > > On Fri, May 30, 2014 at 8:51 PM, AM > wrote: > > Hi. > > What I am trying to do is assign a function to a class variable > and use it. For e.g.: > > > def foo(a): > print a > > class X(object): > > @classmethod > def bar(cls, fn): > cls.fn = fn > > @classmethod > def baz(cls, a): > cls.fn(a) > > > X.bar(foo) > X.baz(12) > > If I run this I get: > TypeError: unbound method foo() must be called with X instance as > first argument (got int instance instead) > > I sort of understand why allowing this might cause a bit of > trouble as fn could be an unbound method which receives X as the > first argument, however I don't quite understand this particular > error. > > Changing foo to accept another argument also does not work. If > someone could enlighten me about: > > 1. Why exactly is calling the method disallowed in pretty much all > forms? > > 2. How do people work around this? > > that would be great. > > Thanks. > AM > _______________________________________________ > Baypiggies mailing list > Baypiggies at python.org > To change your subscription options or unsubscribe: > https://mail.python.org/mailman/listinfo/baypiggies > > From ams.fwd at gmail.com Sat May 31 06:35:04 2014 From: ams.fwd at gmail.com (AM) Date: Fri, 30 May 2014 21:35:04 -0700 Subject: [Baypiggies] Assigning functions as class variables In-Reply-To: References: <538951A5.3010000@gmail.com> <2C634296E96F4CC6B986E464CD17DB03@gmail.com> Message-ID: <53895BF8.20601@gmail.com> On 05/30/2014 09:28 PM, Nanshu Chen wrote: > Hmmm.. I?d like to call back my previous reply, as I still think > although the workaround works, it is not the right way of doing > things. The following code is better: > ----------------- > def foo(a): > print a > > class X(object): > > @classmethod > def bar(cls, fn): > cls.fn = staticmethod(fn) > > @classmethod > def baz(cls, a): > cls.fn(a) > > X.bar(foo) > X.baz(12) > ------------------- > > Nanshu > > > On Friday, May 30, 2014 at 9:10 PM, Nanshu Chen wrote: > >> Do you think the following can be a possible workaround? >> >> def foo(a): >> print a >> >> class X(object): >> fn = [None] >> >> @classmethod >> def bar(cls, fn): >> cls.fn[0] = fn >> >> @classmethod >> def baz(cls, a): >> cls.fn[0](a) >> >> On Friday, May 30, 2014 at 8:51 PM, AM wrote: >> >>> Hi. >>> >>> What I am trying to do is assign a function to a class variable and use >>> it. For e.g.: >>> >>> >>> def foo(a): >>> print a >>> >>> class X(object): >>> >>> @classmethod >>> def bar(cls, fn): >>> cls.fn = fn >>> >>> @classmethod >>> def baz(cls, a): >>> cls.fn(a) >>> >>> >>> X.bar(foo) >>> X.baz(12) >>> >>> If I run this I get: >>> TypeError: unbound method foo() must be called with X instance as first >>> argument (got int instance instead) >>> >>> I sort of understand why allowing this might cause a bit of trouble as >>> fn could be an unbound method which receives X as the first argument, >>> however I don't quite understand this particular error. >>> >>> Changing foo to accept another argument also does not work. If someone >>> could enlighten me about: >>> >>> 1. Why exactly is calling the method disallowed in pretty much all >>> forms? >>> >>> 2. How do people work around this? >>> >>> that would be great. >>> >>> Thanks. >>> AM >>> _______________________________________________ >>> Baypiggies mailing list >>> Baypiggies at python.org >>> To change your subscription options or unsubscribe: >>> https://mail.python.org/mailman/listinfo/baypiggies >> > Thanks. That was it. AM