vs2015python_我2015年的Python生活

vs2015python

My last post about my favourite ‘new’ (well, new to me) Python packages seemed to be very well received. I’ll post a ‘debrief’ post within the next few weeks, reflecting on the various comments that were made on Hacker News, Reddit and so on, but before that I want to post a slightly more personal post about my work with Python during the last year. It’s been quite a big year for me in terms of my Python work – so lets get started!

关于我最喜欢的“新”(对我来说是新的)Python软件包的上一篇文章似乎很受欢迎。 我将在接下来的几周内发布“摘要”帖子,以反映在Hacker News,Reddit等网站上发表的各种评论,但是在此之前,我想发表一些关于Python的个人文章去年。 就我的Python工作而言,对我来说已经是非常重要的一年-因此,让我们开始吧!

我的包裹 (My packages)

At the beginning of 2015 I had four modules published on PyPI; now I have seven! Lets have a look at each of them in turn:

在2015年初,我在PyPI上发布了四个模块。 现在我有七个! 让我们依次看一下它们:

Py6S (Py6S)

Py6S is my Python interface to the 6S Radiative Transfer Model (a model used to simulate how light passes through the atmosphere). It is a fairly specialist tool so will never get record numbers of downloads, but I’ve been impressed with number of users it has gained over the last year. It’s taken a while, but it seems to have started being used routinely by a range of scientists at various organisations including NASA!

Py6S是我的6S辐射传递模型 (用于模拟光如何通过大气的模型)的Python接口。 这是一个相当专业的工具,因此永远不会获得创纪录的下载量,但是我对过去一年获得的用户数量印象深刻。 它花费了一段时间,但似乎已经开始被包括NASA在内的各种组织的众多科学家例行使用!

The major change to Py6S in 2015 has been adding support for Python 3. This was actually meant to have been done in July 2014, but I think managed to make some sort of awful mistake with Git and revert the wrong commit… Anyway, it’s all working for Python 2 and Python 3 now! Most of the rest of the changes have just been small bugfixes, adding tests and so on.

2015年Py6S的主要变化是增加了对Python 3的支持。这实际上是在2014年7月完成的,但我认为设法用Git犯了一些可怕的错误并还原了错误的提交……无论如何,这就是全部立即为Python 2和Python 3工作! 其余大部分更改只是小错误修正,添加了测试等。

Downloads in last month: ~1700

上个月下载量: 〜1700

日期范围解析器 (daterangeparser)

daterangeparser is a module to parse, you guessed it…date ranges. For example, it will take something like ’20th – 29th July 2014′ and create two datetime objects to represent the start and end dates. I first released it in April 2012 and it reached 1.0 in October 2013. I haven’t used it much recently, but other people seem to have found it and started using it – and submitting bug reports and pull requests! This really shows one of the huge benefits of open-source code: I’ve done very little with the code, but I’ve had nine pull requests adding new functionality and fixing bugs, which is great! I’m really glad that others can benefit from it.

daterangeparser是要解析的模块,您猜出来了……日期范围。 例如,将需要类似“ 2014年7月20日至29日”的操作,并创建两个datetime对象来表示开始和结束日期。 我在2012年4月首次发布它,并在2013年10月达到1.0。最近我还没有使用过它,但是其他人似乎已经找到并开始使用它-并提交错误报告和请求请求! 这确实显示了开放源代码的巨大好处之一:我对代码做了很少的工作,但是我有9个请求请求添加了新功能并修复了错误,这真是太好了! 我真的很高兴其他人可以从中受益。

Downloads in last month: ~1700

上个月下载量: 〜1700

收据 (recipy)

recipy is a new module for reproducible research in Python which was first released in August 2015. I’ve explained the story behind recipy elsewhere, but in brief: I created the first version at the Collaborations Workshop 2015 Hack Day (which my team won!), and we worked to improve it, before presenting at EuroSciPy 2015. The best way to find out how it works is to watch the video of my talk at EuroSciPy 2015.

recipy是用于Python中可重现性研究的新模块,该模块于2015年8月首次发布。我已经在其他地方解释了recipy背后的故事,但总而言之:我在2015年协作工作坊Hack Day中创建了第一个版本(我的团队赢得了! ),然后我们在2015年EuroSciPy上进行了改进。 了解其工作原理的最佳方法是在2015年EuroSciPy上观看我的演讲视频

