Skip to content

Commit 61cf565

Browse files
committed
remove unused code
1 parent c36214c commit 61cf565

File tree

5 files changed

+3
-36269
lines changed

5 files changed

+3
-36269
lines changed

doctor_visits/delphi_doctor_visits/geo_maps.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
class GeoMaps:
2222
"""Class to map counties to other geographic resolutions."""
2323

24-
def __init__(self, geo_filepath):
25-
self.geo_filepath = geo_filepath
24+
def __init__(self):
2625
self.gmpr = GeoMapper()
2726

2827
@staticmethod
@@ -38,13 +37,6 @@ def county_to_msa(self, data):
3837
3938
Returns: tuple of dataframe at the daily-msa resolution, and the geo_id column name
4039
"""
41-
msa_map = pd.read_csv(
42-
join(self.geo_filepath, "02_20_uszips.csv"),
43-
usecols=["fips", "cbsa_id"],
44-
dtype={"cbsa_id": float},
45-
converters={"fips": GeoMaps.convert_fips},
46-
)
47-
msa_map.drop_duplicates(inplace=True)
4840
data = self.gmpr.add_geocode(data,
4941
"fips",
5042
"msa",
@@ -63,14 +55,6 @@ def county_to_state(self, data):
6355
6456
Returns: tuple of dataframe at the daily-state resolution, and geo_id column name
6557
"""
66-
67-
state_map = pd.read_csv(
68-
join(self.geo_filepath, "02_20_uszips.csv"),
69-
usecols=["fips", "state_id"],
70-
dtype={"state_id": str},
71-
converters={"fips": GeoMaps.convert_fips},
72-
)
73-
state_map.drop_duplicates(inplace=True)
7458
data = self.gmpr.add_geocode(data,
7559
"fips",
7660
"state_id",
@@ -94,21 +78,6 @@ def county_to_hrr(self, data):
9478
tuple of (data frame at daily-HRR resolution, geo_id column name)
9579
9680
"""
97-
98-
hrr_map = pd.read_csv(
99-
join(self.geo_filepath, "transfipsToHRR.csv"),
100-
converters={"fips": GeoMaps.convert_fips},
101-
)
102-
103-
## Each row is one FIPS. Columns [3:] are HRR numbers, consecutively.
104-
## Entries are the proportion of the county contained in the HRR, so rows
105-
## sum to 1.
106-
107-
## Drop county and state names -- not needed here.
108-
hrr_map.drop(columns=["county_name", "state_id"], inplace=True)
109-
110-
hrr_map = hrr_map.melt(["fips"], var_name="hrr", value_name="wpop")
111-
hrr_map = hrr_map[hrr_map["wpop"] > 0]
11281
data = self.gmpr.add_geocode(data,
11382
"fips",
11483
"hrr",

doctor_visits/delphi_doctor_visits/update_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def update_sensor(
143143
jeffreys = True if se else False
144144

145145
# get right geography
146-
geo_map = GeoMaps(staticpath)
146+
geo_map = GeoMaps()
147147
if geo.lower() == "county":
148148
data_groups, _ = geo_map.county_to_megacounty(
149149
data, Config.MIN_RECENT_VISITS, Config.RECENT_LENGTH

0 commit comments

Comments
 (0)