BioPython and CVS

off topic 15 Comments »
Bazaar
Image via Wikipedia

I start this post with an apology. I usually don’t rant or vent here, which are feelings that I usually reserve to my personal blog.

I don’t use BioPython, never used it. I have it installed in my systems, but I never wrote a piece of code importing BioPython routines. But I subscribe to their mailing lists, both user and developer. I maybe have written once to the list, and I just follow the discussions there.

Since last year one of the main topics has been the possibility of moving BioPython from CVS to another version control system. Yes, you read it right. It’s 2009 and BioPython uses CVS and their version control system. Soon, CVS will be like typewriters and LPs to young developers. Last stable release of CVS was sometime in 2005, what in interwebs time is equivalent to something like 1972. Since 2005, Subversion has taken the world of version control by storm, and Git is getting also very strong, not to mention Bazaar, Darcs, Mercurial and some others that I might not be aware of.

This is a discussion that have been dragging for sometime in the list. And it’s a shame, a clear lack of leadership from whoever is (not) leading the project. BioRuby is Git, BioPerl SVN and BioPython is CVS, because they “need to care for the legacy developers”. It’s like MSFT keeping two copies of the Notepad executable because they needed to cater to legacy applications, but with a different scale of course. With the current Python steam in the non-bioinformatics and bioinformatics community is very sad to see BioPython not evolving (before you ask me, no, I’m not interested in helping, not the way things are now). Perl which is language forever-in-waiting for its holy grail (Perl 6) has a strong community behind it, and more important an excellent leadership, that’s not scare of making decisions.

So, if you’re still using CVS, it’s 2009!

Reblog this post [with Zemanta]

Expert Python Programming by Tarek Ziadé – a review of Chapter 3

off topic 2 Comments »

The chapter 3 review that I promised for “tomorrow” (last Saturday) was lazily postponed until today. So, let’s get to it. Tarek in this chapter continues with syntax best practices, but at this time at class level. As expected the chapter requires that you have a minimal knowledge of Python classes, so I can say it’s geared to somewhat experienced programmers, and not to newcomers. There is a short explanation on sub-classing that warms up things for the next sections.

Next is the built-in method (type?) super, which was new to me. Basically super gives you access a method or attribute of a class by calling its parent directly. This is a segue into understanding the Method Resolution Order in Python, which is understanding which class has precedence over the others. For me, I haven’t dealt with such structures before it was a good and straight explanation, especially when he explains about possible pitfalls of using super. A short list of best practices helps:

  • Multiple inheritance should be avoided:
  • super usage has to be consistent: Mixing super and classic calls is a confusing practice.
  • Don’t mix old-style and new-style classes
  • Class hierarchy has to be looked over when a parent class is called

After dealing with MRO, comes what I think is one of the best sections of the book so far, where Tarek explains about object descriptors and gives a little bit of the Python’s approach to introspection. This short section is basically all code, but it’s good to have a good best practices reference, including here properties and slots.

The last part of the chapter covers meta programming, and as Chris pointed in the comments, that’s a difficult area of Python (maybe for the ones like me that don’t have a CS formation). I would have to try the examples by hand and maybe define areas in my code where I can use it, so to take fully advantage and fully understand it.

Overall, the chapter gives a good series of topics about Python classes and I enjoyed learning a little bit more things that I couldn’t understand previously. Next we will see a review of chapter 4, that deals with PEP 8 and naming best practices.

Expert Python Programming by Tarek Ziadé – a review of Chapter 2

off topic 2 Comments »

So we’re up to the second chapter of Tarek’s book. A short disclaimer before diving into it. I started this blog, basically one year after I had started programming with Python. The initial idea was to “convert” the Beginning Perl for Bioinformatics book to Python and see what were the advantages and disadvantages of both languages. I was far from being a advanced Python programmer, and the inception of the blog helped me getting close to that, even though I consider myself far from being an expert programmer in Python. I learned a lot working on converting the Perl and learned a lot from the comments and interaction with other programmers and visitors of the blog. As anything in life one’s path is long and tortuous and there’s nothing better than daily learning and exercise.

So, as I mentioned in the previous post, this book was tailored for someone like me. I needed a boost on advanced Python techniques and the second chapter just gave me that. Tarek writes in this chapter about good syntax practices below the class level, functions and methods that are common in daily usage. He starts with list comprehensions, that we have seen in this site. It’s a short and concise section and gives you exactly what you need about this functionality.

Next, iterators and generators. I had a little bit of background on iterators, and have used them here and there, but not a lot on generators. I learned a bit from this section, what you expect from a book like this, things like the close and throw. Although this was good first step on generators, I wished the section could be longer, but that maybe not the focus of the book.

