civics-cdf-validator 1.68.dev18__py3-none-any.whl → 1.69.dev2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- civics_cdf_validator/rulesets/election_rules.py +223 -217
- civics_cdf_validator/version.py +1 -1
- {civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/METADATA +1 -1
- {civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/RECORD +8 -8
- {civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/WHEEL +0 -0
- {civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/entry_points.txt +0 -0
- {civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/licenses/LICENSE-2.0.txt +0 -0
- {civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/top_level.txt +0 -0
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
from __future__ import print_function
|
|
17
17
|
|
|
18
18
|
import collections
|
|
19
|
+
from collections.abc import Iterable, Mapping, Sequence
|
|
19
20
|
import datetime
|
|
20
21
|
|
|
21
22
|
from civics_cdf_validator import base
|
|
22
23
|
from civics_cdf_validator import loggers
|
|
23
24
|
from civics_cdf_validator.rulesets import common_rules
|
|
24
25
|
from civics_cdf_validator.rulesets import rule_util
|
|
26
|
+
from lxml import etree
|
|
25
27
|
import networkx
|
|
26
28
|
|
|
27
29
|
_CONTEST_STAGE_TYPES = frozenset([
|
|
@@ -40,7 +42,7 @@ _WINNER_POST_ELECTION_STATUSES = frozenset([
|
|
|
40
42
|
])
|
|
41
43
|
|
|
42
44
|
|
|
43
|
-
def _get_type_or_other_type(element):
|
|
45
|
+
def _get_type_or_other_type(element: etree._Element) -> str:
|
|
44
46
|
"""Returns the OtherType text if Type is "other", else the Type text."""
|
|
45
47
|
type_element = element.find("Type")
|
|
46
48
|
other_type_element = element.find("OtherType")
|
|
@@ -64,10 +66,10 @@ class PercentSum(base.BaseRule):
|
|
|
64
66
|
return ["Contest"]
|
|
65
67
|
|
|
66
68
|
@staticmethod
|
|
67
|
-
def fuzzy_equals(a, b, epsilon=1e-6):
|
|
69
|
+
def fuzzy_equals(a: float, b: float, epsilon: float = 1e-6) -> bool:
|
|
68
70
|
return abs(a - b) < epsilon
|
|
69
71
|
|
|
70
|
-
def check(self, element):
|
|
72
|
+
def check(self, element: etree._Element) -> None:
|
|
71
73
|
sum_percents = 0.0
|
|
72
74
|
for ballot_selection in element.findall("BallotSelection"):
|
|
73
75
|
for vote_counts in ballot_selection.find("VoteCountsCollection").findall(
|
|
@@ -80,7 +82,7 @@ class PercentSum(base.BaseRule):
|
|
|
80
82
|
sum_percents, 0
|
|
81
83
|
) and not PercentSum.fuzzy_equals(sum_percents, 100):
|
|
82
84
|
raise loggers.ElectionError.from_message(
|
|
83
|
-
"Contest percents do not sum to 0 or 100:
|
|
85
|
+
f"Contest percents do not sum to 0 or 100: {sum_percents:f}",
|
|
84
86
|
[element],
|
|
85
87
|
)
|
|
86
88
|
|
|
@@ -95,7 +97,12 @@ class PartisanPrimary(base.BaseRule):
|
|
|
95
97
|
|
|
96
98
|
election_type = None
|
|
97
99
|
|
|
98
|
-
def __init__(
|
|
100
|
+
def __init__(
|
|
101
|
+
self,
|
|
102
|
+
election_tree: etree._ElementTree,
|
|
103
|
+
schema_tree: etree._ElementTree | None = None,
|
|
104
|
+
**kwargs,
|
|
105
|
+
) -> None:
|
|
99
106
|
super(PartisanPrimary, self).__init__(election_tree, schema_tree, **kwargs)
|
|
100
107
|
# There can only be one election element in a file.
|
|
101
108
|
election_elem = self.election_tree.find("Election")
|
|
@@ -104,10 +111,10 @@ class PartisanPrimary(base.BaseRule):
|
|
|
104
111
|
if election_type_elem is not None:
|
|
105
112
|
self.election_type = election_type_elem.text.strip()
|
|
106
113
|
|
|
107
|
-
def elements(self):
|
|
114
|
+
def elements(self) -> list[str]:
|
|
108
115
|
return ["Election"]
|
|
109
116
|
|
|
110
|
-
def check(self, election_elem):
|
|
117
|
+
def check(self, election_elem: etree._Element) -> None:
|
|
111
118
|
election_type_elem = election_elem.find("Type")
|
|
112
119
|
election_type = None
|
|
113
120
|
if rule_util.element_has_text(election_type_elem):
|
|
@@ -124,8 +131,8 @@ class PartisanPrimary(base.BaseRule):
|
|
|
124
131
|
primary_party_ids = contest_elem.find("PrimaryPartyIds")
|
|
125
132
|
if not rule_util.element_has_text(primary_party_ids):
|
|
126
133
|
msg = (
|
|
127
|
-
"Election is of ElectionType
|
|
128
|
-
" or is empty"
|
|
134
|
+
f"Election is of ElectionType {self.election_type} but"
|
|
135
|
+
" PrimaryPartyIds is not present or is empty"
|
|
129
136
|
)
|
|
130
137
|
raise loggers.ElectionWarning.from_message(msg, [election_elem])
|
|
131
138
|
|
|
@@ -136,10 +143,10 @@ class PartisanPrimaryHeuristic(base.BaseRule):
|
|
|
136
143
|
# Add other strings that imply this is a primary contest.
|
|
137
144
|
party_text = ["(dem)", "(rep)", "(lib)"]
|
|
138
145
|
|
|
139
|
-
def elements(self):
|
|
146
|
+
def elements(self) -> list[str]:
|
|
140
147
|
return ["Election"]
|
|
141
148
|
|
|
142
|
-
def check(self, election_elem):
|
|
149
|
+
def check(self, election_elem: etree._Element) -> None:
|
|
143
150
|
election_type_elem = election_elem.find("Type")
|
|
144
151
|
election_type = None
|
|
145
152
|
if rule_util.element_has_text(election_type_elem):
|
|
@@ -160,9 +167,9 @@ class PartisanPrimaryHeuristic(base.BaseRule):
|
|
|
160
167
|
for p_text in self.party_text:
|
|
161
168
|
if p_text in c_name:
|
|
162
169
|
msg = (
|
|
163
|
-
"Name of contest -
|
|
164
|
-
"partisan primary but is not marked up as
|
|
165
|
-
|
|
170
|
+
f"Name of contest - {contest_name.text}, contains text that"
|
|
171
|
+
" implies it is a partisan primary but is not marked up as"
|
|
172
|
+
" such."
|
|
166
173
|
)
|
|
167
174
|
raise loggers.ElectionWarning.from_message(msg, [contest_elem])
|
|
168
175
|
|
|
@@ -177,15 +184,17 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
177
184
|
can't span unrelated contests.
|
|
178
185
|
"""
|
|
179
186
|
|
|
180
|
-
def __init__(self, *args, **kwargs):
|
|
187
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
181
188
|
super(CandidatesReferencedInRelatedContests, self).__init__(*args, **kwargs)
|
|
182
189
|
self.error_log = []
|
|
183
190
|
self.contest_graph = networkx.Graph()
|
|
184
191
|
|
|
185
|
-
def elements(self):
|
|
192
|
+
def elements(self) -> list[str]:
|
|
186
193
|
return ["ElectionReport"]
|
|
187
194
|
|
|
188
|
-
def _register_person_to_candidate_to_contests(
|
|
195
|
+
def _register_person_to_candidate_to_contests(
|
|
196
|
+
self, election_report: etree._Element
|
|
197
|
+
) -> dict[str, dict[str, list[str]]]:
|
|
189
198
|
person_candidate_contest_mapping = {}
|
|
190
199
|
|
|
191
200
|
candidate_to_contest_mapping = {}
|
|
@@ -212,9 +221,9 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
212
221
|
if candidate_id not in candidate_to_contest_mapping.keys():
|
|
213
222
|
raise loggers.ElectionError.from_message(
|
|
214
223
|
(
|
|
215
|
-
"A Candidate should be referenced in a Contest. Candidate
|
|
216
|
-
"is not referenced."
|
|
217
|
-
)
|
|
224
|
+
"A Candidate should be referenced in a Contest. Candidate"
|
|
225
|
+
f" {candidate_id} is not referenced."
|
|
226
|
+
),
|
|
218
227
|
[candidate],
|
|
219
228
|
)
|
|
220
229
|
contest_list = candidate_to_contest_mapping[candidate_id]
|
|
@@ -224,7 +233,7 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
224
233
|
|
|
225
234
|
return person_candidate_contest_mapping
|
|
226
235
|
|
|
227
|
-
def _construct_contest_graph(self, election_report):
|
|
236
|
+
def _construct_contest_graph(self, election_report: etree._Element) -> None:
|
|
228
237
|
contests = self.get_elements_by_class(election_report, "Contest")
|
|
229
238
|
# create a node for each contest
|
|
230
239
|
for contest in contests:
|
|
@@ -238,9 +247,9 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
238
247
|
if not self.contest_graph.has_node(subsequent_contest_id):
|
|
239
248
|
raise loggers.ElectionError.from_message(
|
|
240
249
|
(
|
|
241
|
-
"Contest {} contains a subsequent
|
|
242
|
-
"not exist."
|
|
243
|
-
)
|
|
250
|
+
f"Contest {contest.get('objectId')} contains a subsequent"
|
|
251
|
+
f" Contest Id ({subsequent_contest_id}) that does not exist."
|
|
252
|
+
),
|
|
244
253
|
[subsequent_contest],
|
|
245
254
|
)
|
|
246
255
|
self.contest_graph.add_edge(
|
|
@@ -255,14 +264,16 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
255
264
|
if not self.contest_graph.has_node(child):
|
|
256
265
|
raise loggers.ElectionError.from_message(
|
|
257
266
|
(
|
|
258
|
-
"Contest {} contains a composing
|
|
259
|
-
"not exist."
|
|
260
|
-
)
|
|
267
|
+
f"Contest {contest.get('objectId')} contains a composing"
|
|
268
|
+
f" Contest Id ({child}) that does not exist."
|
|
269
|
+
),
|
|
261
270
|
[composing_contests],
|
|
262
271
|
)
|
|
263
272
|
self.contest_graph.add_edge(contest.get("objectId"), child)
|
|
264
273
|
|
|
265
|
-
def _check_candidate_contests_are_related(
|
|
274
|
+
def _check_candidate_contests_are_related(
|
|
275
|
+
self, contest_id_list: Sequence[str]
|
|
276
|
+
) -> bool:
|
|
266
277
|
for i in range(len(contest_id_list) - 1):
|
|
267
278
|
contest_one = contest_id_list[i]
|
|
268
279
|
contest_two = contest_id_list[i + 1]
|
|
@@ -273,7 +284,9 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
273
284
|
|
|
274
285
|
return True
|
|
275
286
|
|
|
276
|
-
def _check_separate_candidates_not_related(
|
|
287
|
+
def _check_separate_candidates_not_related(
|
|
288
|
+
self, candidate_contest_mapping: Mapping[str, Sequence[str]]
|
|
289
|
+
) -> bool:
|
|
277
290
|
for contests in candidate_contest_mapping.values():
|
|
278
291
|
for other_contests in [
|
|
279
292
|
con for con in candidate_contest_mapping.values() if con != contests
|
|
@@ -284,7 +297,7 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
284
297
|
return False
|
|
285
298
|
return True
|
|
286
299
|
|
|
287
|
-
def check(self, election_report):
|
|
300
|
+
def check(self, election_report: etree._Element) -> None:
|
|
288
301
|
self._construct_contest_graph(election_report)
|
|
289
302
|
person_candidate_to_contest_map = (
|
|
290
303
|
self._register_person_to_candidate_to_contests(election_report)
|
|
@@ -294,9 +307,9 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
294
307
|
related_contests = self._check_candidate_contests_are_related(contests)
|
|
295
308
|
if not related_contests:
|
|
296
309
|
error_message = (
|
|
297
|
-
"Candidate {} appears in the following contests "
|
|
298
|
-
"which are not all related: {}"
|
|
299
|
-
)
|
|
310
|
+
f"Candidate {cand} appears in the following contests "
|
|
311
|
+
f"which are not all related: {', '.join(contests)}"
|
|
312
|
+
)
|
|
300
313
|
self.error_log.append(
|
|
301
314
|
loggers.LogEntry(error_message, [election_report])
|
|
302
315
|
)
|
|
@@ -306,8 +319,8 @@ class CandidatesReferencedInRelatedContests(base.BaseRule):
|
|
|
306
319
|
)
|
|
307
320
|
if not sep_cand_not_related:
|
|
308
321
|
error_message = (
|
|
309
|
-
"Person {} has separate candidates in contests that "
|
|
310
|
-
"are related."
|
|
322
|
+
f"Person {person} has separate candidates in contests that "
|
|
323
|
+
"are related."
|
|
311
324
|
)
|
|
312
325
|
self.error_log.append(
|
|
313
326
|
loggers.LogEntry(error_message, [election_report])
|
|
@@ -331,10 +344,10 @@ class ProperBallotSelection(base.BaseRule):
|
|
|
331
344
|
"RetentionContest": "BallotMeasureSelection",
|
|
332
345
|
}
|
|
333
346
|
|
|
334
|
-
def elements(self):
|
|
335
|
-
return self.con_sel_mapping
|
|
347
|
+
def elements(self) -> list[str]:
|
|
348
|
+
return list(self.con_sel_mapping)
|
|
336
349
|
|
|
337
|
-
def check(self, element):
|
|
350
|
+
def check(self, element: etree._Element) -> None:
|
|
338
351
|
tag = self.get_element_class(element)
|
|
339
352
|
selections = []
|
|
340
353
|
for c in self.con_sel_mapping:
|
|
@@ -344,9 +357,9 @@ class ProperBallotSelection(base.BaseRule):
|
|
|
344
357
|
if selection_tag != self.con_sel_mapping[tag]:
|
|
345
358
|
selection_id = selection.get("objectId")
|
|
346
359
|
msg = (
|
|
347
|
-
"The Contest does not contain the right BallotSelection.
|
|
348
|
-
"must have a
|
|
349
|
-
|
|
360
|
+
"The Contest does not contain the right BallotSelection."
|
|
361
|
+
f" {tag} must have a {self.con_sel_mapping[tag]} but contains a"
|
|
362
|
+
f" {selection_tag}, {selection_id}"
|
|
350
363
|
)
|
|
351
364
|
raise loggers.ElectionError.from_message(msg, [element])
|
|
352
365
|
|
|
@@ -360,10 +373,10 @@ class CorrectCandidateSelectionCount(base.BaseRule):
|
|
|
360
373
|
party list elections.
|
|
361
374
|
"""
|
|
362
375
|
|
|
363
|
-
def elements(self):
|
|
376
|
+
def elements(self) -> list[str]:
|
|
364
377
|
return ["CandidateSelection"]
|
|
365
378
|
|
|
366
|
-
def check(self, element):
|
|
379
|
+
def check(self, element: etree._Element) -> None:
|
|
367
380
|
selection_id = element.get("objectId")
|
|
368
381
|
candidate_ids = element.findall("CandidateIds")
|
|
369
382
|
if not candidate_ids:
|
|
@@ -395,10 +408,10 @@ class SingularPartySelection(base.BaseRule):
|
|
|
395
408
|
not support this. Having multiple parties can cause undefined behavior.
|
|
396
409
|
"""
|
|
397
410
|
|
|
398
|
-
def elements(self):
|
|
411
|
+
def elements(self) -> list[str]:
|
|
399
412
|
return ["PartySelection"]
|
|
400
413
|
|
|
401
|
-
def check(self, element):
|
|
414
|
+
def check(self, element: etree._Element) -> None:
|
|
402
415
|
party_ids = element.find("PartyIds")
|
|
403
416
|
if party_ids is None or not party_ids.text or not party_ids.text.strip():
|
|
404
417
|
raise loggers.ElectionError.from_message(
|
|
@@ -418,7 +431,7 @@ class ValidateDuplicateColors(base.TreeRule):
|
|
|
418
431
|
message.
|
|
419
432
|
"""
|
|
420
433
|
|
|
421
|
-
def check(self):
|
|
434
|
+
def check(self) -> None:
|
|
422
435
|
party_colors_by_id = {}
|
|
423
436
|
party_objects = {}
|
|
424
437
|
for party in self.get_elements_by_class(self.election_tree, "Party"):
|
|
@@ -493,10 +506,10 @@ class DuplicateContestNames(base.BaseRule):
|
|
|
493
506
|
Add Warning if duplicate ContestName found.
|
|
494
507
|
"""
|
|
495
508
|
|
|
496
|
-
def elements(self):
|
|
509
|
+
def elements(self) -> list[str]:
|
|
497
510
|
return ["ContestCollection"]
|
|
498
511
|
|
|
499
|
-
def check(self, election_elt):
|
|
512
|
+
def check(self, election_elt: etree._Element) -> None:
|
|
500
513
|
# Mapping for <Name> and its Contest ObjectId.
|
|
501
514
|
error_log = []
|
|
502
515
|
name_contest_id = {}
|
|
@@ -515,7 +528,7 @@ class DuplicateContestNames(base.BaseRule):
|
|
|
515
528
|
for name, contests in name_contest_id.items():
|
|
516
529
|
if len(contests) > 1:
|
|
517
530
|
error_log.append(
|
|
518
|
-
loggers.LogEntry("Contests have the same name
|
|
531
|
+
loggers.LogEntry(f"Contests have the same name {name}.", contests)
|
|
519
532
|
)
|
|
520
533
|
if error_log:
|
|
521
534
|
raise loggers.ElectionError(error_log)
|
|
@@ -528,10 +541,10 @@ class DuplicateBallotTitleSeatPair(base.BaseRule):
|
|
|
528
541
|
found.
|
|
529
542
|
"""
|
|
530
543
|
|
|
531
|
-
def elements(self):
|
|
544
|
+
def elements(self) -> list[str]:
|
|
532
545
|
return ["ContestCollection"]
|
|
533
546
|
|
|
534
|
-
def check(self, element):
|
|
547
|
+
def check(self, element: etree._Element) -> None:
|
|
535
548
|
error_log = []
|
|
536
549
|
contest_elements = element.findall("Contest")
|
|
537
550
|
contests_by_title_and_seat = collections.defaultdict(list)
|
|
@@ -572,7 +585,7 @@ class DuplicateBallotTitleSeatPair(base.BaseRule):
|
|
|
572
585
|
class MultipleCandidatesPointToTheSamePersonInTheSameContest(base.TreeRule):
|
|
573
586
|
"""Raise an error when multiple candidates point to the same person in the same contest."""
|
|
574
587
|
|
|
575
|
-
def check(self):
|
|
588
|
+
def check(self) -> None:
|
|
576
589
|
# Keep track of rule violations
|
|
577
590
|
error_log = []
|
|
578
591
|
rule_violations = []
|
|
@@ -596,14 +609,18 @@ class MultipleCandidatesPointToTheSamePersonInTheSameContest(base.TreeRule):
|
|
|
596
609
|
person_id = rule_violation[1]
|
|
597
610
|
candidate_list = rule_violation[2]
|
|
598
611
|
error_message = (
|
|
599
|
-
"Multiple candidates in Contest {} reference the same
|
|
600
|
-
"{}. Candidates: {}"
|
|
601
|
-
)
|
|
612
|
+
f"Multiple candidates in Contest {contest_id} reference the same"
|
|
613
|
+
f" Person {person_id}. Candidates: {candidate_list}"
|
|
614
|
+
)
|
|
602
615
|
error_log.append(loggers.LogEntry((error_message), [contest_id]))
|
|
603
616
|
if error_log:
|
|
604
617
|
raise loggers.ElectionError(error_log)
|
|
605
618
|
|
|
606
|
-
def _check_for_bad_candidates(
|
|
619
|
+
def _check_for_bad_candidates(
|
|
620
|
+
self,
|
|
621
|
+
person_id_by_candidate_id: Mapping[str, str],
|
|
622
|
+
contest: etree._Element,
|
|
623
|
+
) -> list[tuple[str, str, str]]:
|
|
607
624
|
candidate_ids_by_person_id = dict()
|
|
608
625
|
rule_violating_person_ids = []
|
|
609
626
|
contest_id = contest.get("objectId")
|
|
@@ -619,7 +636,9 @@ class MultipleCandidatesPointToTheSamePersonInTheSameContest(base.TreeRule):
|
|
|
619
636
|
for person_id in rule_violating_person_ids
|
|
620
637
|
]
|
|
621
638
|
|
|
622
|
-
def _get_candidate_ids_for_contest(
|
|
639
|
+
def _get_candidate_ids_for_contest(
|
|
640
|
+
self, contest: etree._Element
|
|
641
|
+
) -> list[str]:
|
|
623
642
|
candidate_id_elements = self.get_elements_by_class(contest, "CandidateIds")
|
|
624
643
|
candidate_ids = []
|
|
625
644
|
for candidate_id_element in candidate_id_elements:
|
|
@@ -633,10 +652,10 @@ class SelfDeclaredCandidateMethod(base.BaseRule):
|
|
|
633
652
|
Please update the candidate Pre election Status.
|
|
634
653
|
"""
|
|
635
654
|
|
|
636
|
-
def elements(self):
|
|
655
|
+
def elements(self) -> list[str]:
|
|
637
656
|
return ["Candidate"]
|
|
638
657
|
|
|
639
|
-
def check(self, element):
|
|
658
|
+
def check(self, element: etree._Element) -> None:
|
|
640
659
|
status = element.find("PreElectionStatus")
|
|
641
660
|
if status is not None and status.text == "self-declared":
|
|
642
661
|
externalidvalues = rule_util.get_external_id_values(
|
|
@@ -654,10 +673,10 @@ class SelfDeclaredCandidateMethod(base.BaseRule):
|
|
|
654
673
|
class ContestHasMultipleOffices(base.BaseRule):
|
|
655
674
|
"""Ensure that each contest has exactly one Office."""
|
|
656
675
|
|
|
657
|
-
def elements(self):
|
|
676
|
+
def elements(self) -> list[str]:
|
|
658
677
|
return ["CandidateContest", "PartyContest"]
|
|
659
678
|
|
|
660
|
-
def check(self, element):
|
|
679
|
+
def check(self, element: etree._Element) -> None:
|
|
661
680
|
# for each contest, get the <officeids> entity
|
|
662
681
|
office_ids = element.find("OfficeIds")
|
|
663
682
|
if office_ids is not None and office_ids.text:
|
|
@@ -691,7 +710,7 @@ class VoteCountTypesCoherency(base.BaseRule):
|
|
|
691
710
|
def elements(self):
|
|
692
711
|
return ["Contest"]
|
|
693
712
|
|
|
694
|
-
def check(self, element):
|
|
713
|
+
def check(self, element: etree._Element) -> None:
|
|
695
714
|
invalid_vc_types = None
|
|
696
715
|
contest_type = ""
|
|
697
716
|
if element.get("type", "") == "CandidateContest":
|
|
@@ -710,8 +729,9 @@ class VoteCountTypesCoherency(base.BaseRule):
|
|
|
710
729
|
if vc_type in invalid_vc_types:
|
|
711
730
|
errors.append(vc_type)
|
|
712
731
|
if errors:
|
|
713
|
-
msg =
|
|
714
|
-
",
|
|
732
|
+
msg = (
|
|
733
|
+
f"VoteCount types {', '.join(errors)} should not be nested in"
|
|
734
|
+
f" {contest_type} Contest"
|
|
715
735
|
)
|
|
716
736
|
raise loggers.ElectionError.from_message(msg, [element])
|
|
717
737
|
|
|
@@ -719,12 +739,12 @@ class VoteCountTypesCoherency(base.BaseRule):
|
|
|
719
739
|
class VoteCountValidSeatsDeltaTypes(base.SchemaRule):
|
|
720
740
|
"""Ensure VoteCount seats delta types are valid."""
|
|
721
741
|
|
|
722
|
-
def elements(self):
|
|
742
|
+
def elements(self) -> list[str]:
|
|
723
743
|
return ["BallotSelection"] + list(
|
|
724
744
|
self.get_element_names_for_type("SpecialBallotSelection")
|
|
725
745
|
)
|
|
726
746
|
|
|
727
|
-
def check(self, element):
|
|
747
|
+
def check(self, element: etree._Element) -> None:
|
|
728
748
|
vote_count_types = set()
|
|
729
749
|
vote_counts_collection = element.find("VoteCountsCollection")
|
|
730
750
|
if vote_counts_collection is None:
|
|
@@ -743,10 +763,10 @@ class VoteCountValidSeatsDeltaTypes(base.SchemaRule):
|
|
|
743
763
|
class OfficeHasjurisdictionSameAsElectoralDistrict(base.BaseRule):
|
|
744
764
|
"""In election feeds, office has the electoral district same as jurisdiction."""
|
|
745
765
|
|
|
746
|
-
def elements(self):
|
|
766
|
+
def elements(self) -> list[str]:
|
|
747
767
|
return ["Office"]
|
|
748
768
|
|
|
749
|
-
def check(self, element):
|
|
769
|
+
def check(self, element: etree._Element) -> None:
|
|
750
770
|
jurisdiction_values = rule_util.get_entity_info_for_value_type(
|
|
751
771
|
element, "jurisdiction-id"
|
|
752
772
|
)
|
|
@@ -772,7 +792,7 @@ class ContestHasValidContestStage(base.BaseRule):
|
|
|
772
792
|
def elements(self):
|
|
773
793
|
return ["CandidateContest", "PartyContest", "BallotMeasureContest"]
|
|
774
794
|
|
|
775
|
-
def check(self, element):
|
|
795
|
+
def check(self, element: etree._Element) -> None:
|
|
776
796
|
contest_stage_values = [
|
|
777
797
|
contest_stage_value.strip()
|
|
778
798
|
for contest_stage_value in rule_util.get_external_id_values(
|
|
@@ -782,9 +802,7 @@ class ContestHasValidContestStage(base.BaseRule):
|
|
|
782
802
|
for contest_stage_value in contest_stage_values:
|
|
783
803
|
if contest_stage_value not in _CONTEST_STAGE_TYPES:
|
|
784
804
|
raise loggers.ElectionError.from_message(
|
|
785
|
-
"The contest has invalid contest-stage '{}'."
|
|
786
|
-
contest_stage_value
|
|
787
|
-
),
|
|
805
|
+
f"The contest has invalid contest-stage '{contest_stage_value}'.",
|
|
788
806
|
[element],
|
|
789
807
|
)
|
|
790
808
|
|
|
@@ -792,19 +810,17 @@ class ContestHasValidContestStage(base.BaseRule):
|
|
|
792
810
|
class ElectionContainsStartAndEndDates(base.DateRule):
|
|
793
811
|
"""Election elements should have start and end dates populated."""
|
|
794
812
|
|
|
795
|
-
def elements(self):
|
|
813
|
+
def elements(self) -> list[str]:
|
|
796
814
|
return ["Election"]
|
|
797
815
|
|
|
798
|
-
def check(self, element):
|
|
816
|
+
def check(self, element: etree._Element) -> None:
|
|
799
817
|
self.reset_instance_vars()
|
|
800
818
|
self.gather_dates(element)
|
|
801
819
|
|
|
802
820
|
if self.start_elem is None:
|
|
803
821
|
self.error_log.append(
|
|
804
822
|
loggers.LogEntry(
|
|
805
|
-
"Election {} is missing a start date."
|
|
806
|
-
element.get("objectId")
|
|
807
|
-
),
|
|
823
|
+
f"Election {element.get('objectId')} is missing a start date.",
|
|
808
824
|
[element],
|
|
809
825
|
)
|
|
810
826
|
)
|
|
@@ -812,9 +828,7 @@ class ElectionContainsStartAndEndDates(base.DateRule):
|
|
|
812
828
|
if self.end_elem is None:
|
|
813
829
|
self.error_log.append(
|
|
814
830
|
loggers.LogEntry(
|
|
815
|
-
"Election {} is missing an end date."
|
|
816
|
-
element.get("objectId")
|
|
817
|
-
),
|
|
831
|
+
f"Election {element.get('objectId')} is missing an end date.",
|
|
818
832
|
[element],
|
|
819
833
|
)
|
|
820
834
|
)
|
|
@@ -830,10 +844,10 @@ class ElectionStartDates(base.DateRule):
|
|
|
830
844
|
as validator could conceivably be run during an ongoing election.
|
|
831
845
|
"""
|
|
832
846
|
|
|
833
|
-
def elements(self):
|
|
847
|
+
def elements(self) -> list[str]:
|
|
834
848
|
return ["Election"]
|
|
835
849
|
|
|
836
|
-
def check(self, element):
|
|
850
|
+
def check(self, element: etree._Element) -> None:
|
|
837
851
|
self.reset_instance_vars()
|
|
838
852
|
self.gather_dates(element)
|
|
839
853
|
|
|
@@ -855,10 +869,10 @@ class ElectionEndDatesInThePast(base.DateRule):
|
|
|
855
869
|
canceled.
|
|
856
870
|
"""
|
|
857
871
|
|
|
858
|
-
def elements(self):
|
|
872
|
+
def elements(self) -> list[str]:
|
|
859
873
|
return ["Election"]
|
|
860
874
|
|
|
861
|
-
def check(self, element):
|
|
875
|
+
def check(self, element: etree._Element) -> None:
|
|
862
876
|
self.reset_instance_vars()
|
|
863
877
|
self.gather_dates(element)
|
|
864
878
|
date_type = element.find("ElectionDateType")
|
|
@@ -893,10 +907,10 @@ class ElectionEndDatesOccurAfterStartDates(base.DateRule):
|
|
|
893
907
|
End dates should not occur before the start date.
|
|
894
908
|
"""
|
|
895
909
|
|
|
896
|
-
def elements(self):
|
|
910
|
+
def elements(self) -> list[str]:
|
|
897
911
|
return ["Election"]
|
|
898
912
|
|
|
899
|
-
def check(self, element):
|
|
913
|
+
def check(self, element: etree._Element) -> None:
|
|
900
914
|
self.reset_instance_vars()
|
|
901
915
|
self.gather_dates(element)
|
|
902
916
|
|
|
@@ -915,12 +929,15 @@ class ElectionDatesSpanContestDates(base.DateRule):
|
|
|
915
929
|
will be considered.
|
|
916
930
|
"""
|
|
917
931
|
|
|
918
|
-
def elements(self):
|
|
932
|
+
def elements(self) -> list[str]:
|
|
919
933
|
return ["ElectionReport"]
|
|
920
934
|
|
|
921
935
|
def _validate_contest_dates_within_election(
|
|
922
|
-
self,
|
|
923
|
-
|
|
936
|
+
self,
|
|
937
|
+
election: etree._Element,
|
|
938
|
+
contest: etree._Element,
|
|
939
|
+
error_log: list[loggers.LogEntry],
|
|
940
|
+
) -> None:
|
|
924
941
|
self.reset_instance_vars()
|
|
925
942
|
self.gather_dates(election)
|
|
926
943
|
election_start_date = self.start_date
|
|
@@ -942,14 +959,10 @@ class ElectionDatesSpanContestDates(base.DateRule):
|
|
|
942
959
|
):
|
|
943
960
|
error_log.append(
|
|
944
961
|
loggers.LogEntry(
|
|
945
|
-
"Contest {} with end date {} occurs
|
|
946
|
-
"
|
|
947
|
-
"
|
|
948
|
-
|
|
949
|
-
self.end_date,
|
|
950
|
-
election_id,
|
|
951
|
-
election_end_date,
|
|
952
|
-
),
|
|
962
|
+
f"Contest {contest_id} with end date {self.end_date} occurs"
|
|
963
|
+
f" after Election {election_id} with end date"
|
|
964
|
+
f" {election_end_date}. Election end date should be on or after"
|
|
965
|
+
" any Contest end date.",
|
|
953
966
|
[contest],
|
|
954
967
|
)
|
|
955
968
|
)
|
|
@@ -960,19 +973,15 @@ class ElectionDatesSpanContestDates(base.DateRule):
|
|
|
960
973
|
):
|
|
961
974
|
error_log.append(
|
|
962
975
|
loggers.LogEntry(
|
|
963
|
-
"Contest {} with start date {}
|
|
964
|
-
"
|
|
965
|
-
"
|
|
966
|
-
|
|
967
|
-
self.start_date,
|
|
968
|
-
election_id,
|
|
969
|
-
election_start_date,
|
|
970
|
-
),
|
|
976
|
+
f"Contest {contest_id} with start date {self.start_date}"
|
|
977
|
+
f" occurs before Election {election_id} with start date"
|
|
978
|
+
f" {election_start_date}. Election start date should be on or"
|
|
979
|
+
" before any Contest start date.",
|
|
971
980
|
[contest],
|
|
972
981
|
)
|
|
973
982
|
)
|
|
974
983
|
|
|
975
|
-
def check(self, election_report_element):
|
|
984
|
+
def check(self, election_report_element: etree._Element) -> None:
|
|
976
985
|
error_log = []
|
|
977
986
|
for election in self.get_elements_by_class(
|
|
978
987
|
election_report_element, "Election"
|
|
@@ -989,10 +998,10 @@ class ElectionDatesSpanContestDates(base.DateRule):
|
|
|
989
998
|
class ElectionTypesAreCompatible(base.BaseRule):
|
|
990
999
|
"""Election element Type values cannot be both a general and primary type."""
|
|
991
1000
|
|
|
992
|
-
def elements(self):
|
|
1001
|
+
def elements(self) -> list[str]:
|
|
993
1002
|
return ["Election"]
|
|
994
1003
|
|
|
995
|
-
def check(self, element):
|
|
1004
|
+
def check(self, element: etree._Element) -> None:
|
|
996
1005
|
election_types = element.findall("Type")
|
|
997
1006
|
if election_types:
|
|
998
1007
|
for i in range(len(election_types)):
|
|
@@ -1015,17 +1024,19 @@ class ElectionTypesAndCandidateContestTypesAreCompatible(base.BaseRule):
|
|
|
1015
1024
|
CandidateContests with the general type.
|
|
1016
1025
|
"""
|
|
1017
1026
|
|
|
1018
|
-
def _extract_text_from_elements(
|
|
1027
|
+
def _extract_text_from_elements(
|
|
1028
|
+
self, elements: Iterable[etree._Element]
|
|
1029
|
+
) -> set[str]:
|
|
1019
1030
|
return {
|
|
1020
1031
|
element.text.strip().lower()
|
|
1021
1032
|
for element in elements
|
|
1022
1033
|
if rule_util.element_has_text(element)
|
|
1023
1034
|
}
|
|
1024
1035
|
|
|
1025
|
-
def elements(self):
|
|
1036
|
+
def elements(self) -> list[str]:
|
|
1026
1037
|
return ["Election"]
|
|
1027
1038
|
|
|
1028
|
-
def check(self, element):
|
|
1039
|
+
def check(self, element: etree._Element) -> None:
|
|
1029
1040
|
errors = []
|
|
1030
1041
|
contests = self.get_elements_by_class(element, "CandidateContest")
|
|
1031
1042
|
election_types = self._extract_text_from_elements(element.findall("Type"))
|
|
@@ -1041,9 +1052,10 @@ class ElectionTypesAndCandidateContestTypesAreCompatible(base.BaseRule):
|
|
|
1041
1052
|
):
|
|
1042
1053
|
errors.append(
|
|
1043
1054
|
loggers.LogEntry(
|
|
1044
|
-
"Election
|
|
1045
|
-
"
|
|
1046
|
-
|
|
1055
|
+
f"Election {element.get('objectId')} includes"
|
|
1056
|
+
f" CandidateContest {contest.get('objectId')} with"
|
|
1057
|
+
" incompatible type(s). General elections cannot include"
|
|
1058
|
+
" primary contests.",
|
|
1047
1059
|
element,
|
|
1048
1060
|
)
|
|
1049
1061
|
)
|
|
@@ -1053,9 +1065,10 @@ class ElectionTypesAndCandidateContestTypesAreCompatible(base.BaseRule):
|
|
|
1053
1065
|
):
|
|
1054
1066
|
errors.append(
|
|
1055
1067
|
loggers.LogEntry(
|
|
1056
|
-
"Election
|
|
1057
|
-
"
|
|
1058
|
-
|
|
1068
|
+
f"Election {element.get('objectId')} includes"
|
|
1069
|
+
f" CandidateContest {contest.get('objectId')} with"
|
|
1070
|
+
" incompatible type(s). Primary elections cannot include"
|
|
1071
|
+
" general contests.",
|
|
1059
1072
|
element,
|
|
1060
1073
|
)
|
|
1061
1074
|
)
|
|
@@ -1073,10 +1086,10 @@ class DateStatusMatches(base.DateRule):
|
|
|
1073
1086
|
but uncommon - raise Info level message.
|
|
1074
1087
|
"""
|
|
1075
1088
|
|
|
1076
|
-
def elements(self):
|
|
1089
|
+
def elements(self) -> list[str]:
|
|
1077
1090
|
return ["Election"]
|
|
1078
1091
|
|
|
1079
|
-
def check(self, election_elem):
|
|
1092
|
+
def check(self, election_elem: etree._Element) -> None:
|
|
1080
1093
|
election_date_status = "confirmed" # default value
|
|
1081
1094
|
election_status_elem = election_elem.find("ElectionDateStatus")
|
|
1082
1095
|
|
|
@@ -1095,19 +1108,16 @@ class DateStatusMatches(base.DateRule):
|
|
|
1095
1108
|
contest_status = contest_statuses.pop()
|
|
1096
1109
|
if contest_status != election_date_status:
|
|
1097
1110
|
msg = (
|
|
1098
|
-
"All contests on election {} have
|
|
1099
|
-
"
|
|
1100
|
-
|
|
1101
|
-
contest_status,
|
|
1102
|
-
election_date_status,
|
|
1103
|
-
)
|
|
1111
|
+
f"All contests on election {election_elem.get('objectId')} have"
|
|
1112
|
+
f" a date status of {contest_status}, but the election has a date"
|
|
1113
|
+
f" status of {election_date_status}."
|
|
1104
1114
|
)
|
|
1105
1115
|
raise loggers.ElectionWarning.from_message(msg, [election_elem])
|
|
1106
1116
|
elif len(contest_statuses) > 1:
|
|
1107
1117
|
msg = (
|
|
1108
1118
|
"There are multiple date statuses present for the contests on "
|
|
1109
|
-
"election {}. This may be correct,
|
|
1110
|
-
"confirm."
|
|
1119
|
+
f"election {election_elem.get('objectId')}. This may be correct,"
|
|
1120
|
+
" but is an unusal case. Please confirm."
|
|
1111
1121
|
)
|
|
1112
1122
|
raise loggers.ElectionInfo.from_message(msg, [election_elem])
|
|
1113
1123
|
|
|
@@ -1127,10 +1137,10 @@ class ValidateInfoUriAnnotation(base.BaseRule):
|
|
|
1127
1137
|
"logo-uri",
|
|
1128
1138
|
]
|
|
1129
1139
|
|
|
1130
|
-
def elements(self):
|
|
1140
|
+
def elements(self) -> list[str]:
|
|
1131
1141
|
return ["InfoUri"]
|
|
1132
1142
|
|
|
1133
|
-
def check(self, element):
|
|
1143
|
+
def check(self, element: etree._Element) -> None:
|
|
1134
1144
|
error_log = []
|
|
1135
1145
|
annotation = element.attrib["Annotation"]
|
|
1136
1146
|
if annotation not in self.info_array:
|
|
@@ -1146,17 +1156,17 @@ class FullTextMaxLength(base.BaseRule):
|
|
|
1146
1156
|
|
|
1147
1157
|
MAX_LENGTH = 30000 # about 8-10 pages of text, 4500-5000 words
|
|
1148
1158
|
|
|
1149
|
-
def elements(self):
|
|
1159
|
+
def elements(self) -> list[str]:
|
|
1150
1160
|
return ["FullText"]
|
|
1151
1161
|
|
|
1152
|
-
def check(self, element):
|
|
1162
|
+
def check(self, element: etree._Element) -> None:
|
|
1153
1163
|
intl_text_list = element.findall("Text")
|
|
1154
1164
|
for intl_text in intl_text_list:
|
|
1155
1165
|
if len(intl_text.text) > self.MAX_LENGTH:
|
|
1156
1166
|
msg = (
|
|
1157
|
-
"FullText is longer than
|
|
1158
|
-
"include a link to the full text via InfoUri with
|
|
1159
|
-
"'fulltext'."
|
|
1167
|
+
f"FullText is longer than {self.MAX_LENGTH} characters. Please"
|
|
1168
|
+
" remove and include a link to the full text via InfoUri with"
|
|
1169
|
+
" Annotation 'fulltext'."
|
|
1160
1170
|
)
|
|
1161
1171
|
raise loggers.ElectionWarning.from_message(msg, [element])
|
|
1162
1172
|
|
|
@@ -1169,7 +1179,7 @@ class FullTextOrBallotText(base.BaseRule):
|
|
|
1169
1179
|
def elements(self):
|
|
1170
1180
|
return ["BallotMeasureContest"]
|
|
1171
1181
|
|
|
1172
|
-
def check(self, element):
|
|
1182
|
+
def check(self, element: etree._Element) -> None:
|
|
1173
1183
|
full_text_map = rule_util.get_language_to_text_map(element.find("FullText"))
|
|
1174
1184
|
if not full_text_map:
|
|
1175
1185
|
return
|
|
@@ -1184,10 +1194,10 @@ class FullTextOrBallotText(base.BaseRule):
|
|
|
1184
1194
|
and len(full_text_string) < self.SUGGESTION_CUTOFF_LENGTH
|
|
1185
1195
|
):
|
|
1186
1196
|
msg = (
|
|
1187
|
-
"Language:
|
|
1188
|
-
"for the same language. Please confirm that FullText
|
|
1189
|
-
"only supplementary text and not text on the ballot
|
|
1190
|
-
|
|
1197
|
+
f"Language: {language}. BallotText is missing but FullText is"
|
|
1198
|
+
" present for the same language. Please confirm that FullText"
|
|
1199
|
+
" contains only supplementary text and not text on the ballot"
|
|
1200
|
+
" itself."
|
|
1191
1201
|
)
|
|
1192
1202
|
raise loggers.ElectionWarning.from_message(msg, [element])
|
|
1193
1203
|
|
|
@@ -1198,7 +1208,7 @@ class BallotTitle(base.BaseRule):
|
|
|
1198
1208
|
def elements(self):
|
|
1199
1209
|
return ["BallotMeasureContest"]
|
|
1200
1210
|
|
|
1201
|
-
def check(self, element):
|
|
1211
|
+
def check(self, element: etree._Element) -> None:
|
|
1202
1212
|
ballot_title_map = rule_util.get_language_to_text_map(
|
|
1203
1213
|
element.find("BallotTitle")
|
|
1204
1214
|
)
|
|
@@ -1223,9 +1233,9 @@ class BallotTitle(base.BaseRule):
|
|
|
1223
1233
|
ballot_text_map[language][0]
|
|
1224
1234
|
) < len(ballot_title_string):
|
|
1225
1235
|
msg = (
|
|
1226
|
-
"Language:
|
|
1236
|
+
f"Language: {language}. BallotText is missing or shorter than "
|
|
1227
1237
|
" Please confirm that the ballot text/question is not "
|
|
1228
|
-
"in BallotTitle."
|
|
1238
|
+
"in BallotTitle."
|
|
1229
1239
|
)
|
|
1230
1240
|
raise loggers.ElectionWarning.from_message(msg, [element])
|
|
1231
1241
|
|
|
@@ -1235,7 +1245,7 @@ class ImproperCandidateContest(base.TreeRule):
|
|
|
1235
1245
|
|
|
1236
1246
|
_BALLOT_SELECTION_OPTIONS = frozenset({"yes", "no", "for", "against"})
|
|
1237
1247
|
|
|
1238
|
-
def _gather_contest_candidates(self, contest):
|
|
1248
|
+
def _gather_contest_candidates(self, contest: etree._Element) -> list[str]:
|
|
1239
1249
|
"""Return candidate ids for given contest element."""
|
|
1240
1250
|
candidate_ids = []
|
|
1241
1251
|
cand_id_elems = contest.findall("BallotSelection//CandidateIds")
|
|
@@ -1244,7 +1254,7 @@ class ImproperCandidateContest(base.TreeRule):
|
|
|
1244
1254
|
candidate_ids.append(cand_id)
|
|
1245
1255
|
return candidate_ids
|
|
1246
1256
|
|
|
1247
|
-
def _gather_invalid_candidates(self):
|
|
1257
|
+
def _gather_invalid_candidates(self) -> list[str]:
|
|
1248
1258
|
"""Return candidate ids that appear to be BallotMeasureSelections."""
|
|
1249
1259
|
invalid_candidates = []
|
|
1250
1260
|
candidates = self.get_elements_by_class(
|
|
@@ -1257,7 +1267,7 @@ class ImproperCandidateContest(base.TreeRule):
|
|
|
1257
1267
|
invalid_candidates.append(candidate.get("objectId"))
|
|
1258
1268
|
return invalid_candidates
|
|
1259
1269
|
|
|
1260
|
-
def check(self):
|
|
1270
|
+
def check(self) -> None:
|
|
1261
1271
|
candidate_contest_mapping = {}
|
|
1262
1272
|
contest_by_id = {}
|
|
1263
1273
|
candidate_contests = self.get_elements_by_class(
|
|
@@ -1279,11 +1289,11 @@ class ImproperCandidateContest(base.TreeRule):
|
|
|
1279
1289
|
flagged_candidates.append(cand_id)
|
|
1280
1290
|
if flagged_candidates:
|
|
1281
1291
|
warning_message = (
|
|
1282
|
-
"Candidates {} should be
|
|
1283
|
-
"elements. Similarly, Contest
|
|
1284
|
-
"
|
|
1285
|
-
"CandidateContest."
|
|
1286
|
-
)
|
|
1292
|
+
f"Candidates {', '.join(flagged_candidates)} should be"
|
|
1293
|
+
" BallotMeasureSelection elements. Similarly, Contest"
|
|
1294
|
+
f" {contest_id} should be changed to a BallotMeasureContest"
|
|
1295
|
+
" instead of a CandidateContest."
|
|
1296
|
+
)
|
|
1287
1297
|
warning_log.append(
|
|
1288
1298
|
loggers.LogEntry(warning_message, [contest_by_id[contest_id]])
|
|
1289
1299
|
)
|
|
@@ -1299,12 +1309,12 @@ class ImproperCandidateContest(base.TreeRule):
|
|
|
1299
1309
|
class WinnerCountLimit(base.BaseRule):
|
|
1300
1310
|
"""Number of winners must be less than or equal to NumberElected."""
|
|
1301
1311
|
|
|
1302
|
-
def setup(self):
|
|
1312
|
+
def setup(self) -> None:
|
|
1303
1313
|
self.candidate_post_election_status_by_object_id = (
|
|
1304
1314
|
self._get_candidate_post_election_status_by_object_id()
|
|
1305
1315
|
)
|
|
1306
1316
|
|
|
1307
|
-
def _get_candidate_post_election_status_by_object_id(self):
|
|
1317
|
+
def _get_candidate_post_election_status_by_object_id(self) -> dict[str, str]:
|
|
1308
1318
|
candidate_post_election_status_by_object_id = {}
|
|
1309
1319
|
candidates = self.get_elements_by_class(
|
|
1310
1320
|
self.election_tree, "CandidateCollection//Candidate"
|
|
@@ -1318,10 +1328,10 @@ class WinnerCountLimit(base.BaseRule):
|
|
|
1318
1328
|
)
|
|
1319
1329
|
return candidate_post_election_status_by_object_id
|
|
1320
1330
|
|
|
1321
|
-
def elements(self):
|
|
1331
|
+
def elements(self) -> list[str]:
|
|
1322
1332
|
return ["CandidateContest"]
|
|
1323
1333
|
|
|
1324
|
-
def check(self, element):
|
|
1334
|
+
def check(self, element: etree._Element) -> None:
|
|
1325
1335
|
number_elected_element = element.find("NumberElected")
|
|
1326
1336
|
number_elected = (
|
|
1327
1337
|
int(number_elected_element.text)
|
|
@@ -1362,10 +1372,10 @@ class SubsequentContestIdIsValidRelatedContest(base.DateRule):
|
|
|
1362
1372
|
- ComposingContestIds must not contain the original contest.
|
|
1363
1373
|
"""
|
|
1364
1374
|
|
|
1365
|
-
def elements(self):
|
|
1375
|
+
def elements(self) -> list[str]:
|
|
1366
1376
|
return ["ElectionReport"]
|
|
1367
1377
|
|
|
1368
|
-
def check(self, election_report_element):
|
|
1378
|
+
def check(self, election_report_element: etree._Element) -> None:
|
|
1369
1379
|
error_log = []
|
|
1370
1380
|
contest_by_id = {}
|
|
1371
1381
|
contest_end_date_by_id = {}
|
|
@@ -1459,8 +1469,8 @@ class SubsequentContestIdIsValidRelatedContest(base.DateRule):
|
|
|
1459
1469
|
):
|
|
1460
1470
|
error_log.append(
|
|
1461
1471
|
loggers.LogEntry(
|
|
1462
|
-
"Contest
|
|
1463
|
-
"primary party ids."
|
|
1472
|
+
f"Contest {contest_id} references a subsequent contest with"
|
|
1473
|
+
" different primary party ids.",
|
|
1464
1474
|
[contest],
|
|
1465
1475
|
[contest.sourceline],
|
|
1466
1476
|
)
|
|
@@ -1495,10 +1505,10 @@ class ComposingContestIdsAreValidRelatedContests(base.BaseRule):
|
|
|
1495
1505
|
- ComposingContests must not reference each other.
|
|
1496
1506
|
"""
|
|
1497
1507
|
|
|
1498
|
-
def elements(self):
|
|
1508
|
+
def elements(self) -> list[str]:
|
|
1499
1509
|
return ["ElectionReport"]
|
|
1500
1510
|
|
|
1501
|
-
def check(self, election_report_element):
|
|
1511
|
+
def check(self, election_report_element: etree._Element) -> None:
|
|
1502
1512
|
error_log = []
|
|
1503
1513
|
|
|
1504
1514
|
contests = self.get_elements_by_class(election_report_element, "Contest")
|
|
@@ -1519,9 +1529,9 @@ class ComposingContestIdsAreValidRelatedContests(base.BaseRule):
|
|
|
1519
1529
|
else:
|
|
1520
1530
|
error_log.append(
|
|
1521
1531
|
loggers.LogEntry(
|
|
1522
|
-
"Contest
|
|
1523
|
-
"than one parent contest. ComposingContests should
|
|
1524
|
-
"strict hierarchy."
|
|
1532
|
+
f"Contest {contest_id} is listed as a ComposingContest for"
|
|
1533
|
+
" more than one parent contest. ComposingContests should"
|
|
1534
|
+
" be a strict hierarchy.",
|
|
1525
1535
|
[contest_ids[parent_contest_id]],
|
|
1526
1536
|
)
|
|
1527
1537
|
)
|
|
@@ -1607,7 +1617,7 @@ class ContestContainsValidStartDate(base.DateRule):
|
|
|
1607
1617
|
def elements(self):
|
|
1608
1618
|
return ["Contest"]
|
|
1609
1619
|
|
|
1610
|
-
def check(self, element):
|
|
1620
|
+
def check(self, element: etree._Element) -> None:
|
|
1611
1621
|
self.reset_instance_vars()
|
|
1612
1622
|
self.gather_dates(element)
|
|
1613
1623
|
|
|
@@ -1628,7 +1638,7 @@ class ContestContainsValidEndDate(base.DateRule):
|
|
|
1628
1638
|
def elements(self):
|
|
1629
1639
|
return ["Contest"]
|
|
1630
1640
|
|
|
1631
|
-
def check(self, element):
|
|
1641
|
+
def check(self, element: etree._Element) -> None:
|
|
1632
1642
|
self.reset_instance_vars()
|
|
1633
1643
|
self.gather_dates(element)
|
|
1634
1644
|
|
|
@@ -1645,7 +1655,7 @@ class ContestEndDateOccursAfterStartDate(base.DateRule):
|
|
|
1645
1655
|
def elements(self):
|
|
1646
1656
|
return ["Contest"]
|
|
1647
1657
|
|
|
1648
|
-
def check(self, element):
|
|
1658
|
+
def check(self, element: etree._Element) -> None:
|
|
1649
1659
|
self.reset_instance_vars()
|
|
1650
1660
|
self.gather_dates(element)
|
|
1651
1661
|
|
|
@@ -1662,10 +1672,10 @@ class ContestEndDateOccursBeforeSubsequentContestStartDate(base.DateRule):
|
|
|
1662
1672
|
Contests have dates.
|
|
1663
1673
|
"""
|
|
1664
1674
|
|
|
1665
|
-
def elements(self):
|
|
1675
|
+
def elements(self) -> list[str]:
|
|
1666
1676
|
return ["ElectionReport"]
|
|
1667
1677
|
|
|
1668
|
-
def check(self, election_report_element):
|
|
1678
|
+
def check(self, election_report_element: etree._Element) -> None:
|
|
1669
1679
|
contest_by_contest_id = {}
|
|
1670
1680
|
dates_by_contest_id = {}
|
|
1671
1681
|
|
|
@@ -1695,13 +1705,10 @@ class ContestEndDateOccursBeforeSubsequentContestStartDate(base.DateRule):
|
|
|
1695
1705
|
if subsequent_contest_start < contest_end:
|
|
1696
1706
|
self.error_log.append(
|
|
1697
1707
|
loggers.LogEntry(
|
|
1698
|
-
"Contest {} with end date {} does
|
|
1699
|
-
"
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
subsequent_contest_id,
|
|
1703
|
-
subsequent_contest_start,
|
|
1704
|
-
),
|
|
1708
|
+
f"Contest {contest_id} with end date {contest_end} does"
|
|
1709
|
+
" not occur before subsequent contest"
|
|
1710
|
+
f" {subsequent_contest_id} with start date"
|
|
1711
|
+
f" {subsequent_contest_start}",
|
|
1705
1712
|
[contest, contest_by_contest_id[subsequent_contest_id]],
|
|
1706
1713
|
)
|
|
1707
1714
|
)
|
|
@@ -1720,7 +1727,7 @@ class ContestStartDateContainsCorrespondingEndDate(base.DateRule):
|
|
|
1720
1727
|
def elements(self):
|
|
1721
1728
|
return ["Contest"]
|
|
1722
1729
|
|
|
1723
|
-
def check(self, element):
|
|
1730
|
+
def check(self, element: etree._Element) -> None:
|
|
1724
1731
|
self.reset_instance_vars()
|
|
1725
1732
|
self.gather_dates(element)
|
|
1726
1733
|
|
|
@@ -1745,7 +1752,7 @@ class ValidatePollsCloseDatetimes(base.BaseRule):
|
|
|
1745
1752
|
def elements(self):
|
|
1746
1753
|
return ["Contest"]
|
|
1747
1754
|
|
|
1748
|
-
def check(self, element):
|
|
1755
|
+
def check(self, element: etree._Element) -> None:
|
|
1749
1756
|
earliest_polls_close_element = element.find("EarliestPollsClose")
|
|
1750
1757
|
latest_polls_close_element = element.find("LatestPollsClose")
|
|
1751
1758
|
|
|
@@ -1790,7 +1797,7 @@ class ValidateResultsExpected(base.BaseRule):
|
|
|
1790
1797
|
def elements(self):
|
|
1791
1798
|
return ["Contest"]
|
|
1792
1799
|
|
|
1793
|
-
def check(self, element):
|
|
1800
|
+
def check(self, element: etree._Element) -> None:
|
|
1794
1801
|
results_expected_element = element.find("ResultsExpected")
|
|
1795
1802
|
if not rule_util.element_has_text(results_expected_element):
|
|
1796
1803
|
return
|
|
@@ -1853,7 +1860,7 @@ class ValidateResultsEmbargoEnd(base.BaseRule):
|
|
|
1853
1860
|
def elements(self):
|
|
1854
1861
|
return ["Contest"]
|
|
1855
1862
|
|
|
1856
|
-
def check(self, element):
|
|
1863
|
+
def check(self, element: etree._Element) -> None:
|
|
1857
1864
|
results_embargo_end_element = element.find("ResultsEmbargoEnd")
|
|
1858
1865
|
if not rule_util.element_has_text(results_embargo_end_element):
|
|
1859
1866
|
return
|
|
@@ -1912,10 +1919,10 @@ class ValidateResultsEmbargoEnd(base.BaseRule):
|
|
|
1912
1919
|
class ResultsReportingStagesMustHaveUniqueType(base.BaseRule):
|
|
1913
1920
|
"""Checks that each ResultsReportingStage has a unique StageType per Contest."""
|
|
1914
1921
|
|
|
1915
|
-
def elements(self):
|
|
1922
|
+
def elements(self) -> list[str]:
|
|
1916
1923
|
return ["ResultsReportingStageCollection"]
|
|
1917
1924
|
|
|
1918
|
-
def check(self, element):
|
|
1925
|
+
def check(self, element: etree._Element) -> None:
|
|
1919
1926
|
stages_by_type = collections.defaultdict(list)
|
|
1920
1927
|
for stage in element.findall("ResultsReportingStage"):
|
|
1921
1928
|
stage_type_element = stage.find("StageType")
|
|
@@ -1940,10 +1947,10 @@ class ResultsReportingStagesMustHaveUniqueType(base.BaseRule):
|
|
|
1940
1947
|
class ValidateResultReportingStages(base.BaseRule):
|
|
1941
1948
|
"""Validates ResultsReportingStage elements in a stage collection."""
|
|
1942
1949
|
|
|
1943
|
-
def setup(self):
|
|
1950
|
+
def setup(self) -> None:
|
|
1944
1951
|
self.composing_contest_ids = self._get_composing_contest_ids()
|
|
1945
1952
|
|
|
1946
|
-
def _get_composing_contest_ids(self):
|
|
1953
|
+
def _get_composing_contest_ids(self) -> set[str]:
|
|
1947
1954
|
composing_contest_ids = set()
|
|
1948
1955
|
for contest in self.get_elements_by_class(self.election_tree, "Contest"):
|
|
1949
1956
|
composing_contest_ids_element = contest.find("ComposingContestIds")
|
|
@@ -1951,10 +1958,10 @@ class ValidateResultReportingStages(base.BaseRule):
|
|
|
1951
1958
|
composing_contest_ids.update(composing_contest_ids_element.text.split())
|
|
1952
1959
|
return composing_contest_ids
|
|
1953
1960
|
|
|
1954
|
-
def elements(self):
|
|
1961
|
+
def elements(self) -> list[str]:
|
|
1955
1962
|
return ["ResultsReportingStageCollection"]
|
|
1956
1963
|
|
|
1957
|
-
def check(self, element):
|
|
1964
|
+
def check(self, element: etree._Element) -> None:
|
|
1958
1965
|
inherit_from_composed = rule_util.is_xml_true(
|
|
1959
1966
|
element.find("InheritFromComposedContest")
|
|
1960
1967
|
)
|
|
@@ -2017,10 +2024,10 @@ class ValidateResultReportingStages(base.BaseRule):
|
|
|
2017
2024
|
class CandidateContestTypesAreCompatible(base.BaseRule):
|
|
2018
2025
|
"""CandidateContest Type values cannot have both a general and primary type."""
|
|
2019
2026
|
|
|
2020
|
-
def elements(self):
|
|
2027
|
+
def elements(self) -> list[str]:
|
|
2021
2028
|
return ["CandidateContest"]
|
|
2022
2029
|
|
|
2023
|
-
def check(self, element):
|
|
2030
|
+
def check(self, element: etree._Element) -> None:
|
|
2024
2031
|
primary_types = {
|
|
2025
2032
|
"primary",
|
|
2026
2033
|
"partisan-primary-open",
|
|
@@ -2037,10 +2044,9 @@ class CandidateContestTypesAreCompatible(base.BaseRule):
|
|
|
2037
2044
|
contest_types
|
|
2038
2045
|
):
|
|
2039
2046
|
raise loggers.ElectionError.from_message(
|
|
2040
|
-
"CandidateContest {} has incompatible
|
|
2041
|
-
" have both a general and primary
|
|
2042
|
-
|
|
2043
|
-
),
|
|
2047
|
+
f"CandidateContest {element.get('objectId')} has incompatible"
|
|
2048
|
+
" type values. A contest cannot have both a general and primary"
|
|
2049
|
+
" type.",
|
|
2044
2050
|
[element],
|
|
2045
2051
|
)
|
|
2046
2052
|
|
|
@@ -2048,10 +2054,10 @@ class CandidateContestTypesAreCompatible(base.BaseRule):
|
|
|
2048
2054
|
class NotEmptyUniqueDataSourceUris(base.BaseRule):
|
|
2049
2055
|
"""Checks that DataSource entities have globally unique URIs and they are not empty."""
|
|
2050
2056
|
|
|
2051
|
-
def elements(self):
|
|
2057
|
+
def elements(self) -> list[str]:
|
|
2052
2058
|
return ["DataSourceCollection"]
|
|
2053
2059
|
|
|
2054
|
-
def check(self, element):
|
|
2060
|
+
def check(self, element: etree._Element) -> None:
|
|
2055
2061
|
data_source_ids_by_uri = collections.defaultdict(set)
|
|
2056
2062
|
error_log = []
|
|
2057
2063
|
|
|
@@ -2061,7 +2067,7 @@ class NotEmptyUniqueDataSourceUris(base.BaseRule):
|
|
|
2061
2067
|
if not rule_util.element_has_text(uri_element):
|
|
2062
2068
|
error_log.append(
|
|
2063
2069
|
loggers.LogEntry(
|
|
2064
|
-
"DataSource {} has an empty Uri."
|
|
2070
|
+
f"DataSource {datasource_id} has an empty Uri.",
|
|
2065
2071
|
[data_source],
|
|
2066
2072
|
)
|
|
2067
2073
|
)
|
|
@@ -2080,9 +2086,8 @@ class NotEmptyUniqueDataSourceUris(base.BaseRule):
|
|
|
2080
2086
|
]
|
|
2081
2087
|
error_log.append(
|
|
2082
2088
|
loggers.LogEntry(
|
|
2083
|
-
"DataSource entities {} have
|
|
2084
|
-
|
|
2085
|
-
),
|
|
2089
|
+
f"DataSource entities {', '.join(data_source_ids)} have"
|
|
2090
|
+
f" duplicate Uri '{uri}'.",
|
|
2086
2091
|
sorted_data_sources,
|
|
2087
2092
|
)
|
|
2088
2093
|
)
|
|
@@ -2094,10 +2099,10 @@ class NotEmptyUniqueDataSourceUris(base.BaseRule):
|
|
|
2094
2099
|
class UniqueDataSourceLanguages(base.BaseRule):
|
|
2095
2100
|
"""Checks that Uri elements have unique languages within a DataSource."""
|
|
2096
2101
|
|
|
2097
|
-
def elements(self):
|
|
2102
|
+
def elements(self) -> list[str]:
|
|
2098
2103
|
return ["DataSource"]
|
|
2099
2104
|
|
|
2100
|
-
def check(self, element):
|
|
2105
|
+
def check(self, element: etree._Element) -> None:
|
|
2101
2106
|
error_log = []
|
|
2102
2107
|
data_source_id = element.get("objectId")
|
|
2103
2108
|
seen_uri_languages = set()
|
|
@@ -2131,10 +2136,10 @@ class UniqueDataSourceLanguages(base.BaseRule):
|
|
|
2131
2136
|
class UniqueDataSourceDisplayNames(base.BaseRule):
|
|
2132
2137
|
"""Checks that DataSource entities have globally unique DisplayNames."""
|
|
2133
2138
|
|
|
2134
|
-
def elements(self):
|
|
2139
|
+
def elements(self) -> list[str]:
|
|
2135
2140
|
return ["DataSourceCollection"]
|
|
2136
2141
|
|
|
2137
|
-
def check(self, element):
|
|
2142
|
+
def check(self, element: etree._Element) -> None:
|
|
2138
2143
|
data_source_ids_by_name = collections.defaultdict(set)
|
|
2139
2144
|
error_log = []
|
|
2140
2145
|
|
|
@@ -2145,8 +2150,8 @@ class UniqueDataSourceDisplayNames(base.BaseRule):
|
|
|
2145
2150
|
if not rule_util.element_has_text(text_element):
|
|
2146
2151
|
error_log.append(
|
|
2147
2152
|
loggers.LogEntry(
|
|
2148
|
-
"DataSource {} has a DisplayName element
|
|
2149
|
-
" text."
|
|
2153
|
+
f"DataSource {data_source_id} has a DisplayName element"
|
|
2154
|
+
" without text.",
|
|
2150
2155
|
[data_source],
|
|
2151
2156
|
)
|
|
2152
2157
|
)
|
|
@@ -2163,9 +2168,8 @@ class UniqueDataSourceDisplayNames(base.BaseRule):
|
|
|
2163
2168
|
datasource_ids = [ds.get("objectId") for ds in sorted_data_sources]
|
|
2164
2169
|
error_log.append(
|
|
2165
2170
|
loggers.LogEntry(
|
|
2166
|
-
"DataSource entities {} have
|
|
2167
|
-
|
|
2168
|
-
),
|
|
2171
|
+
f"DataSource entities {', '.join(datasource_ids)} have"
|
|
2172
|
+
f" duplicate DisplayName '{name_text}'.",
|
|
2169
2173
|
sorted_data_sources,
|
|
2170
2174
|
)
|
|
2171
2175
|
)
|
|
@@ -2174,7 +2178,7 @@ class UniqueDataSourceDisplayNames(base.BaseRule):
|
|
|
2174
2178
|
raise loggers.ElectionError(error_log)
|
|
2175
2179
|
|
|
2176
2180
|
|
|
2177
|
-
def _get_attribution_depth(element):
|
|
2181
|
+
def _get_attribution_depth(element: etree._Element) -> int:
|
|
2178
2182
|
"""Helper to recursively get the maximum depth of an Attribution tree."""
|
|
2179
2183
|
children = element.findall("Attribution")
|
|
2180
2184
|
if not children:
|
|
@@ -2182,7 +2186,7 @@ def _get_attribution_depth(element):
|
|
|
2182
2186
|
return 1 + max(_get_attribution_depth(child) for child in children)
|
|
2183
2187
|
|
|
2184
2188
|
|
|
2185
|
-
def _get_datasource_id(element):
|
|
2189
|
+
def _get_datasource_id(element: etree._Element) -> str:
|
|
2186
2190
|
"""Helper to safely extract and strip the text of the DataSourceId child."""
|
|
2187
2191
|
ds_element = element.find("DataSourceId")
|
|
2188
2192
|
return (
|
|
@@ -2193,10 +2197,10 @@ def _get_datasource_id(element):
|
|
|
2193
2197
|
class AttributionDepthLimit(base.BaseRule):
|
|
2194
2198
|
"""Checks that each top-level Attribution in a ResultsReportingStage has at most three levels of depth."""
|
|
2195
2199
|
|
|
2196
|
-
def elements(self):
|
|
2200
|
+
def elements(self) -> list[str]:
|
|
2197
2201
|
return ["ResultsReportingStage"]
|
|
2198
2202
|
|
|
2199
|
-
def check(self, element):
|
|
2203
|
+
def check(self, element: etree._Element) -> None:
|
|
2200
2204
|
error_log = []
|
|
2201
2205
|
# This findall query is non-recursive and only returns direct children.
|
|
2202
2206
|
for attribution in element.findall("Attribution"):
|
|
@@ -2214,7 +2218,7 @@ class AttributionDepthLimit(base.BaseRule):
|
|
|
2214
2218
|
raise loggers.ElectionError(error_log)
|
|
2215
2219
|
|
|
2216
2220
|
|
|
2217
|
-
def _canonicalize_cycle(cycle):
|
|
2221
|
+
def _canonicalize_cycle(cycle: list[str]) -> list[str]:
|
|
2218
2222
|
"""Canonicalizes a cycle by rotating it to start with the min element."""
|
|
2219
2223
|
if not cycle:
|
|
2220
2224
|
return []
|
|
@@ -2226,7 +2230,7 @@ def _canonicalize_cycle(cycle):
|
|
|
2226
2230
|
class AttributionContainsNoCycles(base.TreeRule):
|
|
2227
2231
|
"""Checks that there are no cycles between Attribution elements."""
|
|
2228
2232
|
|
|
2229
|
-
def check(self):
|
|
2233
|
+
def check(self) -> None:
|
|
2230
2234
|
graph = networkx.DiGraph()
|
|
2231
2235
|
|
|
2232
2236
|
attributions = self.get_elements_by_class(self.election_tree, "Attribution")
|
|
@@ -2287,7 +2291,7 @@ class ValidateSpecialBallotSelectionCountedInTotal(base.BaseRule):
|
|
|
2287
2291
|
AggregateBallotSelection must not have this set.
|
|
2288
2292
|
"""
|
|
2289
2293
|
|
|
2290
|
-
def elements(self):
|
|
2294
|
+
def elements(self) -> list[str]:
|
|
2291
2295
|
return [
|
|
2292
2296
|
"BlankBallotSelection",
|
|
2293
2297
|
"NullBallotSelection",
|
|
@@ -2295,7 +2299,7 @@ class ValidateSpecialBallotSelectionCountedInTotal(base.BaseRule):
|
|
|
2295
2299
|
"AggregateBallotSelection",
|
|
2296
2300
|
]
|
|
2297
2301
|
|
|
2298
|
-
def check(self, element):
|
|
2302
|
+
def check(self, element: etree._Element) -> None:
|
|
2299
2303
|
counted_in_total = element.find("CountedInTotal")
|
|
2300
2304
|
tag = element.tag
|
|
2301
2305
|
|
|
@@ -2325,10 +2329,12 @@ class ValidateIncludeInAggregationBallotSelections(base.BaseRule):
|
|
|
2325
2329
|
the AggregateBallotSelection must also be present on that Contest.
|
|
2326
2330
|
"""
|
|
2327
2331
|
|
|
2328
|
-
def elements(self):
|
|
2332
|
+
def elements(self) -> list[str]:
|
|
2329
2333
|
return ["CandidateContest", "PartyContest"]
|
|
2330
2334
|
|
|
2331
|
-
def _gather_vote_counts(
|
|
2335
|
+
def _gather_vote_counts(
|
|
2336
|
+
self, element: etree._Element
|
|
2337
|
+
) -> collections.defaultdict[tuple[str, str], float]:
|
|
2332
2338
|
"""Gathers vote counts from a selection element grouped by type."""
|
|
2333
2339
|
count_by_type_and_gp_unit = collections.defaultdict(float)
|
|
2334
2340
|
vote_counts_collection = element.find("VoteCountsCollection")
|
|
@@ -2354,7 +2360,7 @@ class ValidateIncludeInAggregationBallotSelections(base.BaseRule):
|
|
|
2354
2360
|
|
|
2355
2361
|
return count_by_type_and_gp_unit
|
|
2356
2362
|
|
|
2357
|
-
def check(self, element):
|
|
2363
|
+
def check(self, element: etree._Element) -> None:
|
|
2358
2364
|
contest_id = element.get("objectId")
|
|
2359
2365
|
|
|
2360
2366
|
candidate_selections = self.get_elements_by_class(
|
civics_cdf_validator/version.py
CHANGED
{civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/RECORD
RENAMED
|
@@ -6,20 +6,20 @@ civics_cdf_validator/office_utils.py,sha256=4r0zc6-UB2YdqmUnGznEn5K5WLFRsQNQr-QM
|
|
|
6
6
|
civics_cdf_validator/rules.py,sha256=J9a77RTXVaXEHBfH0Nrv9rAckOrGOkQMbSTMmUME6G8,2208
|
|
7
7
|
civics_cdf_validator/stats.py,sha256=nVo2rGccls2ot8uKVNqHA5r1clUyjB1ht_HUhQQ05_c,3924
|
|
8
8
|
civics_cdf_validator/validator.py,sha256=YqmbXlBjV3O4m8C_9jlAahrqIt86p9ACL_zWp00tkkg,14211
|
|
9
|
-
civics_cdf_validator/version.py,sha256=
|
|
9
|
+
civics_cdf_validator/version.py,sha256=FPsLo73vQLR_8GdodEC7IGfgMzI9m_E7VqWKzbL4tes,188
|
|
10
10
|
civics_cdf_validator/rulesets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
civics_cdf_validator/rulesets/committee_rules.py,sha256=kKOkO7Yb1vLJvlQRCLl6HwMvMHPbePN1w0kpMDXcYCU,3601
|
|
12
12
|
civics_cdf_validator/rulesets/common_rules.py,sha256=0CFMwrrlWs5O95hh4wh_MHxvkzWa1PqIPSzRzDyCcuI,74514
|
|
13
13
|
civics_cdf_validator/rulesets/election_dates_rules.py,sha256=UIB5yLZ3KZleRyR8avsREF78dhcAVaod381sKq0bKoY,1463
|
|
14
14
|
civics_cdf_validator/rulesets/election_results_rules.py,sha256=Qh_0lTi0ueo_NiKU8dcbx0ELOtWGawkWxarphClpwKU,1901
|
|
15
|
-
civics_cdf_validator/rulesets/election_rules.py,sha256=
|
|
15
|
+
civics_cdf_validator/rulesets/election_rules.py,sha256=klliyhnCsBrg9e6Oo2fUcr1NUh14LtO2b0Jd5dkcPrw,88422
|
|
16
16
|
civics_cdf_validator/rulesets/metadata_rules.py,sha256=iU7x34hvI_jxzPZmi1VYS2F2fRqMLcX8QCcAMFm6j6M,16545
|
|
17
17
|
civics_cdf_validator/rulesets/officeholder_rules.py,sha256=XDnGOZ505pVjEw4FoQ4ec6ro5-RZNhwxC_B6-Skuq8Y,17533
|
|
18
18
|
civics_cdf_validator/rulesets/rule_util.py,sha256=fRAnJG1ILgBdC_nQglj1XU7pcqyfb4Z4l_sa6gmi238,4824
|
|
19
19
|
civics_cdf_validator/rulesets/voter_information_rules.py,sha256=9Y3X9AWIVuKyoVWCohLdGNzqIV3nbwDWUKjxcWwjuEI,4991
|
|
20
|
-
civics_cdf_validator-1.
|
|
21
|
-
civics_cdf_validator-1.
|
|
22
|
-
civics_cdf_validator-1.
|
|
23
|
-
civics_cdf_validator-1.
|
|
24
|
-
civics_cdf_validator-1.
|
|
25
|
-
civics_cdf_validator-1.
|
|
20
|
+
civics_cdf_validator-1.69.dev2.dist-info/licenses/LICENSE-2.0.txt,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
21
|
+
civics_cdf_validator-1.69.dev2.dist-info/METADATA,sha256=ENkcY-Z3HBc0MHJ_No71jqaWjhAnPAKURsKDFMg1U7g,1280
|
|
22
|
+
civics_cdf_validator-1.69.dev2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
23
|
+
civics_cdf_validator-1.69.dev2.dist-info/entry_points.txt,sha256=QibgvtMOocwDi7fQ1emgMJ2lIlI41sW0__KIQdnVn90,77
|
|
24
|
+
civics_cdf_validator-1.69.dev2.dist-info/top_level.txt,sha256=PYT5Eclxbop5o6DJIcgs4IeU6Ds5jqyftjoFbgkkJYo,21
|
|
25
|
+
civics_cdf_validator-1.69.dev2.dist-info/RECORD,,
|
{civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{civics_cdf_validator-1.68.dev18.dist-info → civics_cdf_validator-1.69.dev2.dist-info}/top_level.txt
RENAMED
|
File without changes
|