Skip to content

Commit

Permalink
Fix start dates of people with one non-Lord name.
Browse files Browse the repository at this point in the history
As the script did not record min/max of names unprefixed, for entries
where there was only one unique non-prefixed non-Lord name, it didn't
set the right start dates.
  • Loading branch information
dracos authored and TheyWorkForYou Live CVS User committed May 21, 2015
1 parent e7b055e commit b149a3e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 33 deletions.
64 changes: 32 additions & 32 deletions members/people.json
Original file line number Diff line number Diff line change
Expand Up @@ -638276,7 +638276,7 @@
"family_name": "Ancram",
"given_name": "Michael",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1974-02-28"
},
{
"given_name": "Michael Andrew Foster Jude Kerr",
Expand Down Expand Up @@ -638374,7 +638374,7 @@
"family_name": "Armstrong",
"given_name": "Hilary",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1987-06-11"
},
{
"county": "the County of Durham",
Expand Down Expand Up @@ -639360,7 +639360,7 @@
"family_name": "Boswell",
"given_name": "Tim",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1987-06-11"
},
{
"county": "the County of Northamptonshire",
Expand Down Expand Up @@ -639776,7 +639776,7 @@
"family_name": "Browne",
"given_name": "Des",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1997-05-01"
},
{
"county": "Ayrshire and Arran",
Expand All @@ -639803,7 +639803,7 @@
"family_name": "Browning",
"given_name": "Angela",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1992-04-09"
},
{
"county": "the County of Devon",
Expand Down Expand Up @@ -641205,7 +641205,7 @@
"family_name": "Cormack",
"given_name": "Patrick",
"note": "Main",
"start_date": "2005-06-24"
"start_date": "1970-06-18"
},
{
"county": "the County of Staffordshire",
Expand Down Expand Up @@ -641795,7 +641795,7 @@
"family_name": "Davies",
"given_name": "Quentin",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1987-06-11"
},
{
"county": "the County of Lincolnshire",
Expand Down Expand Up @@ -643896,7 +643896,7 @@
"family_name": "Gummer",
"given_name": "John",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1970-06-18"
},
{
"county": "the County of Suffolk",
Expand Down Expand Up @@ -644846,7 +644846,7 @@
"family_name": "Howard",
"given_name": "Michael",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1983-06-09"
},
{
"county": "the County of Kent",
Expand Down Expand Up @@ -645006,7 +645006,7 @@
"family_name": "Hughes",
"given_name": "Beverley",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1997-05-01"
},
{
"county": "the County of Cheshire",
Expand Down Expand Up @@ -645142,7 +645142,7 @@
"family_name": "Hutton",
"given_name": "John",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1992-04-09"
},
{
"county": "the County of Cumbria",
Expand Down Expand Up @@ -646594,7 +646594,7 @@
"family_name": "Lord",
"given_name": "Michael",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1983-06-09"
},
{
"county": "the County of Suffolk",
Expand Down Expand Up @@ -646764,7 +646764,7 @@
"family_name": "McAvoy",
"given_name": "Thomas",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1987-06-11"
},
{
"county": "Lanarkshire",
Expand Down Expand Up @@ -646997,7 +646997,7 @@
"family_name": "McFall",
"given_name": "John",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1987-06-11"
},
{
"county": "the County of Dunbartonshire",
Expand Down Expand Up @@ -647251,7 +647251,7 @@
"family_name": "Maclean",
"given_name": "David",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1983-07-28"
},
{
"county": "the County of Cumbria",
Expand Down Expand Up @@ -647713,7 +647713,7 @@
"family_name": "Maples",
"given_name": "John",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1983-06-09"
},
{
"county": "the County of Warwickshire",
Expand Down Expand Up @@ -647873,7 +647873,7 @@
"family_name": "Martin",
"given_name": "Michael",
"note": "Main",
"start_date": "2000-10-24"
"start_date": "1979-05-03"
},
{
"county": "the City of Glasgow",
Expand Down Expand Up @@ -649044,7 +649044,7 @@
"family_name": "Paisley",
"given_name": "Ian",
"note": "Main",
"start_date": "2003-11-26"
"start_date": "1970-06-18"
},
{
"county": "the County of Antrim",
Expand Down Expand Up @@ -649426,7 +649426,7 @@
"family_name": "Prescott",
"given_name": "John",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1970-06-18"
},
{
"county": "the County of East Yorkshire",
Expand Down Expand Up @@ -649716,7 +649716,7 @@
"family_name": "Reid",
"given_name": "John",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1987-06-11"
},
{
"county": "Lanarkshire",
Expand Down Expand Up @@ -650737,7 +650737,7 @@
"family_name": "Smith",
"given_name": "Angela",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1997-05-01"
},
{
"county": "the County of Essex",
Expand Down Expand Up @@ -651082,7 +651082,7 @@
"family_name": "Spicer",
"given_name": "Michael",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1974-02-28"
},
{
"county": "the County of Worcestershire",
Expand Down Expand Up @@ -651110,7 +651110,7 @@
"family_name": "Spring",
"given_name": "Richard",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1992-04-09"
},
{
"county": "the County of Suffolk",
Expand Down Expand Up @@ -651702,7 +651702,7 @@
"family_name": "Taylor",
"given_name": "John",
"note": "Main",
"start_date": "1998-06-25"
"start_date": "1983-06-09"
},
{
"additional_name": "John David",
Expand Down Expand Up @@ -651732,7 +651732,7 @@
"family_name": "Taylor",
"given_name": "Matthew",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1987-03-12"
},
{
"county": "the County of Cornwall",
Expand Down Expand Up @@ -651992,7 +651992,7 @@
"family_name": "Touhig",
"given_name": "Don",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1995-02-16"
},
{
"county": "the County of Gwent",
Expand Down Expand Up @@ -652123,7 +652123,7 @@
"given_name": "David",
"honorific_prefix": "Rt Hon",
"note": "Main",
"start_date": "1998-06-25"
"start_date": "1990-05-17"
},
{
"additional_name": "William David",
Expand Down Expand Up @@ -652967,7 +652967,7 @@
"family_name": "Willis",
"given_name": "Phil",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1997-05-01"
},
{
"county": "the County of North Yorkshire",
Expand Down Expand Up @@ -652995,7 +652995,7 @@
"family_name": "Wills",
"given_name": "Michael",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "1997-05-01"
},
{
"county": "the County of Wiltshire and of Woodside Park in the London Borough of Barnet",
Expand Down Expand Up @@ -655052,7 +655052,7 @@
"family_name": "Knight",
"given_name": "Jim",
"note": "Main",
"start_date": "2005-05-05"
"start_date": "2001-06-07"
},
{
"county": "the County of Dorset",
Expand Down Expand Up @@ -672220,7 +672220,7 @@
"family_name": "Hay",
"given_name": "William",
"note": "Main",
"start_date": "2003-11-26"
"start_date": "1998-06-25"
},
{
"county": "the City of Londonderry",
Expand Down Expand Up @@ -675186,7 +675186,7 @@
"given_name": "Jack",
"honorific_prefix": "Rt Hon",
"note": "Main",
"start_date": "2007-05-03"
"start_date": "1999-05-06"
},
{
"county": "Ayrshire and Arran",
Expand Down
6 changes: 5 additions & 1 deletion scripts/one-off-move-names-to-persons
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ for mship in j['memberships']:
del mship['name']['honorific_prefix']
tuple_name = tuple(sorted(mship['name'].items()))
names_no_prefix.setdefault(pid, set()).add(tuple_name)
min_start[pid][tuple_name] = min(min_start.setdefault(pid, {}).get(tuple_name, '9999-12-31'), mship['start_date'])
max_end[pid][tuple_name] = max(max_end.setdefault(pid, {}).get(tuple_name, '0000-00-00'), mship.get('end_date', '9999-12-31'))
if mship.get('organization_id') != 'house-of-lords':
names_no_prefix_without_lords.setdefault(pid, set()).add(tuple_name)
del mship['name']
Expand All @@ -40,7 +42,9 @@ def set_name(person, name, include_dates=False):
if not isinstance(name, dict):
name = dict(name)
if include_dates:
namet = tuple(sorted(name.items()))
namet = name.copy()
if 'honorific_prefix' in namet: del namet['honorific_prefix']
namet = tuple(sorted(namet.items()))
name['start_date'] = min_start[person['id']][namet]
if max_end[person['id']][namet] != '9999-12-31':
name['end_date'] = max_end[person['id']][namet]
Expand Down

0 comments on commit b149a3e

Please sign in to comment.