Coroutines was a completely new subject for me. Maybe I haven’t been diving into Python as much as I needed to, but time is short these days and programming Python is not the first objective of my work. The example is complete and easy to understand, but again I wish it was a tad bit longer. Tarek then explains a bit of generator expressions (list comprehension for generators) and enters the itertools module. So far so good, it’s a nice summary (at least for me) of simple techniques that can be incorporated into daily coding. And then … Decorators.

I blame on my poor CS skills or maybe my whole background on programming, but I still cannot get decorators. In my short-sighted view of the programming world I cannot see a place, at least on the things I’m doing, where I can use a decorator. And here comes the first criticism of the book: I still cannot get after reading the section. One thing that would help a bit would be to have colours on the examples and maybe go over them explaining some code lines. But at the same time, I admit that this might be a personal problem, where the concept of decorators don’t fit into my brain, and maybe the focus of the book is to show this advanced technique to someone that has a better grasp of the concept.

Overall, it’s a very good chapter and a good pointer to some expert/advanced techniques in Python. Tomorrow, chapter 3, and we’re a going to see classes.

Reblog this post [with Zemanta]

Expert Python Programming by Tarek Ziadé – a review of Chapter 1

off topic Comments Off

I’ve bought (no, Packt Publishing didn’t send me a copy for review) Tarek’s book quite sometime ago, but job changes, and extra-Python issues kept me away from reading it with the attention if fully deserve. When I saw the announcement, I thought that this was the book I wanted in Python. First, a little bit of perspective.

I’m a a biologist, self-taught programmer/coder/you-name-it. I only had a brief course on programming logic with Pascal in 1993 (I think). I first learned Basic on Apple ][, then on PC, then moved to Visual Basic, Pascal, C and C++, most of them with the help of books. About three and a half years ago, I got tired of compiling things and decided to learn a different language that would be more agile to code with. Not liking Perl, made me check Python. And I got hooked. Of course as a lay programmer, I won’t discuss why it’s better or worse than any other language using technical terms, but I can say that Python fits my needs in fast and efficient programming and I’m quite happy with the choice I’ve made. So, this review will not be technical, but will try to expose the book’s strengths and the weak parts.

Chapter one gives a good introduction on how to install Python and some nice pointers on how to program Python, such as IDEs and initial settings you can add to it. Also there is a short overview of the modern Python implementations. Is it a necessary chapter? Yes and no. No, because the schooled Python user won’t need it, his or her programming environment will already be installed, configured, set and ready to go. Yes, because this chapter works as a disclaimer for the not-so-experienced Python programmer, and shows everyone of what is expected of this book and what standards will be used. In my opinion, it’s a necessary starting point, so the author knows that everyone is at the same level. This chapter is also a good short summary of good practices of installing and setting up Python.

Tomorrow, chapter 2.

Python Magazine?

off topic Comments Off

I have been buying Python Magazine in the last months and I really like it, especially now that I already miss Linux Magazine and have no close source for Linux Journal (I should subscribe, I know). Last week I got an email from Python Magazine that I could use a coupon to buy some issues. Coupon that I used right away. Paid with PayPal and I’m still waiting for my issue to show up. Sent a couple of emails using the contact form and until now, nothing. I’ll wait until next year and see what happened. It’s really sad because this issue covers cloud computing with Python.

Edit: problem solved. Thanks everyone!

Test from Zoundry Raven

off topic Comments Off

I am testing a offline/desktop bloggin tool, called Zoundry Raven. New posts are on the way, as promised.

New posts

off topic 3 Comments »

CPythonImage via WikipediaPosts will resume next week. I was off on vacation and then I changed jobs, so there was no time for Python fun.

Zemanta Pixie

Code repository

off topic Comments Off

I am transferring the current repository, which is “hosted” in a static page on th blog, to a Git repository on github.com. I am posting soon a quick guide on how to access it. I am also making all relevant entries from the blog into stand alone html pages for off-line browsing.

Anyone with Git experience the link to the repository is here (not many commits yet, but it is coming).

Looking for topics

off topic Comments Off

I am preparing a couple of posts based on the latest entries and some other subject and after that we going to check again functional programming in Python geared to Bioinformatics. I am also planning on covering topics on Mastering Perl for Bioinformatics and convert them to Python.

Apart from that I already have some suggestions from friends and colleagues, but I am still looking for some subjects that the readers would like to see covered here. Leave me a message or a comment below with some Bioinformatics subject that would be interesting to write about.

On another note, the blog now is syndicated on Planet Python and Unofficial Planet Python. Welcome.

RSS

off topic Comments Off

I added a more evident link to the RSS feed on the sidebar. If you haven’t already subscribed, please do so. The feed is now syndicated through the Unofficial Planet Python.

Design by j david macor.com.Original WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in