Archive for Python

Language Lessons

Posted in History, Maynooth with tags , , , , , , , , , , on February 4, 2021 by telescoper

Thursday is Computational Physics Day this term so this morning I delivered the first Panopto lecture of that module and in the afternoon we had our first laboratory session. The students are all at home of course so we had to run the lab with them using their own laptops rather than the dedicated Linux cluster we have in the Department and interacting via Microsoft Teams.  The first lab is very introductory so it was really just me presenting and them following on their machines without too much interaction. The ability to share a screen is actually very useful though and I imagine using it quite a lot to share Spyder. It went fairly well, I think, with all the students getting started out on the business of learning Python.

In between lecturing the morning and running the laboratory session this afternoon I had the chance to study another kind of language. Soon after I first arrived in Maynooth I got an email from Maynooth University about Irish language classes. Feeling a bit ashamed about not having learned Welsh in all my time in Cardiff, I thought I’d sign up for the Beginners class and fill in a Doodle Poll to help the organizers schedule it. Unfortunately, when the result was announced  it was at a time that I couldn’t make owing to teaching, so I couldn’t do it. That  happened a couple of times, in fact. This year however I’ve managed to register at a time I can make, though obviously the sessions are online.

I’m not sure how wise it is for me to try learning a new language during a term as busy as this, but I have to say I enjoyed the first session enormously. It was all very introductory, but I’ve learnt a few things about pronunciation – unsurprisingly the Irish word for pronunciation fuaimniú is unsurprisingly quite difficult to pronounce – and the difference between slender and broad vowels. I also learnt that to construct a verbal noun, instead of putting -ing on the end as you would in English, in Irish you use the word ag in front of the verb.

That’s not to say I had no problems. I’m still not sure I can say  Dia duit (hello) properly. The second “d” is hardly pronounced. 

Irish isn’t much like Welsh, which I failed to learn previously.  Although Irish and Welsh are both Celtic languages they are from two distinct groups: the Goidelic group that comprises Irish, Manx and Scottish Gaelic; and the Brythonic group that comprises Welsh, Cornish and Breton. These are sometimes referred to as q-Celtic and p-Celtic, respectively, although not everyone agrees that is a useful categorization. Incidentally, Scottish Gaelic is not the language spoken by the Celtic people who lived in Scotland at the time of the Romans, the Picts, which is lost. Scottish Gaelic is actually descended from Middle Irish. Also incidentally, Breton was taken to Brittany by a mass migration of people from South-West Britain fleeing the Anglo-Saxons which peaked somewhere around 500 AD. I guess that was the first Brexodus.

Welsh and Irish don’t sound at all similar to me, which is not surprising really. It is thought that the Brythonic languages evolved from a language  brought to Britain by people from somewhere in Gaul (probably Northern France), whereas the people whose language led to the Goidelic tongues were probably from somewhere in the Iberia (modern-day Spain or Portugal). The modern versions of Irish and Welsh do contain words borrowed from Latin, French and English so there are similarities there too.

Only a diacritic mark appears in Irish, the síneadh fada (`long accent’), sometimes called the fada for short, which looks the same as the acute accent in, e.g., French. There’s actually one in síneadh if you look hard enough. It just means the vowel is pronounced long (i.e. the first syllable of síneadh is pronounced SHEEN). The word sean (meaning old) is pronounced like “shan” whereas Seán the name is pronounced “Shawn”.

One does find quite a few texts (especially online) where the fada is carelessly omitted, but it really is quite important. For example Cáca is the Irish word for `cake’, while the unaccented Caca means `excrement’…

I took the above text in Irish and English from the front cover of an old examination paper. You can see the accents as well as another feature of Irish which is slightly similar to Welsh, the mysterious lower-case h in front of Éireann. This is a consequence of an initial mutation, in which the initial character of word changes in various situations according to syntax or morphology (i.e. following certain words changing the case of a noun or following certain sounds). This specific case is an an example of h-prothesis (of an initial vowel).

In Welsh, mutations involve the substitution of one character for another. For example, `Wales’ is Cymru but if you cross the border into Wales you may see a sign saying Croeso i Gymru, the `C’ having mutated. The Irish language is a bit friendlier to the learner than Welsh, however, as the mutated character (h in the example above) is inserted in front of the unmutated character. Seeing both the mutated and unmutated character helps a person with limited vocabulary (such as myself) figure out what’s going on.

Mutations of consonants also occur in Irish. These can involve lenition (literally `weakening’, also known as aspiration) or eclipsis (nasalisation). In the case of eclipsis the unmutated consonant is preceded by another denoting the actual sound, e.g. b becomes m in terms of pronunciation, but what is written is mb. On the other hand, lenition is denoted by an following the unmutated consonant. In older forms of Irish the overdot (ponc séimhithe) -another diacritic – was used to denote lenition.

