Dr Administrator

Author's posts

More news from the shed…

CWACResults2011

In the month of May I seem to find myself playing with maps and numbers.

To the uninvolved this may appear to be rather similar to my earlier “That’s nice dear”, however the technology involved here is quite different.

This post is about extracting the results from the local elections held on 5th May from the Cheshire West and Chester website and displaying them as a map. I could have manually transcribed the results from the website, this would probably be quicker, but where’s the fun in that?

The starting point for this exercise was noticing that the results pages have a little icon at the bottom saying “OpenElectionData”. This was part of an exercise to make local election results more easily machine-readable in order to build a database of results from across the country, somewhat surprisingly there is no public central record of local council election results. The technology used to provide machine access to the results is known as RDF (standing for Resource Description Framework), this is a way of providing “meaning” to web pages for machines to understand – this is related to the talk of the semantic web. The good folks at Southampton University have provided a browser which allows you to inspect the RDF contents of a webpage. I used this to get a human sight of the data I was trying to read.

RDF content ultimately amounts to triplets of information: “subject”,”predicate”,”object”. In the case of an election then one triplet has a subject of “specific ward identifier” the predicate is “a list of candidates” and the object is “candidate 1;candidate 2; candidate 3…”. Further triplets specify the whether a candidate was elected, how many votes they received and the party to which they belong.

I’ve taken to programming in Python recently, in particular using the Python(x,y) distribution which packages together an IDE with some libraries useful to scientists. This is the sort of thing I’d usually do with Matlab, but that costs (a lot) and I no longer have access to it at home.

There is a Python library for reading RDF data, called RDFlib, unfortunately most of the documentation is for version 2.4 and the working version which I downloaded is 3.0. Searching for documentation for the newer version normally leads to other sites where people are asking where the documentation is for version 3.0!

The base maps come from the Ordnance Survey, specifically the Boundary Line dataset which contains administrative boundary data for the UK in ESRI Shapefile format. This format is widely used for geographical information work, I found the PyShp library from GeospatialPython.com to be well-documented and straightforward way to read the format. The site also has some nice usage examples. I did look for a library to display the resulting maps but after a brief search I adapted the simple methods here for drawing maps using matlibplot.

The Ordnance Survey Open Data site is a treasure trove for programming cartophiles, along with maps of the UK of various types there’s a gazetteer of interesting places, topographic information and location data for UK postcode.

The map at the top of the page uses the traditional colour-coding of red for Labour and blue for Conservative, some wards elect multiple candidates and in those where the elected councillors are not all from the same party purple is used to show a Labour/Conservative combination and orange a Labour/Liberal Democrat combination.

In contrast to my earlier post on programming, the key elements here are the use of pre-existing libraries and data formats to achieve an end result. The RDF component of the exercise took quite a while, whilst the mapping part was the work of a couple of hours. This largely comes down to the quality of the documentation available. Python turns out to be a compact language to do this sort of work, it’s all done in 150 or so lines of code.

It would have been nice to have pointed my program to a single webpage and for it to find all the ward data from there, including the ward names, but I couldn’t work out how to do this – the program visits each ward in turn and I had to type in the ward names. The OpenElectionData site seemed to be a bit wobbly too, so I encoded party information into my program rather the pulling it from their site. Better fitting of the ward labels into the wards would have been nice too (although this is a hard problem). Obviously there’s a wide range of analysis that can be carried out on the underlying electoral data.

Footnotes

The python code to do this analysis is here. You will need to install the rdflib and PyShp libraries and download the OS Boundary Line data. I used the Python(x,y) distribution but I think it’s just the matlibplot library which is required. The CWac.py program extracts the results from the website and writes them to a CSV file, the Mapping.py program makes a map from them. You will need to adjust file paths to suit your installation.

“Progressive Alliance”

I keep hearing about the “Progressive Alliance”, and it never fails to irritate me. In the UK “progressive” is taken to mean “Everyone except the Tories and UKIP1”. Progressivism is defined (in wikipedia) as:

