Skip to content

Commit

Permalink
Fix small bug in _parse_geo_response and add some doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrrock2 committed Jun 25, 2024
1 parent 5ac3752 commit 9413ead
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions gerrydb/repos/geography.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def _parse_geo_response(response: httpx.Response) -> list[Geography]:
response_geos = []
for response_geo in msgpack.loads(response.content):
response_geo["geography"] = shapely.wkb.loads(response_geo["geography"])
response_geo["internal_point"] = shapely.wkb.loads(response_geo["internal_point"])
response_geos.append(Geography(**response_geo))
return response_geos

Expand Down
6 changes: 4 additions & 2 deletions gerrydb/repos/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def create(
description: str,
proj: Optional[str] = None,
) -> Graph:
"""Imports a dual graph from a NetworkX graph.
"""
Imports a dual graph from a NetworkX graph.
Args:
path: A short identifier for the graph (e.g. `iowa_counties_rook`).
Expand All @@ -49,7 +50,8 @@ def create(
or if the parameters fail validation.
Returns:
The new districting plan.
The new districting plan in the form of a gerrydb `Graph` schema
object.
"""
response = self.ctx.client.post(
f"{self.base_url}/{namespace}",
Expand Down

0 comments on commit 9413ead

Please sign in to comment.