diff --git a/members/people.json b/members/people.json index 0f3babd87..0a8205461 100644 --- a/members/people.json +++ b/members/people.json @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -646764,7 +646764,7 @@ "family_name": "McAvoy", "given_name": "Thomas", "note": "Main", - "start_date": "2005-05-05" + "start_date": "1987-06-11" }, { "county": "Lanarkshire", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -649716,7 +649716,7 @@ "family_name": "Reid", "given_name": "John", "note": "Main", - "start_date": "2005-05-05" + "start_date": "1987-06-11" }, { "county": "Lanarkshire", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", diff --git a/scripts/one-off-move-names-to-persons b/scripts/one-off-move-names-to-persons index 2497859e6..627f251f9 100644 --- a/scripts/one-off-move-names-to-persons +++ b/scripts/one-off-move-names-to-persons @@ -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'] @@ -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]