You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having a problem generating an optimization schema from the list of molecules.
Here are the key elements of the code:
Loading a set of molecules: local_file_name = 'ligands.sdf' filename = directory + set_name + '/' + local_file_name molecules = Molecule.from_file(filename)
generating a schema: workflow_schema = factory.optimization_schemas_from_molecules(molecules)
Calling the executor: from openff.bespokefit.executor import BespokeExecutor, BespokeWorkerConfig, wait_until_complete with BespokeExecutor( n_fragmenter_workers = 1, n_optimizer_workers = 1, n_qc_compute_workers = 2, qc_compute_worker_config=BespokeWorkerConfig(n_cores=1) ) as executor: # Submit our workflow to the executor task_id = executor.submit(input_schema=workflow_schema) # Wait until the executor is done output = wait_until_complete(task_id)
This is what I get:
_Deduplication : 100%|██████████| 24/24 [00:00<00:00, 462.61it/s]
_Building Fitting Schema: 100%|██████████████████| 24/24 [00:05<00:00, 4.08it/s]
worker: Warm shutdown (MainProcess)
worker: Warm shutdown (MainProcess)
worker: Warm shutdown (MainProcess)
Traceback (most recent call last):
File "test_fep_benchmark_set_1.py", line 83, in <module>
task_id = executor.submit(input_schema=workflow_schema)
File "...../site-packages/openff/bespokefit/executor/executor.py", line 372, in submit
data=CoordinatorPOSTBody(input_schema=input_schema).json(),
File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for CoordinatorPOSTBody
input_schema
value is not a valid dict (type=type_error.dict)__
However,
when I replace step 2. with workflow_schema = factory.optimization_schema_from_molecule(molecules[0])
(processing just one molecule) the code runs with no issues.
Hi @ognjenperisic, thanks for trying out BespokeFit! The issue here is that the Executor.submit method expects a single BespokeOptimizationSchema object. In this case, you could submit each one and keep track of the ids like so
When running multiple fits in parallel however it is often better to use the server and submit methods via the CLI as explained in the docs here. I hope this helps!
Hi everybody,
I am having a problem generating an optimization schema from the list of molecules.
Here are the key elements of the code:
Loading a set of molecules:
local_file_name = 'ligands.sdf'
filename = directory + set_name + '/' + local_file_name
molecules = Molecule.from_file(filename)
generating a schema:
workflow_schema = factory.optimization_schemas_from_molecules(molecules)
Calling the executor:
from openff.bespokefit.executor import BespokeExecutor, BespokeWorkerConfig, wait_until_complete
with BespokeExecutor(
n_fragmenter_workers = 1,
n_optimizer_workers = 1,
n_qc_compute_workers = 2,
qc_compute_worker_config=BespokeWorkerConfig(n_cores=1)
) as executor:
# Submit our workflow to the executor
task_id = executor.submit(input_schema=workflow_schema)
# Wait until the executor is done
output = wait_until_complete(task_id)
This is what I get:
However,
when I replace step 2. with
workflow_schema = factory.optimization_schema_from_molecule(molecules[0])
(processing just one molecule) the code runs with no issues.
My environment:
openff-bespokefit 0.1.3 pyhd8ed1ab_0 conda-forge
openff-forcefields 2.0.0 pyh6c4a22f_0 conda-forge
openff-fragmenter-base 0.1.2 pyhd8ed1ab_1 conda-forge
openff-qcsubmit 0.3.2 pyhd8ed1ab_0 conda-forge
openff-toolkit 0.10.6 pyhd8ed1ab_0 conda-forge
openff-toolkit-base 0.10.6 pyhd8ed1ab_0 conda-forge
openff-utilities 0.1.7 pyh1a96a4e_0 conda-forge
The text was updated successfully, but these errors were encountered: