Skip to content

Commit f74aefd

Browse files
committed
linting
1 parent a1c491c commit f74aefd

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

_delphi_utils_python/delphi_utils/geomap.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"""
1010
# pylint: disable=too-many-lines
1111
from os.path import join
12+
from collections import defaultdict
1213

1314
import pandas as pd
1415
import pkg_resources
1516
from pandas.api.types import is_string_dtype
16-
from collections import defaultdict
1717

1818

1919
class GeoMapper: # pylint: disable=too-many-public-methods
@@ -121,11 +121,11 @@ def __init__(self, census_year=2020):
121121
# Include all unique geos from first-level and second-level keys in
122122
# CROSSWALK_FILENAMES, with a few exceptions
123123
self._geos = {
124-
subkey for mainkey in self.CROSSWALK_FILENAMES.keys()
125-
for subkey in self.CROSSWALK_FILENAMES[mainkey].keys()
126-
}.union({
127-
mainkey for mainkey in self.CROSSWALK_FILENAMES.keys()
128-
}) - set(["state", "pop", "jhu_uid"])
124+
subkey for mainkey in self.CROSSWALK_FILENAMES
125+
for subkey in self.CROSSWALK_FILENAMES[mainkey]
126+
}.union(
127+
set(self.CROSSWALK_FILENAMES.keys())
128+
) - set(["state", "pop", "jhu_uid"])
129129

130130
for from_code, to_codes in self.CROSSWALK_FILENAMES.items():
131131
for to_code, file_path in to_codes.items():
@@ -590,17 +590,13 @@ def get_geos_within(self, container_geocode, contained_geocode_type, container_g
590590
crosswalk_state = self._crosswalks["fips"]["state"]
591591
fips_hhs = crosswalk_hhs[crosswalk_hhs["hhs"] == container_geocode]["fips"]
592592
return set(crosswalk_state[crosswalk_state["fips"].isin(fips_hhs)]["state_id"])
593-
elif (
594-
(
595-
contained_geocode_type == "county" or
596-
contained_geocode_type == "fips" or
597-
contained_geocode_type == "popsafe-fips"
598-
) and
599-
container_geocode_type == "state"
600-
):
593+
elif (contained_geocode_type in ("county", "fips", "popsafe-fips") and
594+
container_geocode_type == "state"):
601595
contained_geocode_type = self.as_mapper_name(contained_geocode_type)
602596
crosswalk = self._crosswalks[contained_geocode_type]["state"]
603-
return set(crosswalk[crosswalk["state_id"] == container_geocode][contained_geocode_type])
597+
return set(
598+
crosswalk[crosswalk["state_id"] == container_geocode][contained_geocode_type]
599+
)
604600
raise ValueError("(contained_geocode_type, container_geocode_type) was "
605601
f"({contained_geocode_type}, {container_geocode_type}), but "
606602
"must be one of (state, nation), (state, hhs), (county, state)"

_delphi_utils_python/tests/test_geomap.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import pandas as pd
66
import numpy as np
7-
import pdb
87

98

109
@pytest.fixture(scope="class")

0 commit comments

Comments
 (0)