Anyway, I’ve seen Dia duit written Dia dhuit which might explain why the d sounds so weak. We live and learn. If I keep at it long enough I might eventually be able to understand the TG4 commentary on the hurling..

The Start of Spring Semester

Posted in Biographical, Education, Maynooth with tags , , , , , , , on February 1, 2021 by telescoper

It’s February 1st 2021, which means that today is Imbolc, a Gaelic festival marking the point halfway between the winter solstice and vernal equinox, i.e. it’s a Cross-Quarter Day. To be pedantic, Imbolc is actually the period between this evening and tomorrow evening as in the Celtic calendar days were counted from sunset to sunset.

The first Day of February is also the Feast day of St Brigid of Kildare (c. 451-525), one of Ireland’s patron saints along with Saints Patrick and Colm Cille. One of her miraculous powers was the ability to change water into ale, which perhaps explains her enduring popularity among the Irish.

In Ireland this day is sometimes regarded as the first day of spring, as it is roughly the time when the first spring lambs are born. It corresponds to the Welsh Gŵyl Fair y Canhwyllau and is also known as the `Cross Quarter Day’ or (my favourite) `The Quickening of the Year’. According to legend it is also the day on which jackdaws mate. Given how many of them there are around Maynooth there should be a lot of action today.

Today is, appropriately enough in the light of all this, the start of the Spring Semester of teaching at Maynooth University, the fourth Spring Semester I will have experienced here although this is obviously not like the others in that we’ll be teaching online at least for the first half and probably for the entirety. I was planning to stay at home today but I realised I’d left some things I need in the office on campus so will have to go to collect them. That’s why I’m up early. That and the need to shake myself out of the lockdown torpor that has afflicted me since New Year. It’s time to get my act together, pull my finger out, put my best foot forward, etc.