…a political attitude favouring or advocating changes or reform through governmental action. Progressivism is often viewed in opposition to conservative or reactionary ideologies.

This seems to me a definition sufficiently broad as to be largely useless, Tories could claim the progressive mantle through any legislation they care to enact and liberals could lose it through their opposition to authoritarian measures such as the ID card scheme, and for economic liberalisation.

The problem I’m having here is that Labour only start getting interested in “progressive alliances” when they’ve lost an election, whilst in power they ignore other progressive parties. Labour will only form a “progressive alliance” if they are electorally forced to do so, and otherwise seek Liberal Democrat annihilation.

Since the General Election there’s been a great deal of effort spent by Labour in trying to split the party into Good Liberal Democrats (Social Democrats, who they wish to absorb) and Bad Liberal Democrats (Orange Bookers, who they think the Tories should absorb). The “progressive alliance” is part of this – we should not be playing to this narrative. The truth is that Labour and Tory only get into government when they’ve convinced the electorate that they are close enough to the Liberal Democrat centre ground so as not to be scary.

Ed Miliband can frequently be found “reaching out” to Liberal Democrats but this reaching out is solely about recruitment to the Labour Party and the planned extinction of the Liberal Democrats. I’m a pluralist, as such I value the existence of other political parties – but I see little sign of this respect for the existence of others in the Labour Party.

In opposition their key strategy has been to attack the Liberal Democrats and their policies, rather than the Tories, who they claim lead the Coalition. Labour consistently opposed the passing of the AV referendum bill. Indeed they spent more energy opposing the AV referendum bill than any other government measure2. Their campaign for the Yes vote was fatally flawed in that it was largely seen as a platform to attack Nick Clegg and the Liberal Democrats: every outing of “Labour Yes” involved a ritual statement of how venial the Liberal Democrats were and, if Ed Miliband was involved, a discussion as to why he would not share a platform with Nick Clegg. It looks like Labour are summing themselves up to oppose Lords’ reform as well – both this, and the AV campaign, are “progressive” goals.

There are a number of Liberal Democrats who are keen on the “progressive alliance”, and since I’m an open-minded sort of chap I’m assuming they’re not deranged, but can you tell me – why are you engaged in this? I don’t rule out discussions between our parties but those engaged in such discussion need to be clear what the benefit to us is, because at the moment all we’re getting is another forum in which Labour can abuse us and attempt to divide us3.

Footnotes

  1. Technically I should probably put the BNP in here but they’re not a serious political party.
  2. At this point Labour normally complain that the bill also contained “gerrymandering” measures regarding the work of the Boundary Commission. However, the current system gives them a 90 seat advantage for parity of votes with the Tories, so it’s substantially “gerrymandered” in Labours favour already. The chances are that boundary fiddling will do little to address this and really the only solution to such problems is to go for some form of proportional representation, neither of the two main parties has the honesty to recognise this.
  3. None of this is to say that the Tories are not trying to destroy us as well!

Post-election Reflection 2011

A year into the Coalition and in the aftermath of some rather poor electoral results for the Liberal Democrats I thought I should write down some thoughts from the perspective of a Liberal Democrat of 20 years.

On May 5th the LibDems lost nearly 700 local councillors from an original population of 1751 and 9 of 19 councils, 12 of 17 seats were lost in the Scottish parliament and there was an emphatic “No to AV” in the referendum. At a personal level, I was involved in the campaign for the Cheshire West and Cheshire council, where ultimately we polled 12% of the votes and got 1.3% of the seats. This is a reduction from 4 seats to 1, although in a reconfigured council.

Why did this happen?

The LibDems were in a relatively good position based on the last occasion these council seats were contested, having steadily picked up seats from Labour through the years of Labour government 1997-2010, in particular from 2001 onwards. Our previous standing reflected a popular vote of around 23%, currently our opinion poll standings are around 15%.

