Skip to content

Commit

Permalink
fixup! Update import scripts to handle 2010 constituencies again
Browse files Browse the repository at this point in the history
  • Loading branch information
zarino committed Nov 18, 2024
1 parent f3b294d commit 94f3f0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hub/management/commands/import_area_countries.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def add_arguments(self, parser):
"WMC23": {
"mapit_types": ["WMC"],
"mapit_generation": None,
}
},
}

options = [
Expand Down Expand Up @@ -64,7 +64,7 @@ def get_dataframe(self):
mapit_client = MapIt()
areas = mapit_client.areas_of_type(
self.mapit_types[self.area_type]["mapit_types"],
generation=self.mapit_types[self.area_type]["mapit_generation"]
generation=self.mapit_types[self.area_type]["mapit_generation"],
)
types = []
for area in areas:
Expand Down
4 changes: 3 additions & 1 deletion hub/management/commands/import_areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def add_arguments(self, parser):
def handle(self, quiet: bool = False, diagnostics: bool = False, *args, **options):
mapit_client = MapIt()
for b_type in self.boundary_types:
areas = mapit_client.areas_of_type(b_type["mapit_type"], generation=b_type["mapit_generation"])
areas = mapit_client.areas_of_type(
b_type["mapit_type"], generation=b_type["mapit_generation"]
)
if diagnostics:
print(
f"fetched mapit areas with type {b_type['mapit_type']}, generation {b_type['mapit_generation']}, our type {b_type['code']}"
Expand Down
2 changes: 1 addition & 1 deletion hub/management/commands/import_council_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def get_dataframe(self):
mapit_client = MapIt()
areas = mapit_client.areas_of_type(
self.mapit_types[self.area_type]["mapit_type"],
generation=self.mapit_types[self.area_type]["mapit_generation"]
generation=self.mapit_types[self.area_type]["mapit_generation"],
)
types = []
for area in areas:
Expand Down

0 comments on commit 94f3f0a

Please sign in to comment.