This Semester I am teaching Engineering Mathematics II, Computational Physics I and Advanced Electromagnetism. The former, what you would probably call a `service course’, covers a mixture of things, mainly Linear Algebra but with some other bits thrown in for fun, such as Laplace transforms. Interestingly I find the Mathematical Physics students do not encounter Laplace Transforms in the first year, but perhaps engineers use them more often than physicists do? I think I’ve written only one paper that made use of a Laplace transform. Anyway, I have to start with this topic as the students need some knowledge of it for some other module they’re taking this semester. I reckon six lectures will be enough to give them what they need. That’s two weeks of lectures, there being three lectures a week for this module.

Once again my teaching timetable for this module is quite nice. I have lectures on Monday, Tuesday and Wednesday and then the students have a choice of tutorial (on either Thursday or Friday). That means I can get through a decent amount of material each week before each tutorial. I don’t do the tutorials, by the way: that’s left to one of our PhD students, who gets paid for doing that and correcting the weekly coursework. There are about 50 students on this module, divided into two courses: Electronic Engineering and Robotics and Intelligent Devices. We don’t have Civil or Mechanical or Chemical Engineering, etc, at Maynooth, in case you were wondering. Lectures will be done as webcasts using Panopto but also recorded for later viewing.

My first Computational Physics lecture, which I will do from home, is on Thursday, after which there is a lab session which we will do via Microsoft Teams. That’s the way we did it after lockdown last year and it worked OK. Students attend one two-hour lab session in addition to the lecture, on either Thursday or Tuesday. The first lecture being on Thursday the first lab session will be Thursday afternoon, with the same material being covered the following Tuesday. Fortunately, Python is free to download and easy to install so it’s quite straightforward to run the labs remotely. Teams has a screen sharing facility so it’s quite easy for myself or my demonstrator to see what is wrong in the same way we would do in a laboratory class.

The Advanced Electromagnetism module is a new one for me but I’m quite looking forward to it. Being a final-year module its content is less prescriptive than others and I’ll be adding a few things that I find interesting. Both lectures for that one are on Wednesdays and again will be given as webcasts with recordings available later.

Today is a particularly busy day because in addition to my first lecture (at 2pm) I have a meeting of Academic Council (3pm via Teams), a Euclid telecon (via Zoom) and a meeting with my PhD student via Teams. I have also been trying to sort out tutors and tutorials for the forthcoming Semester: these don’t start until next week so there’s time, but it has been quite a challenge to get everyone sorted. Fortunately I think that’s now done.

Oh, and another thing. I signed up for Irish language lessons (Beginners Level) and will be having classes once a week from now on.

It’s going to be a very busy term but I reckon being busy is probably going to be a good way to get through the next few months.

Spring Semester Starts

Posted in Biographical, Education, Maynooth with tags , , , , , , on February 3, 2020 by telescoper

It’s February 3rd 2020, which means that today is two days after Imbolc, a Gaelic festival marking the point halfway between the winter solstice and vernal equinox. The 1st Day of February is also the Feast day of St Brigid of Kildare (c. 451-525), one of Ireland’s patron saints along with Saints Patrick and Colm Cille. One of her miraculous powers was the ability to change water into ale, which perhaps explains her enduring popularity among the Irish.

In Ireland this day is sometimes regarded as the first day of spring, as it is roughly the time when the first spring lambs are born. It corresponds to the Welsh Gŵyl Fair y Canhwyllau and is also known as the `Cross Quarter Day’ or (my favourite) `The Quickening of the Year’.

Today is, appropriately enough in the light of all this, the start of the Spring Semester of teaching at Maynooth University, the third Spring Semester I will have experienced here. The weather has even played along; it has definitely been spring-like. The Campus, whicgh has beenhas been very quiet for the last week or so since the examinations finished, is full of students again.

This Semester, as was the case last year, I am teaching Engineering Mathematics II and Computational Physics I. The former, what you would probably call a `service course’, covers a mixture of things, mainly Linear Algebra but with some other bits thrown in for fun, such as Laplace transforms. Interestingly I find the Mathematical Physics students do not encounter Laplace Transforms in the first year, but perhaps engineers use them more often than physicists do? I think I’ve written only one paper that made use of a Laplace transform. Anyway, I have to start with this topic as the students need some knowledge of it for some other module they’re taking this semester. I reckon six lectures will be enough to give them what they need. That’s two weeks of lectures, there being three lectures a week for this module.

Once again my teaching timetable for this module is quite nice. I have lectures on Monday, Tuesday and Wednesday and then the students have a choice of tutorial (on either Thursday or Friday). That means I can get through a decent amount of material each week before each tutorial. I don’t do the tutorials, by the way: that’s left to one of our PhD students, who gets paid for doing that and correcting the weekly coursework. There are about 50 students on this module, divided into two courses: Electronic Engineering and Robotics and Intelligent Devices. We don’t have Civil or Mechanical or Chemical Engineering, etc at Maynooth, in case you were wondering.

Anyway, my first lecture was this afternoon at 2pm and had a good turnout. It was so sunny outside that we had to close all the blinds. That’s quite an unusual event for a February lecture!

