Skip to content

Commit 645f4f7

Browse files
committed
black reformat
1 parent 6043305 commit 645f4f7

3 files changed

Lines changed: 34 additions & 32 deletions

File tree

src/electiondata/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,13 +3012,13 @@ def export_nist(
30123012
) -> Union[str, Dict[str, Any]]:
30133013
"""picks either json or xml based on value of constants.nist_version"""
30143014
if electiondata.constants.default_nist_format == "json":
3015-
return self.export_nist_json(election,jurisdiction)
3015+
return self.export_nist_json(election, jurisdiction)
30163016
elif electiondata.constants.default_nist_format == "xml":
3017-
return self.export_nist_xml_as_string(election,jurisdiction)
3017+
return self.export_nist_xml_as_string(election, jurisdiction)
30183018
else:
30193019
return ""
30203020

3021-
def export_nist_json(self,election: str,jurisdiction: str) -> Dict[str,Any]:
3021+
def export_nist_json(self, election: str, jurisdiction: str) -> Dict[str, Any]:
30223022
election_id = db.name_to_id(self.session, "Election", election)
30233023
jurisdiction_id = db.name_to_id(self.session, "ReportingUnit", jurisdiction)
30243024

@@ -3051,7 +3051,7 @@ def export_nist_json_as_string(
30513051
jurisdiction: str,
30523052
) -> str:
30533053
"""exports NIST v2 json string"""
3054-
json_string = json.dumps(self.export_nist_json(election,jurisdiction))
3054+
json_string = json.dumps(self.export_nist_json(election, jurisdiction))
30553055
return json_string
30563056

30573057
def export_nist_xml_as_string(

src/electiondata/munge/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,10 @@ def add_contest_id(
743743
# fail if fatal errors or no contests recognized (in reverse order, just for fun
744744
if working_temp.empty:
745745
err = ui.add_new_error(
746-
err, "jurisdiction", juris_true_name,
747-
f"No contests recognized from file {file_name} with munger {munger_name}."
746+
err,
747+
"jurisdiction",
748+
juris_true_name,
749+
f"No contests recognized from file {file_name} with munger {munger_name}.",
748750
)
749751
else:
750752
working = working_temp

tests/analyzer_tests/test_analyzer.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_contest_type_display(analyzer):
7070
analyzer.display_options("contest_type", filters=["2018 General", "Georgia"]),
7171
sort_key="order_by",
7272
)
73-
expected = dict_sort(results.ga_2018_contest_types,sort_key="order_by")
73+
expected = dict_sort(results.ga_2018_contest_types, sort_key="order_by")
7474
assert new == expected
7575

7676

@@ -80,16 +80,16 @@ def test_contest_display(analyzer):
8080
filters=["2018 General", "Georgia", "Congressional"],
8181
)
8282
new = dict_sort(contests, sort_key="order_by")
83-
expected = dict_sort(results.ga_2018_congressional_contests,sort_key="order_by")
83+
expected = dict_sort(results.ga_2018_congressional_contests, sort_key="order_by")
8484
assert new == expected
8585

8686

8787
def test_bar_congressional(analyzer):
8888
assert (
89-
analyzer.bar(
89+
analyzer.bar(
9090
"2018 General", "Georgia", "Congressional", "US House GA District 3"
9191
)
92-
== results.ga_2018_bar_congressional
92+
== results.ga_2018_bar_congressional
9393
)
9494

9595

@@ -111,17 +111,17 @@ def test_bar_congressional(analyzer):
111111

112112
def test_bar_all_state(analyzer):
113113
assert (
114-
analyzer.bar("2018 General", "North Carolina", "State House", "All State House")
115-
== results.nc_2018_bar_statehouse
114+
analyzer.bar("2018 General", "North Carolina", "State House", "All State House")
115+
== results.nc_2018_bar_statehouse
116116
)
117117

118118

119119
def test_bar_all_congressional(analyzer):
120120
assert (
121-
analyzer.bar(
121+
analyzer.bar(
122122
"2018 General", "North Carolina", "Congressional", "All Congressional"
123123
)
124-
== results.nc_2018_bar_congressional
124+
== results.nc_2018_bar_congressional
125125
)
126126

127127

@@ -133,7 +133,7 @@ def test_category_display(analyzer):
133133
),
134134
sort_key="order_by",
135135
)
136-
expected = dict_sort(results.nc_2018_category,sort_key="order_by")
136+
expected = dict_sort(results.nc_2018_category, sort_key="order_by")
137137
assert new == expected
138138

139139

