Skip to content

Commit

Permalink
Convert input to co2spec to ppm
Browse files Browse the repository at this point in the history
  • Loading branch information
haralde committed Feb 13, 2025
1 parent 2a71e8f commit 0b8b35d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion backend/src/acidwatch_api/models/arcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def convert_to_arcs_simulation_request(
async def post_arcs_run(
simulation_request: SimulationRequest,
jwt_token: Annotated[str, oauth2_scheme],
) -> dict:
) -> SimulationResults:
arcs_simulation_request = convert_to_arcs_simulation_request(simulation_request)
async with httpx.AsyncClient() as client:
res = await client.post(
Expand Down
16 changes: 8 additions & 8 deletions backend/src/acidwatch_api/models/co2spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ class RunReactionResult(BaseModel):

def convert_to_concentrations(simulation_request: SimulationRequest) -> Concentrations:
return Concentrations(
h2o=simulation_request.concs.get("H2O", 0.0),
o2=simulation_request.concs.get("O2", 0.0),
so2=simulation_request.concs.get("SO2", 0.0),
no2=simulation_request.concs.get("NO2", 0.0),
h2s=simulation_request.concs.get("H2S", 0.0),
no=simulation_request.concs.get("NO", 0.0),
h2so4=simulation_request.concs.get("H2SO4", 0.0),
hno3=simulation_request.concs.get("HNO3", 0.0),
h2o=simulation_request.concs.get("H2O", 0.0) * 1e6,
o2=simulation_request.concs.get("O2", 0.0) * 1e6,
so2=simulation_request.concs.get("SO2", 0.0) * 1e6,
no2=simulation_request.concs.get("NO2", 0.0) * 1e6,
h2s=simulation_request.concs.get("H2S", 0.0) * 1e6,
no=simulation_request.concs.get("NO", 0.0) * 1e6,
h2so4=simulation_request.concs.get("H2SO4", 0.0) * 1e6,
hno3=simulation_request.concs.get("HNO3", 0.0) * 1e6,
)


Expand Down
3 changes: 1 addition & 2 deletions backend/tests/test_models_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ def test_get_models():
client = TestClient(app)
response = client.get("/models")
assert response.status_code == 200
assert len(response.json()) == 3
assert all("name" in m for m in response.json())
assert len(response.json()) == 2

0 comments on commit 0b8b35d

Please sign in to comment.