My first Computational Physics lecture is on Thursday, after which it will be back to the Department for some frantic behind-the-scenes activity ahead of the afternoon lab session, which is in a computer room near my office. Students attend one two-hour lab session in addition to the lecture, on either Thursday or Tuesday. The first lecture being on Thursday the first lab session will be Thursday afternoon, with the same material being covered the following Tuesday.

While my teaching duties are the same this year as they were in the corresponding semester last year, there is a significant difference this year in that I am now also Head of Department. Either side of my first lecture I had to attend a meeting of the Faculty Executive for Science & Engineering, a meeting on `Project LEGO’ (which, sadly, did not involve any actual Lego but was instead about the proposed redesign of the University’s website) and a meeting of Academic Council. I have also been trying to sort out tutors and tutorials for the forthcoming Semester: these don’t start until next week so there’s time, but it’s quite a challenge to get everyone sorted out. A few timetable clashes have also come to light. So, in summary, I’m a bit worn out after today and will shortly go home to vegetate.

At least I didn’t have to find time for the regular Monday afternoon Euclid telecon in which I usually participate. There wasn’t one today because the working group of which I am part is actually meeting in person for a few days… in Paris! I couldn’t go because of all the above!

Most Popular Programming Languages 1965-2019

Posted in The Universe and Stuff with tags , , , on October 21, 2019 by telescoper

I find this absolutely fascinating. I’ve programmed in Fortran, Pascal, Basic, Assembler, C, C++, Javascript and Python lived long enough to see quite the fashion for most of these languages come and go on a relatively short timescale. Perhaps it provides a salutary lesson for those who think their current Python codes will always be useful?

Ahead of Teaching

Posted in Biographical, Education, mathematics, Maynooth, Music with tags , , , , on February 3, 2019 by telescoper

It’s 3rd February 2019, which means that today is two days after Imbolc, a Gaelic festival marking the point halfway between the winter solstice and vernal equinox. This either happens 1st or 2nd February, and this year it was former, i.e. last Friday In Ireland this day is sometimes regarded as the first day of spring, as it is roughly the time when the first spring lambs are born. It corresponds to the Welsh Gŵyl Fair y Canhwyllau and is also known as the `Cross Quarter Day’ or (my favourite) `The Quickening of the Year’.

I wrote a post about this time last year, on the day I gave my first ever lecture in Maynooth University, on Computational Physics, in a theatre called Physics Hall. That was on Thursday February 1st 2018. It’s hard to believe that was a full year ago. Time certainly has gone quickly this year.

Owing to the vagaries of the academic calendar we’re a week later getting back to teaching this year than last year so my first Computational Physics lecture won’t be until this Thursday (7th February) at 9am, but sadly it won’t be in Physics Hall, which I rather liked, but in Hall C – a much less atmospheric venue, but one rather closer to my office, which will be handy if I forget anything (which I am prone to do). There are about 25 students taking this module, a few down on last year, which means they should fit comfortably into our computer lab. I’m not surprised they moved the lecture, really. The capacity of Physics Hall is 90, and even last year I only had about 30 students. Still, it did have a piano (which Hall C does not):

Computational Physics doesn’t start until Thursday. Before that I have to start my other module: Engineering Mathematics II. This (what you would probably call a `service course’) covers a mixture of things, mainly Linear Algebra but with some other bits thrown in for fun, such as Laplace transforms. Interestingly I find the Mathematical Physics students do not encounter Laplace Transforms in the first year, but perhaps engineers use them more often than physicists do? I think I’ve written only one paper that made use of a Laplace transform. Anyway, I have to start with this topic as the students need some knowledge of it for some other module they’re taking this semester. I reckon six lectures will be enough to give them what they need. That’s two weeks of lectures, there being three lectures a week for this module.

By coincidence rather than good planning, the timetable for this module is quite nice. I have lectures on Monday, Tuesday and Wednesday and then the students have a choice of tutorial (on either Thursday or Friday). That means I can get through a decent amount of material each week before each tutorial. I don’t do the tutorials, by the way: that’s left to one of our PhD students, who gets paid for doing that and correcting the weekly coursework. There are about 50 students on this module, divided into two courses: Electronic Engineering and Robotics and Intelligent Devices. We don’t have Civil or Mechanical or Chemical Engineering, etc at Maynooth.

