Skip to content

Commit 94fd396

Browse files
authored
Composite jobs (#349)
## changes - [x] a composite job class (JobList) - [x] docking returns a JobList - [x] ability to confirm a JobList - [x] ability to cancel a JobList - [x] ability to watch a JobList - [x] JobList works nicely with docking - [x] docking flow using JobList mocked - [x] LigandSet no longer uses to_dataframe when we simply view it - [x] removed job.to_dataframe -- use JobList.to_dataframe() instead - [x] docking no longer calls job.to_dataframe ## screenshots what a ligandset with many ligands looks like <img width="576" height="298" alt="Screenshot 2025-11-20 at 3 39 46 PM" src="https://github.com/user-attachments/assets/c001ab0f-86e6-4392-a98e-637adce57bfd" /> what a ligandset with poses for a single ligand looks like <img width="564" height="288" alt="Screenshot 2025-11-20 at 3 40 07 PM" src="https://github.com/user-attachments/assets/97668f45-663e-438a-8f46-a081bf5fbddf" />
1 parent 1cfe7cd commit 94fd396

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+7890
-417
lines changed

.cursor/rules/python.mdc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ When modifying an existing function, make the following changes together:
4747
- To test a specific function, use `pytest -k --mock`
4848

4949

50+
# Common mistakes
51+
52+
- Using uppercase List instead of lowercase list to annotate the type of a list
53+
- Using uppercase Dist instead of lowercase dist to annotate the type of a dict

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"dateutil",
3535
"deeporigin",
3636
"drugability",
37+
"dtos",
3738
"emeq",
3839
"FMCS",
3940
"HETATM",
@@ -71,6 +72,7 @@
7172
"sanitizable",
7273
"SASA",
7374
"softcore",
74-
"Substruct"
75+
"Substruct",
76+
"textea"
7577
]
7678
}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ docs-deploy:
5858
mock-server:
5959
@echo "Starting mock server..."
6060
@source $(CURDIR)/venv/bin/activate && \
61-
python scripts/run_mock_server.py $(if $(PORT),$(PORT),8000) && \
61+
python -m tests.run_mock_server $(if $(PORT),$(PORT),4931) && \
6262
deactivate
6363

6464

README.md

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,12 @@ Deep Origin from the command line and Python.
1010
> The `deeporigin` client is under active development. Features
1111
> may change or be removed.
1212
13-
## Installing
1413

15-
> [!CAUTION]
16-
> As a best practice, we recommend installing this package in a virtual environment.
14+
## Documentation
1715

18-
To install this package, run the following:
16+
Please look at our docs for information on how to install and use this:
1917

20-
```bash
21-
pip install deeporigin
22-
```
23-
24-
## Configuration
25-
26-
To run this package outside of a Deep Origin workstation (for example, on your own computer), first you need to configure this package. After installing this package, run the following to configure your organization, replacing `org-id` with the ID of the Deep Origin organization that you would like to work with.
27-
28-
```bash
29-
deeporigin config set organization_id [org-id]
30-
```
31-
32-
## Developing
33-
34-
First, download the source code from GitHub:
35-
36-
```bash
37-
git clone [email protected]:deeporiginbio/deeporigin-client.git
38-
cd deeporigin-client
39-
```
40-
41-
Second, run the code below to create a virtual environment and install this package into it. This requires make v4.4 or higher.
42-
43-
```bash
44-
make install
45-
```
46-
47-
48-
### Automated tests on GitHub Actions
49-
50-
The tests are automatically run on GitHub Actions on every commit to every pull request.
18+
https://client-docs.deeporigin.io/
5119

5220
## License
5321

conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_server(pytestconfig):
2828
yield None
2929
return
3030