@@ -145,13 +145,13 @@ def test_count_display(analyzer):
145145
),
146146
sort_key="order_by",
147147
)
148-
expected = dict_sort(results.ga_2018_count,sort_key="order_by")
148+
expected = dict_sort(results.ga_2018_count, sort_key="order_by")
149149
assert new == expected
150150

151151

152152
def test_scatter_candidates(analyzer):
153153
assert (
154-
analyzer.scatter(
154+
analyzer.scatter(
155155
"Georgia",
156156
"2018 General",
157157
"Candidate total",
@@ -160,13 +160,13 @@ def test_scatter_candidates(analyzer):
160160
"Candidate total",
161161
"Charlie Bailey",
162162
)
163-
== results.ga_2018_scatter_candidates
163+
== results.ga_2018_scatter_candidates
164164
)
165165

166166

167167
def test_scatter_candidates_longname(analyzer):
168168
assert (
169-
analyzer.scatter(
169+
analyzer.scatter(
170170
"Georgia",
171171
"2018 General",
172172
"Candidate total",
@@ -175,13 +175,13 @@ def test_scatter_candidates_longname(analyzer):
175175
"Candidate total",
176176
"Charlie Bailey - D - GAAttGen",
177177
)
178-
== results.ga_2018_scatter_candidates
178+
== results.ga_2018_scatter_candidates
179179
)
180180

181181

182182
def test_scatter_candidates_votetype(analyzer):
183183
assert (
184-
analyzer.scatter(
184+
analyzer.scatter(
185185
"Georgia",
186186
"2018 General",
187187
"Candidate absentee-mail",
@@ -190,13 +190,13 @@ def test_scatter_candidates_votetype(analyzer):
190190
"Candidate election-day",
191191
"Stacey Abrams",
192192
)
193-
== results.ga_2018_scatter_candidates_votetype
193+
== results.ga_2018_scatter_candidates_votetype
194194
)
195195

196196

197197
def test_scatter_multi_election(analyzer):
198198
assert (
199-
analyzer.scatter(
199+
analyzer.scatter(
200200
"Georgia",
201201
"2018 General",
202202
"Contest total",
@@ -205,13 +205,13 @@ def test_scatter_multi_election(analyzer):
205205
"Contest total",
206206
"US House GA District 14",
207207
)
208-
== results.ga_multi_election
208+
== results.ga_multi_election
209209
)
210210

211211

212212
def test_scatter_party(analyzer):
213213
assert (
214-
analyzer.scatter(
214+
analyzer.scatter(
215215
"Georgia",
216216
"2018 General",
217217
"Party total",
@@ -220,13 +220,13 @@ def test_scatter_party(analyzer):
220220
"Party total",
221221
"Democratic State House",
222222
)
223-
== results.ga_2018_scatter_party
223+
== results.ga_2018_scatter_party
224224
)
225225

226226

227227
def test_scatter_party_votetype(analyzer):
228228
assert (
229-
analyzer.scatter(
229+
analyzer.scatter(
230230
"Georgia",
231231
"2018 General",
232232
"Party absentee-mail",
@@ -235,14 +235,14 @@ def test_scatter_party_votetype(analyzer):
235235
"Candidate absentee-mail",
236236
"Stacey Abrams",
237237
)
238-
== results.ga_2018_scatter_party_votetype
238+
== results.ga_2018_scatter_party_votetype
239239
)
240240

241241

242242
# check that rollup_dataframe to county level works correctly
243243
def test_scatter_county_rollup(analyzer):
244244
assert (
245-
analyzer.scatter(
245+
analyzer.scatter(
246246
"North Carolina",
247247
"2018 General",
248248
"Candidate total",
@@ -251,7 +251,7 @@ def test_scatter_county_rollup(analyzer):
251251
"Candidate total",
252252
"Dan McCready - D - USHouse9",
253253
)
254-
== results.nc_2018_scatter_county_rollup
254+
== results.nc_2018_scatter_county_rollup
255255
)
256256

257257

@@ -264,7 +264,7 @@ def test_candidate_search_display(analyzer):
264264
),
265265
sort_key="order_by",
266266
)
267-
expected = dict_sort(results.ga_2018_candidate_search_display,sort_key="order_by")
267+
expected = dict_sort(results.ga_2018_candidate_search_display, sort_key="order_by")
268268
assert new == expected
269269

270270

@@ -276,7 +276,7 @@ def test_count_contest_display(analyzer):
276276
),
277277
sort_key="order_by",
278278
)
279-
expected = dict_sort(results.ga_2018_count_contest,sort_key="order_by")
279+
expected = dict_sort(results.ga_2018_count_contest, sort_key="order_by")
280280
assert new == expected
281281

282282

0 commit comments

Comments
 (0)