Campus has been very quiet for the last week or so. The exam period finished in late January but lectures don’t start until tomorrow morning (Monday 4th February) so there have been few students around. No doubt it will be a different story tomorrow. I’ve done my first week’s notes and compiled my first problem set so I’m more-or-less ready to go. First lecture at 2pm tomorrow in Hall H, which is one of the rooms I taught in last term so at least I know where it is!

 

25 Years of Python!

Posted in History with tags , , on February 1, 2019 by telescoper

Not a lot of people know* that it is 25 years to the day since Guido van Rossum announced the release of Python 1.0.0:

The latest version of Python is 3.7.2.

It’s not quite correct to say that Python is 25 years old today, though. There were versions available before the official Version 1. For a full history see here.

*H/T to Tom Crick, whose tweet alerted me to this.

Other People’s Code

Posted in Education, mathematics with tags , , , on March 16, 2018 by telescoper

I don’t know if this is just me being useless, but one of the things I’ve always found difficult is debugging or rewriting computer programs written by other people. This is not a complaint about people who fail to document their code sufficiently to see what’s going on, it’s that even when the code is documented it seems much more difficult to spot errors in code written by other people than it is when you’ve written the program yourself.

I’ve been thinking a lot since I’ve been teaching Computational Physics here in Maynooth University. One of the standard elements of the assessment for this module is a task wherein the students are given a Python script intended to perform a given task (e.g. a numerical integral) but which contains a number of errors and asked to identify and correct the errors. This is actually a pretty tough challenge, though it is likely to be one that a graduate might have to meet if they get a job in any environment that involves programming.

Another context in which this arises is our twice-weekly computing laboratory sessions. Twice in the last couple of weeks I’ve been asked for a bit of help by students with code that wasn’t working, only to stare at the offending script for ages and fiddling with a number of things that made no difference, without seeing what turned out to be an obvious mistake. Last week it was an incorrect indent in Python (always a hazard if you’ve been brought up on Fortran). This week it was even simpler, a sign error in a line that was just supposed to calculate the mid-point of an interval. I should have been able to spot these very quickly, but I couldn’t.

What makes this so difficult? When given a mathematical calculation to mark I can usually spot errors reasonably easily (unless the working is illegible), but with code it’s different (at least for me). If I’d been given it on a piece of paper as part of a formula, I reckon I would have spotted that minus sign almost immediately.

One possibility is just that I’m getting old. While that may well be true, it doesn’t explain why I found debugging other people’s code difficult even when I was working on software at British Gas when I was 18. In that context I quite often gave up trying to edit and correct software, and instead just deleted it all and wrote my own version from scratch. That’s fine if the task is quite small, but not practicable for large suites written by teams of programmers.

I think one problem is that other people rarely approach a programming task exactly the same way as one would oneself. I have written programs myself to do the tasks given to students in the computing lab, and I’m always conscious of the method I’ve used. That may make it harder to follow what others have tried to do. Perhaps I’d be better off not prejudicing my mind doing the exercises myself?

Anyway, I’d be interested to know if anyone else has the same with other people’s code and if they have any tips that might improve my ability to deal with it. The comments box is at your disposal…

Learning Technology

Posted in Biographical, Cardiff, Education, Maynooth with tags , , , , , , , , on February 20, 2018 by telescoper

I’m just taking a tea break in the Data Innovation Research Institute. Today has been a very day as I have to finish off a lot of things by tomorrow, for reasons that I’ll make clear in my next post…

It struck me when I was putting on the brew how much more technology we use for teaching now than when I was a student. I think many of my colleagues make far more effective use of the available technology than I do, but I do my best to overcome my Luddite tendencies. Reflecting on today’s teaching makes me feel just a little less like a dinosaur.

