Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test new openfe & gufe rc #254

Merged
merged 6 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions alchemiscale/interface/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
from typing import Dict, List, Optional, Union
from collections import Counter

from fastapi import FastAPI, APIRouter, Body, Depends, HTTPException
from fastapi import FastAPI, APIRouter, Body, Depends, HTTPException, Request
from fastapi import status as http_status
from fastapi.middleware.gzip import GZipMiddleware

import json
from gufe.tokenization import JSON_HANDLER

from ..base.api import (
GufeJSONResponse,
scope_params,
Expand Down Expand Up @@ -100,18 +103,25 @@ def check_existence(


@router.post("/networks", response_model=ScopedKey)
def create_network(
async def create_network(
*,
network: List = Body(embed=True),
scope: Scope = Body(embed=True),
state: str = Body(embed=True),
request: Request,
n4js: Neo4jStore = Depends(get_n4js_depends),
token: TokenData = Depends(get_token_data_depends),
):
# we handle the request directly so we can decode with custom JSON decoder
# this is important for properly handling GUFE objects
body = await request.body()
body_ = json.loads(body.decode("utf-8"), cls=JSON_HANDLER.decoder)

scope = Scope.parse_obj(body_["scope"])
validate_scopes(scope, token)

network = body_["network"]
an = KeyedChain(network).to_gufe()

state = body_["state"]

try:
an_sk, _, _ = n4js.assemble_network(network=an, scope=scope, state=state)
except ValueError as e:
Expand Down
7 changes: 4 additions & 3 deletions devtools/conda-envs/alchemiscale-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ channels:
- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge
- openeye

dependencies:
- pip
- python =3.10

# alchemiscale dependencies
- gufe=0.9.5
- openfe=0.14.0
- gufe=1.0.0
- openfe=1.0.1
- openmmforcefields>=0.12.0
- requests
- click
Expand All @@ -31,5 +32,5 @@ dependencies:
- pip:
- nest_asyncio
- async_lru
- git+https://github.com/openforcefield/alchemiscale.git@v0.4.0
- git+https://github.com/openforcefield/alchemiscale.git@v0.4.1-beta.1
- git+https://github.com/choderalab/perses.git@protocol-neqcyc
7 changes: 4 additions & 3 deletions devtools/conda-envs/alchemiscale-compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ name: alchemiscale-compute
channels:
- conda-forge
- openeye

dependencies:
- pip
- python =3.10
- cudatoolkit <=11.7 # many actual compute resources are not yet compatible with cudatoolkit >=11.8

# alchemiscale dependencies
- gufe=0.9.5
- openfe=0.14.0
- gufe=1.0.0
- openfe=1.0.1
- openmmforcefields>=0.12.0
- requests
- click
Expand All @@ -27,5 +28,5 @@ dependencies:

- pip:
- async_lru
- git+https://github.com/openforcefield/alchemiscale.git@v0.4.0
- git+https://github.com/openforcefield/alchemiscale.git@v0.4.1-beta.1
- git+https://github.com/choderalab/perses.git@protocol-neqcyc
8 changes: 5 additions & 3 deletions devtools/conda-envs/alchemiscale-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ channels:
- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge
- openeye

dependencies:
- pip
- python =3.10

# alchemiscale dependencies
- gufe=0.9.5
- openfe=0.14.0
- gufe=1.0.0
- openfe=1.0.1

- openmmforcefields>=0.12.0
- requests
- click
Expand Down Expand Up @@ -46,5 +48,5 @@ dependencies:

- pip:
- async_lru
- git+https://github.com/openforcefield/alchemiscale.git@v0.4.0
- git+https://github.com/openforcefield/alchemiscale.git@v0.4.1-beta.1
- git+https://github.com/choderalab/perses.git@protocol-neqcyc
1 change: 1 addition & 0 deletions devtools/conda-envs/docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: alchemiscale-docs
channels:
- conda-forge

dependencies:
- sphinx>=5.0,<6
- sphinx_rtd_theme
Expand Down
5 changes: 3 additions & 2 deletions devtools/conda-envs/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: alchemiscale-test
channels:
- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge

dependencies:
- pip

# alchemiscale dependencies
- gufe>=0.9.5
- openfe>=0.14.0
- gufe>=1.0.0
- openfe>=1.0.1
- openmmforcefields>=0.12.0
- pydantic<2.0

Expand Down
Loading