Skip to content

Commit

Permalink
add requests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonk committed May 24, 2024
1 parent eb97fc5 commit baebd1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ numpy = "*"
pandas = "*"
matplotlib = "*"
scipy = "*"
requests = "^2.32.2"

[tool.poetry.group.dev.dependencies]
tox = "^4.15.0"
Expand Down
10 changes: 6 additions & 4 deletions src/pedon/soil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
)


Expand Down

0 comments on commit baebd1a

Please sign in to comment.