From 9413eadd02a4c4fbe6c5df7cc5093471fe264a3b Mon Sep 17 00:00:00 2001 From: peterrrock2 Date: Tue, 25 Jun 2024 09:26:01 -0600 Subject: [PATCH] Fix small bug in _parse_geo_response and add some doc strings --- gerrydb/repos/geography.py | 1 + gerrydb/repos/graph.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gerrydb/repos/geography.py b/gerrydb/repos/geography.py index e725691..c195c27 100644 --- a/gerrydb/repos/geography.py +++ b/gerrydb/repos/geography.py @@ -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 diff --git a/gerrydb/repos/graph.py b/gerrydb/repos/graph.py index 117ee9b..609f533 100644 --- a/gerrydb/repos/graph.py +++ b/gerrydb/repos/graph.py @@ -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`). @@ -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}",