From baebd1a8bd1b86ab3b3e18747bd465c7f77fbccc Mon Sep 17 00:00:00 2001 From: Martin Vonk Date: Fri, 24 May 2024 16:30:22 +0200 Subject: [PATCH] add requests --- pyproject.toml | 1 + src/pedon/soil.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2eaf0e3..187978a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ numpy = "*" pandas = "*" matplotlib = "*" scipy = "*" +requests = "^2.32.2" [tool.poetry.group.dev.dependencies] tox = "^4.15.0" diff --git a/src/pedon/soil.py b/src/pedon/soil.py index b12e12e..ec4e373 100644 --- a/src/pedon/soil.py +++ b/src/pedon/soil.py @@ -368,14 +368,16 @@ def rosetta(self, rosetta_version: int = 3) -> Genuchten: ] data = {"soildata": [soildata]} - rjson = requests.post(f"http://www.handbook60.org/api/v1/rosetta/{rosetta_version}", json=data) + rjson = requests.post( + f"http://www.handbook60.org/api/v1/rosetta/{rosetta_version}", json=data + ) vgpar = rjson["van_genuchten_params"][0] return Genuchten( - k_s=10**vgpar[4], + k_s=10 ** vgpar[4], theta_r=vgpar[0], theta_s=vgpar[1], - alpha=10**vgpar[2], - n=10**vgpar1[3], + alpha=10 ** vgpar[2], + n=10 ** vgpar1[3], )