This morning I gave a two-hour lecture on my Cardiff module Physics of the Early Universe which, as usual, I recorded using our Panopto system. Although there was a problem with some of the University’s central file storage this morning, which made me a bit nervous about whether the lecture recording would work, it did. Predictably I couldn’t access the network drives from the PC in the lecture theatre, but I had anticipated that and took everything I needed on a memory stick.

After a short break for lunch I checked the lecture recording and made it available for registered students via the Virtual Learning Environment (VLE), known to its friends as Learning Central. I use this as a sort of repository of stuff connected with the module: notes, list of textbooks, problem sets, model answers, instructions and, of course, recorded lectures. The students also submit their coursework assignment (an essay) through this system, through the plagiarism detection software Turnitin.

This afternoon the students on my Computational Physics course in Maynooth University had a lab test, the first of four such tests, this one consisting of a short coding exercise. There are two lab sessions per week for this class, one on Thursdays (when I am normally in Maynooth to help supervise) and another on Tuesdays (when I am normally in Cardiff). I have a number of exercises, which are similar in scope but different in detail (to prevent copying) and the Tuesday lab has a completely different set of exercises from the Thursday one. In each exercise the students have to write a simple Python script to plot graphs of a function and its derivative (computed numerically) using matplotlib. The students upload their script and pictures of the plot to the VLE used in Maynooth, which is called Moodle.

In the manner of a TV chef announcing `here’s one I did earlier’, this a sample output produced by my `model’ code:

