Skip to content

Commit

Permalink
Reduce diffs, vendored code
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Jan 27, 2023
1 parent ceae3ad commit 6ae2937
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 26 deletions.
8 changes: 3 additions & 5 deletions devtools/conda-envs/no_openeye.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ dependencies:
- click-option-group
- rdkit >=22
- ambertools >=22
- openff-toolkit-base >=0.11.3
- openff-utilities
- openff-toolkit-base >=0.11.3
- openff-units
- openff-forcefields
- openff-interchange
Expand Down Expand Up @@ -57,13 +57,11 @@ dependencies:
- pytest-cov
- pytest-asyncio
- pytest-celery
- pytest-xdist
- codecov
- requests-mock

# `openff-forcebalance` and dependencies
- conda
- pymbar =3
- lxml
- pymbar =3 # Implicit constraint, can remove after `openff-forcebalance` package
- lxml # Implicit dependency, can remove after `openff-forcebalance` package
- pip:
- git+https://github.com/openforcefield/openff-forcebalance.git
11 changes: 4 additions & 7 deletions devtools/conda-envs/test-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ dependencies:
- click
- click-option-group
- rdkit
- openff-toolkit-base >=0.11.3
- openff-utilities
- openff-toolkit-base >=0.11.3
- openff-forcefields
- openff-interchange
- openff-units
- openff-forcefields
- openff-qcsubmit
- openmm >=7.6.0

# Optional
- openff-fragmenter-base
- xtb-python
- openeye-toolkits
- openff-fragmenter-base

### Bespoke dependencies

Expand All @@ -59,13 +58,11 @@ dependencies:
- pytest-cov
- pytest-asyncio
- pytest-celery
- pytest-xdist
- codecov
- requests-mock

# `openff-forcebalance` and dependencies
- conda
- pymbar =3
- lxml
- pymbar =3 # Implicit constraint, can remove after `openff-forcebalance` package
- lxml # Implicit dependency, can remove after `openff-forcebalance` package
- pip:
- git+https://github.com/openforcefield/openff-forcebalance.git
15 changes: 2 additions & 13 deletions openff/bespokefit/optimizers/forcebalance/forcebalance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import logging
import os
import subprocess
from typing import Any, Dict, Optional
from typing import Any, Dict

from openff.toolkit.typing.engines.smirnoff import ForceField
from openff.utilities.provenance import get_ambertools_version

from openff.bespokefit.optimizers.forcebalance import ForceBalanceInputFactory
from openff.bespokefit.optimizers.model import BaseOptimizer
Expand All @@ -23,18 +24,6 @@
_logger = logging.getLogger(__name__)


def get_ambertools_version() -> Optional[str]:
from conda.cli.python_api import Commands, run_command

list_output, _, _ = run_command(Commands.LIST)

for line in list_output.splitlines():
if line.startswith("ambertools"):
return line.split()[1]

return None


class ForceBalanceOptimizer(BaseOptimizer):
"""
An optimizer class which controls the interface with ForceBalance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_forcebalance_provenance():

provenance = ForceBalanceOptimizer.provenance()

assert provenance["forcebalance"] == openff.forcebalance.__version__
assert provenance["openff.forcebalance"] == openff.forcebalance.__version__
assert provenance["openff.toolkit"] == openff.toolkit.__version__


Expand Down

0 comments on commit 6ae2937

Please sign in to comment.