In this sense it should not be seen as “electorate punishing LibDems for coalition” rather “former Labour supporters returning to Labour now it’s out of power”, similarly talk of LibDems being human shields for the Tories is not a particularly useful analysis. Tories and LibDems have different electorates, the Tory electorate is clearly happy with the Coalition, the LibDem electorate less so. Looking at the overall results with the Tories on 38% of the vote, Labour on 37% and LibDems 17%, we’re actually above the top end of our current opinion poll ratings with a share of the vote between our 1997 and 2001 general election result.

Also popular in the news is the idea that Nick Clegg must go as leader of the Liberal Democrats, if you rummage around amongst several hundred rather bruised (ex-)local councillors you are bound to find a few who’ll agree with this but it is idiocy for several reasons:

  • Nick Clegg got strong party backing for going into the Coalition from MPs, the federal executive and a special conference. We all stand with Nick, the idea that he has led the party off at the head of an Orange Book clique is a fantasy built by Labour, familiar with this type of internal schism.
  • Our drop in the opinion polls was pretty much inevitable as soon as the Coalition agreement was signed, regardless of anything any leader could have done: we dropped 2 points from the 23% showing at the election almost immediately, and then by mid-late summer were down to 18% even before the tuition fees issue had really hit.
  • A new leader at this point would continue to take the blame for simply being in coalition and leave us in no better position at the next general election.

The no to AV result was a disappointment, not because of the rejection of AV itself but because it likely rules out electoral reform for years to come. I thought Nick Clegg struck the best note on this, close to the end of the campaign when he said this was just a small change. I found Ed Miliband’s refusal to share a platform with Nick Clegg in support of the Yes campaign deeply unhelpful, listening to him try to justify this having just explained to John Humphries how AV forced politicians to reach out to other parties was entertaining; as was his jaw-dropping hypocrisy in justifying Labour’s failure to implement AV in 13 years of government as being because they’d won a 170 seat majority under first-past-the-post – remember this when he bleats about the “progressive majority”.

I note that over on ConHome the Tories are trying to claim that Labour made them make Nick Clegg the target for the No campaign. This seems to me a rather spineless statement – they funded the No to AV campaign, they could have called the shots. They should realise how massively they have pissed off a large chunk of pro-Coalition LibDems, and that there will be consequences for this. Going forward we should be looking at each item we have on the Coalition Agreement and asking ourselves: can we trust the Tories to support implementation of this? If the answer is “no” then we should be looking to bargain with something in the coalition agreement that they hold dear and not let it pass until our target has been achieved.

Obviously another election brings another crude pass at Liberal Democrat ministers by Ed Miliband, like a creepy uncle at a wedding party. This is entirely for his own supporters and has nothing to do with the Liberal Democrats, as Ed has said before – he seeks our extinction. We should all bear this in mind when he talks about “progressive alliances”.

I don’t see the point in believing that we can now go to the Tories for concessions because we have lost some elections, it seems needy and unnecessary to me. Similarly I don’t see much mileage in fiddling around with the infantile “getting into bed with” and “marriage” metaphors. Vince Cable and Chris Huhne have prototyped the “cooperating but sulkily” look and, to be frank, it is unedifying.

Liberal Democrats have succeeded in getting policy implemented over the past year in Coalition: in getting the income tax threshold raised, in linking pensions to earnings, in providing some protection to the poorest students through the Pupil Premium, in reducing the 28 days detention without charge to 14 days, in reducing dramatically, (if not entirely eliminating) child detention for failed immigration claimants. There is some interesting analysis by the University of Essex on how much of the Liberal Democrat manifesto got into the Coalition agreement. If you want to see a more detailed comparison here is a document on the Guardian Datablog which analyses, in detail the Coalition agreement. Or there is a document produced by the Party here.