I wonder if you can guess of what function this is the derivative? By the way in this context `model’ does not mean `a standard of excellence’ but `an imitation of something’ (me being an imitation of a computational physicist). Anyway, students will get marks for producing plots that look right, but also for presenting a nice (commented!) bit of code

This afternoon I’m on Cardiff time but I was able to keep an eye on the submissions coming in to Moodle in case something went wrong. It seemed to work out OK, but the main problem now is that I’ve got 20-odd bits of code to mark! That will have to wait until I’m properly on Maynooth time!

Now, back to the grind…

The Quickening of the Year

Posted in Education, Maynooth, Music, The Universe and Stuff with tags , , , , on February 1, 2018 by telescoper

It’s 1st February 2018, which means that today is Imbolc, a Gaelic festival marking the point halfway between the winter solstice and vernal equinox. This either happens 1st or 2nd February, and this year it is the former. In this part of the world – I’m in Ireland as I write- this day is sometimes regarded as the first day of spring, as it is roughly the time when the first spring lambs are born. It corresponds to the Welsh Gŵyl Fair y Canhwyllau and is also known as the `Cross Quarter Day’ or (my favourite) `The Quickening of the Year’.

So, talking of quickening, the pace of things is increasing for me now too. This morning at 9am I gave my first ever lecture in Maynooth University in a lecture theatre called Physics Hall, which is in the old (South) part of campus as opposed to the newer North Campus where the Science Building that contains my office is situated.

After that it was back to the Department for some frantic behind-the-scenes activity setting up accounts for the students for the afternoon lab session, which is in a computer room near to my office. Students attend one two-hour lab session in addition to the lecture, on either Thursday or Tuesday. The first lecture being this morning (Thursday) the first lab session was this afternoon, with the same material being covered next Tuesday.

I was far more nervous about this afternoon’s lab session than I was about this morning’s lecture as there seemed to be many things that could go wrong in getting the students up and running on our Linux cluster and getting them started on Python. Quite a few things did go wrong, in fact, but they were fewer in number and less drastic in outcome that I had feared.

So there we are, my first full day teaching in Maynooth. I think it went reasonably well and it was certainly nice to meet my first group of Maynooth students who, being physics students, are definitely la crème de la crème. I’ve got another 6 weeks like this (teaching on Tuesday in Cardiff and on Thursday in Maynooth) before the Easter break so it’s going to be a hectic period. Just for tonight, however, I’ve got time to relax with a glass or several of wine.

Incidentally, I was impressed that Physics Hall (where I did this morning’s lecture) is equipped with an electric piano:

I wonder if anyone can suggest appropriate musical numbers to perform for a class of computational physicists? Suggestions are hereby invited via the Comments Box!

A Python Toolkit for Cosmology

Posted in The Universe and Stuff with tags , , , , on December 14, 2017 by telescoper

The programming language Python has established itself as the industry standard for researchers in physics and astronomy (as well as the many other fields, including most of those covered by the Data Innovation Research Institute which employs me part-time). It has also become the standard vehicle for teaching coding skills to undergraduates in many disciplines. In fact it looks like the first module I will be teaching in Maynooth next term is in Computational Physics, and that will be delivered using Python too. It’s been a while since I last did any significant hands-on programming, so this will provide me with a good refresher. The best way to learn something well is to have to teach it to others!

But I digress. This morning I noticed a paper by Benedikt Diemer on the arXiv with the title COLOSSUS: A python toolkit for cosmology, large-scale structure, and dark matter halos. Here is the abstract:

This paper introduces Colossus, a public, open-source python package for calculations related to cosmology, the large-scale structure of matter in the universe, and the properties of dark matter halos. The code is designed to be fast and easy to use, with a coherent, well-documented user interface. The cosmology module implements FLRW cosmologies including curvature, relativistic species, and different dark energy equations of state, and provides fast computations of the linear matter power spectrum, variance, and correlation function. The large-scale structure module is concerned with the properties of peaks in Gaussian random fields and halos in a statistical sense, including their peak height, peak curvature, halo bias, and mass function. The halo module deals with spherical overdensity radii and masses, density profiles, concentration, and the splashback radius. To facilitate the rapid exploration of these quantities, Colossus implements about 40 different fitting functions from the literature. I discuss the core routines in detail, with a particular emphasis on their accuracy. Colossus is available at bitbucket.org/bdiemer/colossus.

The software can be downloaded here. It looks a very useful package that includes code to calculate many of the bits and pieces used by cosmologists working on the theory of large-scale structure and galaxy evolution. It is also, I hope, an example of a trend towards greater use of open-source software, for which I congratulate the author! I think this is an important part of the campaign to create truly open science, as I blogged about here.

An important aspect of the way science works is that when a given individual or group publishes a result, it should be possible for others to reproduce it (or not, as the case may be). At present, this can’t always be done. In my own field of astrophysics/cosmology, for example, results in traditional scientific papers are often based on very complicated analyses of large data sets. This is increasingly the case in other fields too. A basic problem obviously arises when data are not made public. Fortunately in astrophysics these days researchers are pretty good at sharing their data, although this hasn’t always been the case.

However, even allowing open access to data doesn’t always solve the reproducibility problem. Often extensive numerical codes are needed to process the measurements and extract meaningful output. Without access to these pipeline codes it is impossible for a third party to check the path from input to output without writing their own version assuming that there is sufficient information to do that in the first place. That researchers should publish their software as well as their results is quite a controversial suggestion, but I think it’s the best practice for science. There isn’t a uniform policy in astrophysics and cosmology, but I sense that quite a few people out there agree with me. Cosmological numerical simulations, for example, can be performed by anyone with a sufficiently big computer using GADGET the source codes of which are freely available. Likewise, for CMB analysis, there is the excellent CAMB code, which can be downloaded at will; this is in a long tradition of openly available numerical codes, including CMBFAST and HealPix.

I suspect some researchers might be reluctant to share the codes they have written because they feel they won’t get sufficient credit for work done using them. I don’t think this is true, as researchers are generally very appreciative of such openness and publications describing the corresponding codes are generously cited. In any case I don’t think it’s appropriate to withhold such programs from the wider community, which prevents them being either scrutinized or extended as well as being used to further scientific research. In other words excessively proprietorial attitudes to data analysis software are detrimental to the spirit of open science.

Anyway, my views aren’t guaranteed to be representative of the community, so I’d like to ask for a quick show of hands via a poll…

…and you are of course welcome to comment via the usual box.