31-
server = MockServer(port=0)
31+
server = MockServer(port=4931) # Fixed port for test server
3232
server.start()
3333
yield server
3434
server.stop()
@@ -42,7 +42,7 @@ def test_server_url(test_server):
4242
test_server: The test server fixture.
4343
4444
Yields:
45-
Base URL of the test server (e.g., "http://127.0.0.1:12345"), or None if --mock is not passed.
45+
Base URL of the test server (e.g., "http://127.0.0.1:4931"), or None if --mock is not passed.
4646
"""
4747
if test_server is None:
4848
yield None

docs/dd/tutorial/getting-started.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,10 @@ sim = Complex.from_dir(BRD_DATA_DIR)
9090
9191
sim.ligands
9292
```
93-
94-
!!! success "Expected output"
95-
96-
![](../../images//ligands.png)
93+
and you should see something similar to:
9794

95+
<div style='width: 500px; padding: 15px; border: 1px solid #ddd; border-radius: 6px; background-color: #f9f9f9;'><h3 style='margin-top: 0; color: #333;'>LigandSet with 8 ligands</h3><p style='margin: 8px 0;'><strong>8</strong> unique SMILES</p><p style='margin: 8px 0;'>Properties: initial_smiles, r_exp_dg</p><div style='margin-top: 12px; padding-top: 12px; border-top: 1px solid #ddd;'><p style='margin: 4px 0; font-size: 0.9em; color: #666;'><em>Use <code>.to_dataframe()</code> to convert to a dataframe, <code>.show_df()</code> to view dataframewith structures, or <code>.show()</code> for 3D visualization</em></p></div></div>
96+
9897

9998
!!! tip "Jupyter notebooks"
10099
It is assumed that you are working in a Jupyter notebook (or similar IPython environment). This makes it easier to run the workflow, and some functions assume that you are in a Jupyter notebook.

docs/dev/mock-server.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The mock server is a local test server that mimics the DeepOrigin Platform API.
44

55
## Overview
66

7-
The mock server (`tests/mock_server.py`) provides mock responses for all API endpoints used by the DeepOriginClient. It runs locally using FastAPI and uvicorn, and serves responses based on fixture data stored in `tests/fixtures/`.
7+
The mock server (`tests/mock_server/`) provides mock responses for all API endpoints used by the DeepOriginClient. It runs locally using FastAPI and uvicorn, and serves responses based on fixture data stored in `tests/fixtures/`.
88

99
## Running the Mock Server
1010

@@ -13,21 +13,21 @@ The mock server (`tests/mock_server.py`) provides mock responses for all API end
1313
To run the mock server standalone for local development:
1414

1515
```bash
16-
python scripts/run_mock_server.py [PORT]
16+
python tests/run_mock_server.py [PORT]
1717
```
1818

1919
Where `PORT` is the port number to run the server on (default: 8000).
2020

2121
Example:
2222

2323
```bash
24-
python scripts/run_mock_server.py 8000
24+
python tests/run_mock_server.py 4931
2525
```
2626

2727
The server will start and display:
2828

2929
```bash
30-
Mock server running at http://127.0.0.1:8000
30+
Mock server running at http://127.0.0.1:4931
3131
Press Ctrl+C to stop...
3232
```
3333

@@ -41,7 +41,7 @@ The mock server is automatically started when running tests with the `--mock` fl
4141
pytest --mock
4242
```
4343

44-
This starts the server for the duration of the test session and automatically stops it when tests complete.
44+
This starts the server for the duration of the test session and automatically stops it when tests complete. The test server runs on **port 4931** (configured in `conftest.py`).
4545

4646
## Configuring Your Client
4747

@@ -53,7 +53,7 @@ from deeporigin.platform.client import DeepOriginClient
5353
client = DeepOriginClient(
5454
token="test-token", # Any token works with the mock server
5555
org_key="deeporigin", # Use any org_key
56-
base_url="http://127.0.0.1:8000", # Mock server URL
56+
base_url="http://127.0.0.1:4931", # Mock server URL (port 4931 for tests)
5757
env="local",
5858
)
5959
```
@@ -80,12 +80,14 @@ The mock server uses fixture files from `tests/fixtures/` to provide realistic r
8080

8181
## Extending the Mock Server
8282

83-
To add new endpoints or modify existing ones, edit `tests/mock_server.py`:
83+
To add new endpoints or modify existing ones, edit `tests/mock_server/server.py`:
8484

8585
1. Add a new route handler in the `_setup_routes()` method
8686
2. Optionally add fixture files in `tests/fixtures/` if you need realistic data
8787
3. Use `_load_fixture()` to load JSON fixtures
8888

89+
For file-related endpoints, add them to `tests/mock_server/routers/files.py`.
90+
8991
Example:
9092

9193
```{.python notest}

docs/how-to/auth.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,19 @@
66
To use most of the functionality of the Python client, you must first run the following commands to sign into Deep Origin.
77

88

9-
10-
11-
129
```{.python notest}
1310
from deeporigin import auth
14-
auth.authenticate()
11+
_ = auth.get_tokens()
1512
```
1613

17-
You will be presented with a prompt similar to below:
14+
When you first do this, you will be presented with a prompt similar to below:
1815

1916
```shell
2017
To connect to the Deep Origin OS, navigate your browser to
2118

22-
https://<env>auth0.com/activate?user_code=VMPZ-PQFG
19+
https://<env>auth0.com/activate?user_code=<code>
2320

24-
and verify the confirmation code is "VMPZ-PQFG", and click the "Confirm" button.
21+
and verify the confirmation code is the one shown, and click the "Confirm" button.
2522
```
2623

2724
When you visit that URL, you will see a prompt that looks like:
@@ -36,8 +33,6 @@ After signing in, your access tokens will be cached to disk and then automatical
3633
be used in subsequent interactions with Deep Origin.
3734

3835
!!! info "Authenticating"
39-
In most cases, you only need to authenticate to the Deep Origin OS once.
36+
You only need to authenticate to the Deep Origin OS once.
4037
You do not need to authenticate every time you use the client.
4138

42-
!!! question "Authenticating on Deep Origin workstations"
43-
Presently, workstation users must authenticate (once) to the Deep Origin OS. We plan to develop the capability to automatically authenticate workstation users.

docs/images/auth-code.png

-186 KB
Loading

docs/images/auth-confirm.png

-194 KB
Loading

0 commit comments

Comments
 (0)