Now is a bloody awful time to be in government, there is no money to spend on cherished schemes, rather an absolute need to cut pretty much the largest deficit in the world, left behind by a Labour government desperately trying to spend it’s way to salvation but we’re getting on and doing it. It’s worth remembering that at this point Labour would have been making 7/8ths of the cuts currently being made by the Coalition (under the Darling plan) – difficult to believe given their current statements.

Despite all of this, it is still the best time it has ever been to be a Liberal Democrat since I joined the party in 1991.

Lavoisier: Chemist, Biologist, Economist by Jean-Pierre Poirier

Lavoisier

Recently I read Vivian Grey’s biography of Lavoisier. Although a fine book, it left me wanting more Lavoisier, so I turned to Jean-Pierre Poirier’s more substantial biography: “Lavoisier: Chemist, Biologist, Economist”. Related is my blog post on the French Académie des Sciences, of which Lavoisier was a long term member, and senior, member.

This is a much longer, denser book than that of Grey, with commonality of subject it’s unsurprising that the areas covered are similar. However, Poirier spends relatively more time discussing Lavoisier’s activities as a senior civil servant and as an economist.

The striking thing is the collection of roles that Lavoisier had: senior member of Ferme Générale (commissioned Paris wall), director of the Académie, director of the Gunpowder and Saltpeter Administration, owner and manager of his own (agricultural) farms. It’s difficult to imagine a modern equivalent, the governor of the Bank of England running a research lab? Or perhaps an MP with a minor ministerial post, running a business and a research lab? In practical terms he did experimental work for a few hours each morning and evening (6-9am, 7-10pm) and on Saturdays – having a number of assistants working with him.

Lavoisier was wealthy, inheriting $1.8million* from relatives as an 11 year old he joined the Ferme Générale with an initial downpayment of about $3million. However, this provided an income of something like $2.4-4.8 million a year. On a trip to Strasbourg as a 24 year old, he spent $20,000 on books – which you have to respect. As the collector of taxes levied on the majority but not the nobility or clergy, the Ferme Générale was one of the institutions in the firing line when the Revolution came. Wealthy financiers, such as Lavoisier, bought stakes in these private companies, provided exclusive rights by the King, and made enormous rates of return (15-20%), at the same time serving the Kings needs rather poorly.

As for his activities in chemistry, Poirier provides a a good background to the developments going on at the time. Beyond what I have read before, it’s clear that Lavoisier does not make any of the first discoveries of for example, oxygen, carbon dioxide or nitrogen, nor of the understanding that combustion results in weight gain. But what he does do is build a coherent theory that brings all of these things together and overthrows the phlogiston theory of combustion. With Guyton de Morveau he develops a new, systematic, way of naming chemicals which is still used today and, as a side effect, embeds his ideas about combustion. It’s from this work that the first list of elements is produced. Furthermore, Lavoisier sees the applications of the idea of oxidation in explaining “chemical combustion” as entirely appropriate for understanding “biological combustion” or respiration. In a sense he sets the scheme for biochemistry which does not come to life for nearly 100 years, for want of better experimental methodology.

It’s interesting that gases are arguably the most difficult materials to work with yet it is their study, in particular understanding the components of air, which leads to an understanding of elements, and the “new chemistry”. Perhaps this is because gases are their own abstraction, there is nothing to see only things to measure.

The book also gives a useful insight into the French Revolution for someone who would not read the history for its own sake. The heart of the Revolution was a taxation system that exempted the nobility and the clergy from paying anything, and a large state debt from supporting the American War of Independence. Spending appears to have been decided by the nobility, or even just the King, with little regard as to how the money was raised. At one point Paris considered an aqueduct to bring in fresh water to all its citizens, but then decided that rebuilding the opera house was more important! The Revolution was a rather more drawn out than I appreciated with Lavoisier at the heart of the ongoing transformation at the time of his execution during the Terror, only to be lauded once again a couple of years later as Robbespierre fell from power and was executed in his turn.

