openforcefield / openff-bespokefit

Automated tools for the generation of bespoke SMIRNOFF format parameters for individual molecules.
https://docs.openforcefield.org/bespokefit
MIT License
59 stars 9 forks source link

Redis clash at localhost port, failed to run tutorial. #347

Closed orionarcher closed 2 months ago

orionarcher commented 3 months ago

Description

I've entered the code from the "Getting Started" page into a python script and executed it, but that is producing an error.

It appears to be an issue with Redis, I tried changing the port with export BEFLOW_REDIS_PORT=6380 but that did not solve the issue, just moved it to a different port.

The command line code from the tutorial is also failing but it appears to be making it significantly further into the process. Any help appreciated!

Reproduction

from openff.bespokefit.workflows import BespokeWorkflowFactory
from openff.qcsubmit.common_structures import QCSpec

factory = BespokeWorkflowFactory(
    # Define the starting force field that will be augmented with bespoke
    # parameters.
    initial_force_field="openff_unconstrained-2.1.1.offxml",
    # Change the level of theory that the reference QC data is generated at
    default_qc_specs=[
        QCSpec(
            method="gfn2xtb",
            basis=None,
            program="xtb",
            spec_name="xtb",
            spec_description="gfn2xtb",
        )
    ]
)

print("Setup factory")

from openff.toolkit.topology import Molecule

input_molecule = Molecule.from_smiles("CC")  # ethanol

workflow_schema = factory.optimization_schema_from_molecule(
    molecule=input_molecule
)

from openff.bespokefit.executor import BespokeExecutor, BespokeWorkerConfig, wait_until_complete

print("Running bespoke fitting workflow")

with BespokeExecutor(
    n_fragmenter_workers = 1,
    n_optimizer_workers = 1,
    n_qc_compute_workers = 1,
    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)

print("Completed bespoke fitting workflow")

if output.status == "success":
    # Save the resulting force field to an OFFXML file
    output.bespoke_force_field.to_file("output-ff.offxml")
elif output.status == "errored":
    # OR the print the error message if unsuccessful
    print(output.error)

Output