Anyway, recipy was the first time that anything I had created went ‘viral’ (well, in a relatively minor way!). There were a lot of tweets about it, and a good discussion on reddit, and this led to a lot of downloads, quite a few contributions, and even a Linux Journal article! Overall there have been over 200 commits, 7 merged PRs, 52 closed issues and 7 released versions – not bad for a module released only six months ago!

无论如何,食谱是我创造的任何东西第一次“病毒化”(嗯,以相对较小的方式!)。 关于它的推文很多,关于reddit的讨论很好,这导致了很多下载,很多贡献,甚至还有Linux Journal文章 ! 总体而言,已经有200多个提交,7个合并的PR,52个已关闭的问题和7个发行版本–对于仅六个月前发行的模块来说还不错!

Downloads in the last month: ~8800

上个月下载量: 〜8800

vanhozone (vanHOzone)

I’ve already written a post about my implementation of the van Heuklon Ozone model – and this year I turned it into a proper package and released it on PyPI. Basically, I just got fed up with having to install it from git on new machines, as a lot of my scientific code requires it! It’s not particularly impressive – but it is useful to get a simple (computationally efficient) estimation of atmospheric ozone concentrations.

我已经写了一个帖子对我实施面包车Heuklon臭氧模式-今年我把它变成一个合适的包,并将其发布PyPI上。 基本上,我只是受够了从git在新计算机上安装它,因为我的许多科学代码都需要它! 并不是特别令人印象深刻,但是对大气臭氧浓度进行简单(计算有效)的估算很有用。

The only real change that I did this year was to make a conda package for it – see my previous post for details.

我今年所做的唯一真正的更改就是为此制作了一个conda程序包-有关详细信息,请参阅我以前的文章

Downloads in the last month: ~110

上个月下载量: 〜110

其他 (Others)

Two other modules of mine have been ticking along with no work done to them: PyProSAIL (an interface to the ProSAIL model of canopy reflectance) and bib2coins (a tool to convert from BibTeX to COINS metadata for inclusion on webpages). Whenever I’ve used them they’ve worked fine for me – and I assume that either no-one else is using them, or that everything is working fine for them too (probably the former!).

我的其他两个模块没有做任何改动PyProSAIL (树冠反射率ProSAIL模型的接口)和bib2coins (将BibTeX转换为COINS元数据以包含在网页上的工具)。 每当我使用它们时,它们对我来说都工作得很好–并且我假设要么没有人在使用它们,要么一切对它们也都很好(可能是前者!)。

Downloads in the last month: ~260 and ~100 respectively

上个月的下载量:分别为〜260和〜100

会议活动 (Conferences)

For the first time this year I attended a conference designed entirely for programmers (all the conferences I’ve attended before have been for academics)…and it was great! I really enjoyed myself at EuroSciPy 2015: lots of the talks were interesting, my talk seemed to go down well (I won one of the Best Talk awards!), I managed to contribute usefully during the sprints, I met loads of interesting people…and even took my wife with me and introduced her to the Python programming community (you can see us both in the photo below). She was very proud to contribute a couple of PRs to the scikit-image project.

我今年第一次参加了专门为程序员设计的会议(我以前参加过的所有会议都是针对学者的)……真是太好了! 我在2015年EuroSciPy上真的很开心:很多演讲都很有趣, 我的演讲似乎进展顺利(我赢得了最佳演讲奖之一!),我在冲刺期间做出了有益的贡献,遇到了很多有趣的人……甚至带着我的妻子一起把她介绍给Python编程社区(在下面的照片中可以看到我们俩)。 她为为scikit-image项目贡献了一些PR感到非常自豪。

CNg3PuJWgAAj0Qq

My wife and I at the EuroSciPy skimage sprint (photo by Juan Nunez-Iglesias)

我和我的妻子参加了EuroSciPy skimage冲刺比赛(Juan Nunez-Iglesias摄影)

我(终于)开始使用的东西… (Things I’ve (finally) started using…)

This year I have finally started doing various things that I should have been doing for many years. A non-exhaustive list includes:

今年,我终于开始做我应该已经做很多年的事情。 非详尽清单包括:

  • I’m now using Python 3 by default (hooray!). I can blame one of my colleagues in the Flowminder team for this – he insisted that we should write our code for mobile phone data analysis in Python 3 (not even trying to support Python 2) and I agreed, and now haven’t looked back! I’m now trying to ensure that as much of my code as possible (and definitely all of my code released to PyPI) supports Python 3…and I always start with Python 3 by default. The only code that I haven’t yet moved to Python 3 is the main algorithm I developed during my PhD…not because it can’t be converted, but just because I’ve got more important things to do to the code at the moment, and as I’m the only person using it (at the moment…) it isn’t a major problem.
  • I’m writing code that conforms to PEP8…at long last! I was doing quite a lot of the ‘really stupidly obvious’ bits of PEP8 anyway, but I’m now trying to stick very closely to PEP8, and it has made a noticeable difference in terms of the readability of my code. I have chosen to ignore a few bits of PEP8 (such as the 80 character line length, which I find is too short by the time you’ve had a couple of levels of indentation), but overall I like it. I use the flake8 tool to check this, and the linter and linter-flake8 packages for Atom to automatically check it while I’m coding. I must admit that most of this is my wife’s ‘fault’, as she was introduced to PEP8 as a non-negotiable requirement for submitting PRs to skimage while she was at EuroSciPy, and never considered that there was another way to write Python code (I sometimes wondered if she thought Python would raise a NotPEP8Compliant exception if she didn’t use PEP8!), and so – like a lot of good things – I picked it up from her.
  • I’ve written a lot of Python code this year, and for the first time a lot of this code has been written in a team – so I’ve learnt a lot about how to write maintainable, understandable code – and what problems will come back and bite me later and should really be sorted at the beginning.
  • I’ve started blogging a lot more, and some of my blog posts have actually become quite popular (particularly my post about my favourite 5 ‘new’ Python packages). I’ve also started a series called Previously Unpublicised Code, in which I talk about various pieces of code that I’ve put on Github over the years but have never really publicised or talked about at all. This has forced me to tidy up a lot of my code on Github – and I’ve made it a rule that I won’t post about any code unless it has a README, a LICENSE, and is mostly PEP8-compliant.
  • 我现在默认使用Python 3(万岁!)。 我可以为此怪罪于Flowminder团队的一位同事–他坚持我们应该使用Python 3(甚至不试图支持Python 2)编写用于手机数据分析的代码,我同意了,现在没有回头! 我现在正在尝试确保我的尽可能多的代码(以及肯定是我发布到PyPI的所有代码)都支持Python 3…并且我始终默认使用Python 3。 我尚未转移到Python 3的唯一代码是我在博士期间开发的主要算法……不是因为它无法转换,而是因为目前我对代码有更多重要的事情要做,因为我是目前唯一使用它的人,所以这不是主要问题。
  • 我正在编写符合PEP8的代码……终于! 无论如何,我在PEP8上做了很多“非常愚蠢”的工作,但是我现在正试图与PEP8保持紧密联系,并且在代码的可读性方面有明显的不同。 我选择忽略一些PEP8(例如80个字符的行长,在您有几个缩进级别时,我发现它太短了),但总体而言,我喜欢它。 我使用flake8工具对此进行检查,并且使用Atom 的linterlinter-flake8软件包在编码时自动对其进行检查。 我必须承认,这大部分是我妻子的“过失”,因为她被介绍给PEP8是在她进入EuroSciPy时向skimage提交PR的不可商议的要求,并且从未考虑过有另一种编写Python代码的方式(有时我想知道她是否认为如果不使用PEP8,Python会引发NotNotPP8Compliant异常!),所以-就像很多好东西一样-我从她那儿捡来的。
  • 我今年写了很多Python代码,并且第一次将很多代码编写在一个团队中-因此我学到了很多有关如何编写可维护,可理解的代码的知识-以及将会出现什么问题返回并稍后咬我,应该在开始时进行排序。
  • 我已经开始写博客了,并且我的一些博客帖子实际上已经变得非常流行(特别是关于我最喜欢的5个“新” Python软件包的帖子 )。 我还开始了一个名为“ 以前未被公开的代码”的系列,其中讨论了我多年来在Github上编写的各种代码,但从未真正公开或谈论过。 这迫使我在Github上整理了很多代码–我已经制定了一条规则,除非有README,LICENSE且大部分都符合PEP8规范,否则我不会发布任何代码。

翻译自: https://www.pybloggers.com/2015/12/my-2015-python-life/

vs2015python

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值