On economics: Lavoisier was one of the directors of the French Discount Bank, during the Revolution he was involved in plans for a constitutional monarchy and amongst the ideas he brought forward was for what would essentially be an “Office for National Statistics”. The aim being to collect data on production and so forth across the economy in support of economic policy. This fits in with the mineral survey work he carried at the very beginning of his career and also on his work in “experimental farming”. Economic policy at the time alternating between protectionism (no wheat exports) and free-markets (wheat exports allowed), with many arguing that agriculture was the only economically productive activity.

It’s tempting to see Lavoisier’s scientific and economic programmes being linked via the idea of accounting: in chemistry the counting of amounts of material into and out of a reaction and in economics counting the cash into and out of the economy.

Definitely a book I would recommend! It’s remarkable just how busy Lavoisier was in a range of areas, and the book also provides a handy insight into the French Revolution for those more interested in science. I wondering whether Benjamin Franklin should be my next target.

Footnote

*These are equivalences to 1996 dollars, provided in the book, they should be treated with caution.

The naming of things

This post is a response to one of the points Rebekah Higgit makes over at “Whewell’s Ghost” on “Dos and Don’ts of history of science”. It’s all about scientists:

1) Do not ever call anyone a scientist who would not have recognised the term. The word was not coined until the 1830s (by William Whewell himself) but a) he meant something rather different by it and b) the word was not actually used until the 1870s. If we use the term to describe anyone before this date we risk loading their views, status, career, ambitions and work with associations that just do not exist before this date.I may know what I mean if it slips out in my description of an 18th-century astronomy, but the person listening to me will hear all sorts of other things. It too easily glides over points such as the fact that individuals probably did something else to make their living, or were personally wealthy. Science was not a career, or a vocation. I could give many further examples, and expand this rule into to using actors’ categories elsewhere, but this is the fundamental point. Not only did the word not, essentially, exist pre-1870 but there was no equivalent and no such idea. Awkward as it can sometimes be, man of science, natural philosopher, mathematician, astronomer, physician, naturalist or whatever should always be used instead.

I disagree with this. I should point out that I don’t consider this a Marmite* argument: the point Rebekah makes is not unreasonable and arguing serves to reinforce the point she is making. That the lives of “scientists” in the past were very different from the lives of most modern “scientists” is an entirely fair point, and is perhaps what the history of science is all about.

Since Rebekah is a professional historian of science, I feel my best approach is to argue this point on linguistic and scientific grounds, since I am a scientist not a historian. The OED says a scientist is:

  1. A person with expert knowledge of a science; a person using scientific methods.

it goes on to describe its coining via almost joking discussions over the British Association for the Advancement of Science in 1834 to Whewell’s use in 1840.

Precluding the use of the word “scientist” from application to people living before it was introduced seems to rather limit our options – how far must this sanitisation of language extend? Our use of words evolves in time. There are parallels here with Maxwell’s equations: in the mathematical language of his time his equations were clumsy and verbose, in more modern notation they are much more compact (and to overuse a word “elegant”). Working scientists don’t use Maxwell’s original notation, they use the modern notation because it captures the essential elements of the original work but is easier to use.

In my view the heart of the issue is the way in which we define scientists, to me being a scientist is defined operationally: by what I do in applying the scientific method, and by inference what people did in the past. Rather than socially or economically: what I have been trained to do or what people would pay me to do. I would still be a scientist if I were not paid for it, and hadn’t been trained. In both cases I might be poorer, but in different senses of the word!

There is also a point about communication here too: using a word for which you and your colleagues hold a specialist, narrow meaning may be “correct” but not help with communication. Knowing that your definition and the definition your audience hold is different is important but does not mean you should hold your definition sacrosanct – I face the same issue communicating my specialist area of science.

Perhaps the issue here is that Rebekah takes scientist to mean “modern professional scientist” whilst my definition is more catholic.

This does lead to the question: should I describe myself as a historian?

*Appropriate here since I work for the company that makes Marmite.