python /Users/orioncohen/Library/Application\ Support/JetBrains/PyCharm2024.1/scratches/scratch_1.py
Setup factory
Running bespoke fitting workflow
Setup factory
Setup factory
Setup factory
Setup factory
Running bespoke fitting workflow
Running bespoke fitting workflow
Running bespoke fitting workflow
Running bespoke fitting workflow
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <module>
  File "<string>", line 1, in <module>
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 122, in spawn_main
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 122, in spawn_main
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
    exitcode = _main(fd, parent_sentinel)
    exitcode = _main(fd, parent_sentinel)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 131, in _main
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 131, in _main
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 131, in _main
    prepare(preparation_data)
    prepare(preparation_data)
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 246, in prepare
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 246, in prepare
    prepare(preparation_data)
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 246, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 297, in _fixup_main_from_path
    _fixup_main_from_path(data['init_main_from_path'])
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 297, in _fixup_main_from_path
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 297, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen runpy>", line 291, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/orioncohen/Library/Application Support/JetBrains/PyCharm2024.1/scratches/scratch_1.py", line 34, in <module>
    main_content = runpy.run_path(main_path,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen runpy>", line 291, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/orioncohen/Library/Application Support/JetBrains/PyCharm2024.1/scratches/scratch_1.py", line 34, in <module>
    main_content = runpy.run_path(main_path,
    with BespokeExecutor(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 385, in __enter__
  File "<frozen runpy>", line 291, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
    self._start(asynchronous=True)
    with BespokeExecutor(
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/orioncohen/Library/Application Support/JetBrains/PyCharm2024.1/scratches/scratch_1.py", line 34, in <module>
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 385, in __enter__
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 321, in _start
    with BespokeExecutor(
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 385, in __enter__
    self._launch_redis()
    self._start(asynchronous=True)
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 260, in _launch_redis
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 321, in _start
    self._start(asynchronous=True)
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 321, in _start
    self._launch_redis()
    self._redis_process = launch_redis(
                          ^^^^^^^^^^^^^
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/utilities/redis.py", line 138, in launch_redis
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 260, in _launch_redis
    self._launch_redis()
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 260, in _launch_redis
    self._redis_process = launch_redis(
                          ^^^^^^^^^^^^^
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/utilities/redis.py", line 138, in launch_redis
    self._redis_process = launch_redis(
                          ^^^^^^^^^^^^^
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/utilities/redis.py", line 138, in launch_redis
    raise RuntimeError(f"There is already a server running at localhost:{port}")
    raise RuntimeError(f"There is already a server running at localhost:{port}")
    raise RuntimeError(f"There is already a server running at localhost:{port}")
RuntimeError: There is already a server running at localhost:6380
RuntimeError: There is already a server running at localhost:6380
RuntimeError: There is already a server running at localhost:6380
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 131, in _main
    prepare(preparation_data)
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 246, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/multiprocessing/spawn.py", line 297, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen runpy>", line 291, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/orioncohen/Library/Application Support/JetBrains/PyCharm2024.1/scratches/scratch_1.py", line 34, in <module>
    with BespokeExecutor(
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 385, in __enter__
    self._start(asynchronous=True)
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 321, in _start
    self._launch_redis()
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 260, in _launch_redis
    self._redis_process = launch_redis(
                          ^^^^^^^^^^^^^
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/utilities/redis.py", line 138, in launch_redis
    raise RuntimeError(f"There is already a server running at localhost:{port}")
RuntimeError: There is already a server running at localhost:6380
Traceback (most recent call last):
  File "/Users/orioncohen/Library/Application Support/JetBrains/PyCharm2024.1/scratches/scratch_1.py", line 34, in <module>
    with BespokeExecutor(
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 385, in __enter__
    self._start(asynchronous=True)
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/executor.py", line 333, in _start
    wait_for_gateway()
  File "/Users/orioncohen/miniconda3/envs/atomate_emmet/lib/python3.11/site-packages/openff/bespokefit/executor/services/gateway.py", line 107, in wait_for_gateway
    raise RuntimeError("The gateway could not be reached.")
RuntimeError: The gateway could not be reached.

Software versions

I admit, my conda environment is quite messy.

Output of conda list

conda list
# packages in environment at /Users/orioncohen/miniconda3/envs/atomate_emmet:
#
# Name                    Version                   Build  Channel
aiohttp                   3.9.3                    pypi_0    pypi
aioitertools              0.11.0                   pypi_0    pypi
aiosignal                 1.3.1                    pypi_0    pypi
ambertools                23.3            py311hb11241e_6    conda-forge
amberutils                21.0                     pypi_0    pypi
amqp                      5.2.0              pyhd8ed1ab_1    conda-forge
annotated-types           0.6.0              pyhd8ed1ab_0    conda-forge
anyio                     4.3.0              pyhd8ed1ab_0    conda-forge
appnope                   0.1.4              pyhd8ed1ab_0    conda-forge
apsw                      3.45.2.0        py311hd50245e_1    conda-forge
archspec                  0.2.3              pyhd8ed1ab_0    conda-forge
argcomplete               3.3.0              pyhd8ed1ab_0    conda-forge
argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py311h2725bcf_4    conda-forge
arpack                    3.8.0           nompi_hb44a6d1_101    conda-forge
arrow                     1.3.0              pyhd8ed1ab_0    conda-forge
ase                       3.22.1                   pypi_0    pypi
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.4              pyhd8ed1ab_0    conda-forge
async-timeout             4.0.3              pyhd8ed1ab_0    conda-forge
atomate2                  0.0.12.post488+geb225715          pypi_0    pypi
attrs                     23.2.0             pyh71513ae_0    conda-forge
babel                     2.14.0             pyhd8ed1ab_0    conda-forge
backports.zoneinfo        0.2.1           py311h6eed73b_8    conda-forge
basis_set_exchange        0.10               pyhd8ed1ab_1    conda-forge
bcrypt                    4.1.2           py311h5e0f0e4_0    conda-forge
beautifulsoup4            4.12.3             pyha770c72_0    conda-forge
billiard                  4.2.0           py311he705e18_0    conda-forge
biopython                 1.83            py311he705e18_0    conda-forge
black                     24.3.0                   pypi_0    pypi
bleach                    6.1.0              pyhd8ed1ab_0    conda-forge
blinker                   1.7.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.5               heccf04b_0    conda-forge
boltons                   24.0.0             pyhd8ed1ab_0    conda-forge
boto3                     1.34.73                  pypi_0    pypi
botocore                  1.34.73                  pypi_0    pypi
brotli                    1.1.0                h0dc2134_1    conda-forge
brotli-bin                1.1.0                h0dc2134_1    conda-forge
brotli-python             1.1.0           py311hdf8f085_1    conda-forge
bson                      0.5.9                      py_0    conda-forge
bzip2                     1.0.8                h10d778d_5    conda-forge
c-ares                    1.28.0               h10d778d_0    conda-forge
c-blosc2                  2.12.0               h0ae8482_0    conda-forge
ca-certificates           2024.2.2             h8857fd0_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                5.3.3              pyhd8ed1ab_0    conda-forge
cairo                     1.18.0               h99e66fa_0    conda-forge
celery                    5.3.6              pyhd8ed1ab_0    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py311hc0b63fd_0    conda-forge
cfgv                      3.4.0                    pypi_0    pypi
cftime                    1.6.3           py311hc9a392d_0    conda-forge
chardet                   5.2.0           py311h6eed73b_1    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
chemper                   1.0.1              pyhd8ed1ab_0    conda-forge
chgnet                    0.3.5                    pypi_0    pypi
click                     8.1.7           unix_pyh707e725_0    conda-forge
click-didyoumean          0.3.1              pyhd8ed1ab_0    conda-forge
click-option-group        0.5.6              pyhd8ed1ab_0    conda-forge
click-plugins             1.1.1                      py_0    conda-forge
click-repl                0.3.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.2.2              pyhd8ed1ab_0    conda-forge
conda                     24.5.0          py311h6eed73b_0    conda-forge
conda-libmamba-solver     24.1.0             pyhd8ed1ab_0    conda-forge
conda-package-handling    2.2.0              pyh38be061_0    conda-forge
conda-package-streaming   0.9.0              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.0           py311h7bea37d_0    conda-forge
cryptography              42.0.5          py311hda9c3b6_0    conda-forge
custodian                 2024.3.12                pypi_0    pypi
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
cython                    3.0.9                    pypi_0    pypi
debugpy                   1.8.1           py311hdd0406b_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
deprecated                1.2.14             pyh1a96a4e_0    conda-forge
dftd3-python              1.0.0           py311hcded3c8_1    conda-forge
dgl                       2.1.0                    pypi_0    pypi
distlib                   0.3.8                    pypi_0    pypi
distro                    1.9.0              pyhd8ed1ab_0    conda-forge
dkh                       1.2                  hb57fcd4_0    conda-forge
dnspython                 2.6.1              pyhd8ed1ab_1    conda-forge
edgembar                  0.2                      pypi_0    pypi
ele                       0.2.0              pyhd8ed1ab_0    conda-forge
email-validator           2.1.1              pyhd8ed1ab_0    conda-forge
email_validator           2.1.1                hd8ed1ab_0    conda-forge
emmet-builders            0.37.1.dev870+gbb17c5e2           dev_0    
emmet-core                0.82.2.dev71+gd834d38f.d20240507           dev_0    
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
et-xmlfile                1.1.0                    pypi_0    pypi
exceptiongroup            1.2.0              pyhd8ed1ab_2    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
expat                     2.6.2                h73e2aa4_0    conda-forge
fabric                    3.2.2              pyhd8ed1ab_0    conda-forge
fastapi                   0.110.0                  pypi_0    pypi
fastapi-cli               0.0.4              pyhd8ed1ab_0    conda-forge
fasteners                 0.19                     pypi_0    pypi
fftw                      3.3.10          nompi_h4fa670e_108    conda-forge
filelock                  3.13.3                   pypi_0    pypi
fireworks                 2.0.3              pyhd8ed1ab_0    conda-forge
flask                     3.0.2                    pypi_0    pypi
flask-paginate            2024.3.28          pyhd8ed1ab_0    conda-forge
fmt                       10.2.1               h7728843_0    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_1    conda-forge
fontconfig                2.14.2               h5bb23bf_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.50.0          py311he705e18_0    conda-forge
forcebalance              1.9.6           py311h7c2fe40_2    conda-forge
forcefield-utilities      0.2.2              pyhd8ed1ab_0    conda-forge
foyer                     0.12.1             pyhd8ed1ab_0    conda-forge
fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
freetype                  2.12.1               h60636b9_2    conda-forge
freetype-py               2.3.0              pyhd8ed1ab_0    conda-forge
frozendict                2.4.4           py311h72ae277_0    conda-forge
frozenlist                1.4.1                    pypi_0    pypi
fsspec                    2024.3.1                 pypi_0    pypi
future                    1.0.0              pyhd8ed1ab_0    conda-forge
gau2grid                  2.0.7                hb7f2c08_2    conda-forge
geometric                 1.0                pyhd8ed1ab_1    conda-forge
gettext                   0.21.1               h8a4c099_0    conda-forge
gf2x                      1.3.0                hb2a7efb_2    conda-forge
glpk                      5.0                  h3cb5acd_0    conda-forge
gmp                       6.3.0                h73e2aa4_1    conda-forge
gmpy2                     2.1.5           py311hab17429_1    conda-forge
gmso                      0.11.2             pyhd8ed1ab_0    conda-forge
greenlet                  3.0.3           py311hdd0406b_0    conda-forge
griddataformats           1.0.2              pyhd8ed1ab_0    conda-forge
gsd                       3.2.1           py311hc9a392d_0    conda-forge
gtest                     1.14.0               h1c7c39f_1    conda-forge
gunicorn                  21.2.0          py311h6eed73b_1    conda-forge
h11                       0.14.0             pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
h5py                      3.10.0          nompi_py311hf7b785c_101    conda-forge
hdf4                      4.2.15               h8138101_7    conda-forge
hdf5                      1.14.3          nompi_h691f4bf_100    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
httpcore                  1.0.5              pyhd8ed1ab_0    conda-forge
httpx                     0.27.0             pyhd8ed1ab_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       73.2                 hf5e326d_0    conda-forge
identify                  2.5.35                   pypi_0    pypi
idna                      3.6                pyhd8ed1ab_0    conda-forge
importlib-metadata        7.1.0              pyha770c72_0    conda-forge
importlib_metadata        7.1.0                hd8ed1ab_0    conda-forge
importlib_resources       6.4.0              pyhd8ed1ab_0    conda-forge
inflect                   7.0.0                    pypi_0    pypi
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
invoke                    2.2.0              pyhd8ed1ab_0    conda-forge
ipykernel                 6.29.3             pyh3cd1d5f_0    conda-forge
ipython                   8.22.2             pyh707e725_0    conda-forge
ipywidgets                8.1.2              pyhd8ed1ab_0    conda-forge
isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
itsdangerous              2.1.2              pyhd8ed1ab_0    conda-forge
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.3              pyhd8ed1ab_0    conda-forge
jmespath                  1.0.1              pyhd8ed1ab_0    conda-forge
jobflow                   0.1.17                   pypi_0    pypi
joblib                    1.3.2              pyhd8ed1ab_0    conda-forge
json5                     0.9.24             pyhd8ed1ab_0    conda-forge
jsonpatch                 1.33               pyhd8ed1ab_0    conda-forge
jsonpointer               2.4             py311h6eed73b_3    conda-forge
jsonschema                4.21.1             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.12.1          pyhd8ed1ab_0    conda-forge
jsonschema-with-format-nongpl 4.21.1             pyhd8ed1ab_0    conda-forge
jupyter-lsp               2.2.4              pyhd8ed1ab_0    conda-forge
jupyter_client            8.6.1              pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.2           py311h6eed73b_0    conda-forge
jupyter_events            0.10.0             pyhd8ed1ab_0    conda-forge
jupyter_server            2.13.0             pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.5.3              pyhd8ed1ab_0    conda-forge
jupyterlab                4.1.5              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
jupyterlab_server         2.25.4             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.10             pyhd8ed1ab_0    conda-forge
khronos-opencl-icd-loader 2023.04.17           hb7f2c08_0    conda-forge
kiwisolver                1.4.5           py311h5fe6e05_1    conda-forge
kombu                     5.3.7           py311h6eed73b_0    conda-forge
krb5                      1.21.2               hb884880_0    conda-forge
lark-parser               0.12.0             pyhd8ed1ab_0    conda-forge
latexcodec                3.0.0                    pypi_0    pypi
lcms2                     2.16                 ha2f27b4_0    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libabseil                 20240116.2      cxx17_hc1bcbd7_0    conda-forge
libaec                    1.1.3                h73e2aa4_0    conda-forge
libarchive                3.7.2                hd35d340_1    conda-forge
libblas                   3.9.0              20_osx64_mkl    conda-forge
libboost                  1.82.0               h99d8d82_6    conda-forge
libboost-python           1.82.0          py311h3b8bc05_6    conda-forge
libbrotlicommon           1.1.0                h0dc2134_1    conda-forge
libbrotlidec              1.1.0                h0dc2134_1    conda-forge
libbrotlienc              1.1.0                h0dc2134_1    conda-forge
libcblas                  3.9.0              20_osx64_mkl    conda-forge
libcurl                   8.7.1                h726d00d_0    conda-forge
libcxx                    16.0.6               hd57cbcb_0    conda-forge
libdeflate                1.20                 h49d49c5_0    conda-forge
libecpint                 1.0.7               h8253960_10    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 h10d778d_2    conda-forge
libexpat                  2.6.2                h73e2aa4_0    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libflint                  2.9.0           hfd2f71f_ntl_100    conda-forge
libgfortran               5.0.0           13_2_0_h97931a8_3    conda-forge
libgfortran5              13.2.0               h2873a65_3    conda-forge
libglib                   2.80.0               h81c1438_1    conda-forge
libhwloc                  2.10.0          default_h1321489_1000    conda-forge
libiconv                  1.17                 hd75f5a5_2    conda-forge
libint                    2.9.0                hf344f97_0    conda-forge
libjpeg-turbo             3.0.0                h0dc2134_1    conda-forge
liblapack                 3.9.0              20_osx64_mkl    conda-forge
libmamba                  1.5.8                ha449628_0    conda-forge
libmambapy                1.5.8           py311h6c5c7ae_0    conda-forge
libnetcdf                 4.9.2           nompi_h7760872_113    conda-forge
libnghttp2                1.58.0               h64cf6d3_1    conda-forge
libopenblas               0.3.26          openmp_hfef2a42_0    conda-forge
libpcm                    1.2.3                hf5d0054_8    conda-forge
libpng                    1.6.43               h92b6c6a_0    conda-forge
libprotobuf               4.25.3               h4e4d658_0    conda-forge
libsodium                 1.0.18               hbcb3906_1    conda-forge
libsolv                   0.7.29               h4f92f52_0    conda-forge
libsqlite                 3.45.2               h92b6c6a_0    conda-forge
libssh2                   1.11.0               hd019ec5_0    conda-forge
libtiff                   4.6.0                h129831d_3    conda-forge
libwebp-base              1.3.2                h0dc2134_0    conda-forge
libxc-c                   6.2.2            cpu_hebaf863_4    conda-forge
libxcb                    1.15                 hb7f2c08_0    conda-forge
libxml2                   2.12.6               hc0ae0f7_1    conda-forge
libxslt                   1.1.39               h03b04e6_0    conda-forge
libzip                    1.10.1               hc158999_3    conda-forge
libzlib                   1.2.13               h8a1eda9_5    conda-forge
lightning-utilities       0.11.2                   pypi_0    pypi
llvm-openmp               18.1.2               hb6ac08f_0    conda-forge
lxml                      5.2.2           py311hf8c4076_0    conda-forge
lz4-c                     1.9.4                hf0c8a7f_0    conda-forge
lzo                       2.10              h10d778d_1001    conda-forge
maggma                    0.64.0                   pypi_0    pypi
mamba                     1.5.8           py311h8082e30_0    conda-forge
markdown-it-py            3.0.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.5           py311he705e18_0    conda-forge
matcalc                   0.0.4                    pypi_0    pypi
matgl                     1.0.0                    pypi_0    pypi
matminer                  0.9.2                    pypi_0    pypi
matplotlib-base           3.8.3           py311h6ff1f5f_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mctc-lib                  0.3.1                h5f0aba5_0    conda-forge
mda-xdrlib                0.2.0              pyhd8ed1ab_0    conda-forge
mdahole2                  0.4.0                    pypi_0    pypi
mdanalysis                2.8.0.dev0               pypi_0    pypi
mdareporter               0.1+3.gd665b3d           pypi_0    pypi
mdtraj                    1.9.9           py311h8f92aaa_0    conda-forge
mdurl                     0.1.2              pyhd8ed1ab_0    conda-forge
menuinst                  2.1.0           py311h6eed73b_0    conda-forge
mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
mkl                       2023.2.0         h54c2260_50500    conda-forge
mmpbsa-py                 16.0                     pypi_0    pypi
mmtf-python               1.1.3              pyhd8ed1ab_0    conda-forge
mongogrant                0.3.3                    pypi_0    pypi
mongomock                 4.1.2                    pypi_0    pypi
monty                     2024.2.26          pyhd8ed1ab_0    conda-forge
mpc                       1.3.1                h81bd1dd_0    conda-forge
mpfr                      4.2.1                h4f6b447_1    conda-forge
mpi                       1.0                     openmpi    conda-forge
mpi4py                    3.1.6           py311hf2bceb4_0    conda-forge
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
mrcfile                   1.5.0              pyhd8ed1ab_0    conda-forge
msgpack                   1.0.8                    pypi_0    pypi
msgpack-python            1.0.7           py311h7bea37d_0    conda-forge
multidict                 6.0.5                    pypi_0    pypi
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mypy                      1.9.0                    pypi_0    pypi
mypy-extensions           1.0.0                    pypi_0    pypi
nbclient                  0.10.0             pyhd8ed1ab_0    conda-forge
nbconvert-core            7.16.3             pyhd8ed1ab_0    conda-forge
nbformat                  5.10.3             pyhd8ed1ab_0    conda-forge
ncurses                   6.4.20240210         h73e2aa4_0    conda-forge
nest-asyncio              1.6.0              pyhd8ed1ab_0    conda-forge
netcdf-fortran            4.6.1           nompi_h383bc5a_103    conda-forge
netcdf4                   1.6.5           nompi_py311hd2be13f_100    conda-forge
networkx                  3.2.1              pyhd8ed1ab_0    conda-forge
nglview                   3.1.2              pyh15ce09e_0    conda-forge
nodeenv                   1.8.0                    pypi_0    pypi
notebook                  7.1.2              pyhd8ed1ab_0    conda-forge
notebook-shim             0.2.4              pyhd8ed1ab_0    conda-forge
ntl                       11.4.3               h0ab3c2f_1    conda-forge
numexpr                   2.9.0           py311h8f6166a_0    conda-forge
numpy                     1.26.4          py311hc43a94b_0    conda-forge
nvidia-ml-py3             7.352.0                  pypi_0    pypi
ocl_icd_wrapper_apple     1.0.0                hbcb3906_0    conda-forge
openbabel                 3.1.1           py311he4d38a6_9    conda-forge
openff-amber-ff-ports     0.0.4              pyhca7485f_0    conda-forge
openff-bespokefit         0.3.0              pyhd8ed1ab_0    conda-forge
openff-forcefields        2024.03.0          pyhca7485f_0    conda-forge
openff-fragmenter-base    0.2.1              pyhd8ed1ab_0    conda-forge
openff-interchange        0.3.25             pyhd8ed1ab_0    conda-forge
openff-interchange-base   0.3.25             pyhd8ed1ab_0    conda-forge
openff-models             0.1.2              pyhca7485f_0    conda-forge
openff-qcsubmit           0.51.0             pyhd8ed1ab_0    conda-forge
openff-toolkit            0.15.2             pyhd8ed1ab_0    conda-forge
openff-toolkit-base       0.15.2             pyhd8ed1ab_0    conda-forge
openff-units              0.2.2              pyhca7485f_0    conda-forge
openff-utilities          0.1.12             pyhd8ed1ab_0    conda-forge
openjpeg                  2.5.2                h7310d3a_0    conda-forge
openmm                    8.1.1           py311h2827df7_1_khronos    conda-forge
openmm-mdanalysis-reporter 0.1                      pypi_0    pypi
openmpi                   4.1.6              h7406208_101    conda-forge
openpyxl                  3.1.2                    pypi_0    pypi
openssl                   3.3.0                h87427d6_3    conda-forge
optking                   0.2.1              pyhd8ed1ab_0    conda-forge
orjson                    3.10.0                   pypi_0    pypi
overrides                 7.7.0              pyhd8ed1ab_0    conda-forge
packaging                 24.0               pyhd8ed1ab_0    conda-forge
packmol                   20.010               h508aa58_0    conda-forge
packmol-memgen            2023.2.24                pypi_0    pypi
palettable                3.3.3                    pypi_0    pypi
pandas                    2.2.1           py311h8f6166a_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
panedr                    0.8.0              pyhd8ed1ab_0    conda-forge
paramiko                  3.4.0              pyhd8ed1ab_0    conda-forge
parmed                    4.2.2           py311hd39e593_1    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pathlib2                  2.3.7.post1     py311h6eed73b_3    conda-forge
pathsimanalysis           1.1.0                    pypi_0    pypi
pathspec                  0.12.1                   pypi_0    pypi
patsy                     0.5.6              pyhd8ed1ab_0    conda-forge
pcmsolver                 1.2.3                      py_9    conda-forge
pcre2                     10.43                h0ad2156_0    conda-forge
pdb4amber                 22.0                     pypi_0    pypi
perl                      5.32.1          7_h10d778d_perl5    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_0    conda-forge
phonopy                   2.22.1                   pypi_0    pypi
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.2.0          py311hea5c87a_0    conda-forge
pint                      0.23               pyhd8ed1ab_0    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
pixman                    0.43.4               h73e2aa4_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              4.2.0              pyhd8ed1ab_0    conda-forge
plotly                    5.22.0                   pypi_0    pypi
pluggy                    1.4.0              pyhd8ed1ab_0    conda-forge
pre-commit                3.7.0                    pypi_0    pypi
prometheus_client         0.20.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.42             pyha770c72_0    conda-forge
prompt_toolkit            3.0.42               hd8ed1ab_0    conda-forge
protobuf                  4.25.3          py311h01b5fa2_0    conda-forge
psi4                      1.9.1           py311h5db8dd7_1    conda-forge
psutil                    5.9.8           py311he705e18_0    conda-forge
pthread-stubs             0.4               hc929b4f_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pubchempy                 1.0.4                    pypi_0    pypi
pugixml                   1.14                 he965462_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py-cpuinfo                9.0.0              pyhd8ed1ab_0    conda-forge
pybind11-abi              4                    hd8ed1ab_3    conda-forge
pybtex                    0.24.0                   pypi_0    pypi
pycairo                   1.26.0          py311h389a0fd_0    conda-forge
pycalverter               1.6.1                      py_0    conda-forge
pycosat                   0.6.6           py311h2725bcf_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydantic                  1.10.14         py311he705e18_0    conda-forge
pydantic-core             2.16.3          py311hd64b9fd_0    conda-forge
pydantic-settings         2.2.1                    pypi_0    pypi
pydash                    8.0.0                    pypi_0    pypi
pyedr                     0.8.0              pyhd8ed1ab_0    conda-forge
pygments                  2.17.2             pyhd8ed1ab_0    conda-forge
pyjwt                     2.8.0              pyhd8ed1ab_1    conda-forge
pymatgen                  2024.5.1                 pypi_0    pypi
pymatgen-analysis-alloys  0.0.6                    pypi_0    pypi
pymatgen-analysis-diffusion 2023.8.15                pypi_0    pypi
pymbar                    3.1.1           py311he5d6b3b_3    conda-forge
pymongo                   4.6.3           py311hdd0406b_0    conda-forge
pymsmt                    22.0                     pypi_0    pypi
pynacl                    1.5.0           py311h2725bcf_3    conda-forge
pyobjc-core               10.2            py311h9b70068_0    conda-forge
pyobjc-framework-cocoa    10.2            py311h9b70068_0    conda-forge
pyparsing                 3.1.2              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
pytables                  3.9.2           py311h3cee394_1    conda-forge
pytest                    7.4.4              pyhd8ed1ab_0    conda-forge
python                    3.11.8          h9f0c242_0_cpython    conda-forge
python-constraint         1.4.0                      py_0    conda-forge
python-dateutil           2.9.0.post0              pypi_0    pypi
python-dotenv             1.0.1                    pypi_0    pypi
python-fastjsonschema     2.19.1             pyhd8ed1ab_0    conda-forge
python-igraph             0.11.4          py311h090a316_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-multipart          0.0.9              pyhd8ed1ab_0    conda-forge
python-symengine          0.11.0          py311h0d02041_1    conda-forge
python-tzdata             2024.1             pyhd8ed1ab_0    conda-forge
python_abi                3.11                    4_cp311    conda-forge
pytng                     0.3.1           py311h0c3a6a7_1    conda-forge
pytorch-lightning         2.2.1                    pypi_0    pypi
pytraj                    2.0.6                    pypi_0    pypi
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.1           py311h2725bcf_1    conda-forge
pyzmq                     25.1.2          py311h889d6d6_0    conda-forge
qcelemental               0.27.1             pyhd8ed1ab_0    conda-forge
qcengine                  0.29.0             pyhd8ed1ab_0    conda-forge
qcportal                  0.55               pyhd8ed1ab_0    conda-forge
rdkit                     2023.09.6       py311hc8a6178_0    conda-forge
readline                  8.2                  h9e318b2_1    conda-forge
redis-py                  5.0.4              pyhd8ed1ab_0    conda-forge
redis-server              7.2.5                h2d65c12_0    conda-forge
referencing               0.34.0             pyhd8ed1ab_0    conda-forge
regex                     2024.5.15       py311h72ae277_0    conda-forge
reportlab                 4.1.0           py311he705e18_0    conda-forge
reproc                    14.2.4.post0         h10d778d_1    conda-forge
reproc-cpp                14.2.4.post0         h93d8f39_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rich                      13.7.1             pyhd8ed1ab_0    conda-forge
rlpycairo                 0.2.0              pyhd8ed1ab_0    conda-forge
robocrys                  0.2.8                    pypi_0    pypi
rpds-py                   0.18.0          py311hd64b9fd_0    conda-forge
ruamel-yaml               0.17.40                  pypi_0    pypi
ruamel.yaml               0.18.6          py311he705e18_0    conda-forge
ruamel.yaml.clib          0.2.8           py311he705e18_0    conda-forge
ruff                      0.4.3                    pypi_0    pypi
s3transfer                0.10.1             pyhd8ed1ab_0    conda-forge
sander                    22.0                     pypi_0    pypi
scikit-learn              1.4.1.post1     py311he2b4599_0    conda-forge
scipy                     1.12.0          py311h86d0cd9_2    conda-forge
seaborn                   0.13.2               hd8ed1ab_0    conda-forge
seaborn-base              0.13.2             pyhd8ed1ab_0    conda-forge
seekpath                  2.1.0                    pypi_0    pypi
send2trash                1.8.2              pyhd1c38e8_0    conda-forge
sentinels                 1.0.0                    pypi_0    pypi
setuptools                69.2.0             pyhd8ed1ab_0    conda-forge
shapely                   2.0.3                    pypi_0    pypi
shellingham               1.5.4              pyhd8ed1ab_0    conda-forge
simple-dftd3              1.0.0                h16f0d12_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smirnoff99frosst          1.1.0              pyh44b312d_0    conda-forge
snappy                    1.1.10               h225ccf5_0    conda-forge
sniffio                   1.3.1              pyhd8ed1ab_0    conda-forge
solvation-analysis        0.1.5+196.g9b83862.dirty          pypi_0    pypi
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
spglib                    2.3.1                    pypi_0    pypi
sqlalchemy                2.0.29          py311he705e18_0    conda-forge
sqlite                    3.45.2               h7461747_0    conda-forge
sshtunnel                 0.4.0                    pypi_0    pypi
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
starlette                 0.36.3                   pypi_0    pypi
statsmodels               0.14.1          py311hc9a392d_0    conda-forge
symengine                 0.11.2               h29729e3_1    conda-forge
sympy                     1.12            pypyh9d50eac_103    conda-forge
tabulate                  0.9.0              pyhd8ed1ab_1    conda-forge
tbb                       2021.12.0            h3c5361c_1    conda-forge
tenacity                  8.2.3                    pypi_0    pypi
terminado                 0.18.1             pyh31c8845_0    conda-forge
texttable                 1.7.0              pyhd8ed1ab_0    conda-forge
threadpoolctl             3.4.0              pyhc1e730c_0    conda-forge
tidynamics                1.1.2              pyhd8ed1ab_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.13               h1abcd95_1    conda-forge
toml-f                    0.4.2                he7e6219_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
torch                     2.2.2                    pypi_0    pypi
torchdata                 0.7.1                    pypi_0    pypi
torchmetrics              1.3.2                    pypi_0    pypi
tornado                   6.4             py311he705e18_0    conda-forge
torsiondrive              1.1.0              pyhd8ed1ab_0    conda-forge
tqdm                      4.66.2             pyhd8ed1ab_0    conda-forge
traitlets                 5.14.2             pyhd8ed1ab_0    conda-forge
truststore                0.8.0              pyhd8ed1ab_0    conda-forge
typer                     0.12.3             pyhd8ed1ab_0    conda-forge
typer-slim                0.12.3             pyhd8ed1ab_0    conda-forge
typer-slim-standard       0.12.3               hd8ed1ab_0    conda-forge
types-python-dateutil     2.9.0.20240316     pyhd8ed1ab_0    conda-forge
typing-extensions         4.10.0               hd8ed1ab_0    conda-forge
typing_extensions         4.10.0             pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
ujson                     5.10.0          py311hbafa61a_0    conda-forge
uncertainties             3.1.7                    pypi_0    pypi
unidecode                 1.3.8              pyhd8ed1ab_0    conda-forge
unyt                      2.9.2              pyhd8ed1ab_1    conda-forge
uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
uvicorn                   0.29.0                   pypi_0    pypi
vine                      5.1.0              pyhd8ed1ab_0    conda-forge
virtualenv                20.25.1                  pypi_0    pypi
waterdynamics             1.1.0                    pypi_0    pypi
wcwidth                   0.2.13             pyhd8ed1ab_0    conda-forge
webcolors                 1.13               pyhd8ed1ab_0    conda-forge
webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
websocket-client          1.7.0              pyhd8ed1ab_0    conda-forge
werkzeug                  3.0.1              pyhd8ed1ab_0    conda-forge
wheel                     0.43.0             pyhd8ed1ab_1    conda-forge
widgetsnbextension        4.0.10             pyhd8ed1ab_0    conda-forge
wrapt                     1.16.0          py311he705e18_0    conda-forge
xmltodict                 0.13.0             pyhd8ed1ab_0    conda-forge
xorg-kbproto              1.0.7             h35c211d_1002    conda-forge
xorg-libice               1.1.1                h0dc2134_0    conda-forge
xorg-libsm                1.2.4                h0dc2134_0    conda-forge
xorg-libx11               1.8.7                hbd0b022_0    conda-forge
xorg-libxau               1.0.11               h0dc2134_0    conda-forge
xorg-libxdmcp             1.1.3                h35c211d_0    conda-forge
xorg-libxext              1.3.4                hb7f2c08_2    conda-forge
xorg-libxt                1.3.0                h0dc2134_1    conda-forge
xorg-xextproto            7.3.0             hb7f2c08_1003    conda-forge
xorg-xproto               7.0.31            h35c211d_1007    conda-forge
xtb                       6.5.1                h5bf119a_1    conda-forge
xtb-python                22.1            py311h5547dcb_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
yaml                      0.2.5                h0d85af4_2    conda-forge
yaml-cpp                  0.8.0                he965462_0    conda-forge
yarl                      1.9.4                    pypi_0    pypi
zeromq                    4.3.5                h93d8f39_0    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               h8a1eda9_5    conda-forge
zlib-ng                   2.0.7                hb7f2c08_0    conda-forge
zstandard                 0.22.0          py311hed14148_0    conda-forge
zstd                      1.5.5                h829000d_0    conda-forge
j-wags commented 3 months ago

Thanks for writing in @orionarcher - I just tried the same on my machine and got the same error.

@jthorton could I pass this to you? My normal bag of tricks (start executor separately, pkill redis, etc) doesn't seem to be applicable here.

jthorton commented 3 months ago

Hi @orionarcher, due to the bespokefit server running asynchronously you need to make sure this runs in a main block try the following. Note it will fail similarly to the CLI though as the example molecule of ethane has no rotatable bonds by definition used in bespokefit, as we assume the base force field well represents methyl rotations.

from openff.bespokefit.workflows import BespokeWorkflowFactory
from openff.qcsubmit.common_structures import QCSpec

def main():

    factory = BespokeWorkflowFactory(
        # Define the starting force field that will be augmented with bespoke
        # parameters.
        initial_force_field="openff_unconstrained-2.1.1.offxml",
        # Change the level of theory that the reference QC data is generated at
        default_qc_specs=[
            QCSpec(
                method="gfn2xtb",
                basis=None,
                program="xtb",
                spec_name="xtb",
                spec_description="gfn2xtb",
            )
        ]
    )

    print("Setup factory")

    from openff.toolkit.topology import Molecule

    input_molecule = Molecule.from_smiles("CC")  # ethanol

    workflow_schema = factory.optimization_schema_from_molecule(
        molecule=input_molecule
    )

    from openff.bespokefit.executor import BespokeExecutor, BespokeWorkerConfig, wait_until_complete

    print("Running bespoke fitting workflow")

    with BespokeExecutor(
        n_fragmenter_workers = 1,
        n_optimizer_workers = 1,
        n_qc_compute_workers = 1,
        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)

    print("Completed bespoke fitting workflow")

    if output.status == "success":
        # Save the resulting force field to an OFFXML file
        output.bespoke_force_field.to_file("output-ff.offxml")
    elif output.status == "errored":
        # OR the print the error message if unsuccessful
        print(output.error)

if __name__ == "__main__":
    main()
orionarcher commented 3 months ago

Thank you for the help. Your code is now running on my system (I am getting a "No fragments found" issue but I suspect that is due to my choice of molecule).

In my use case, I am trying to run BespokeFit within a high-throughput workflow; running it as main isn't ideal. Is there a workaround or should I make calls to the CLI instead?

jthorton commented 3 months ago

@orionarcher in a high-throughput workflow I would consider setting up the server and workers using the CLI by following this guide you can then interact with the server to submit molecules, inspect progress and gather results from a script using the methods in the example above.

orionarcher commented 2 months ago

Got it, thank you!