Skip to content

Commit

Permalink
Fix #382 (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyminium authored Oct 5, 2021
1 parent 9a1b1b9 commit 4813d3d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/releasehistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Bugfixes
""""""""

* PR `#375 <https://github.com/openforcefield/openff-evaluator/pull/375>`_: Fix #374 - import from collections.abc
* PR `#384 <https://github.com/openforcefield/openff-evaluator/pull/384>`_: Fix #382 - Default keyword arguments result in error
* PR `#387 <https://github.com/openforcefield/openff-evaluator/pull/387>`_: Fix #380 - Recursion error in local file storage

New Features
Expand Down
19 changes: 19 additions & 0 deletions openff/evaluator/tests/test_workflow/test_workflow.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""
Units tests for openff.evaluator.layers.simulation
"""
import math
import os
import tempfile

import numpy
import pytest
from openff.toolkit.typing.engines.smirnoff import ForceField

Expand All @@ -12,9 +14,11 @@
from openff.evaluator.backends import ComputeResources
from openff.evaluator.backends.dask import DaskLocalCluster
from openff.evaluator.forcefield import ParameterGradientKey, SmirnoffForceFieldSource
from openff.evaluator.properties import Density
from openff.evaluator.protocols.groups import ConditionalGroup
from openff.evaluator.protocols.miscellaneous import DummyProtocol
from openff.evaluator.substances import Substance
from openff.evaluator.tests.utils import create_dummy_property
from openff.evaluator.thermodynamics import ThermodynamicState
from openff.evaluator.workflow import (
ProtocolGroup,
Expand Down Expand Up @@ -313,3 +317,18 @@ def test_find_relevant_gradient_keys(tmpdir):

assert len(gradient_keys) == len(expected_gradient_keys)
assert {*gradient_keys} == expected_gradient_keys


def test_generate_default_metadata_defaults():
dummy_property = create_dummy_property(Density)
dummy_forcefield = "smirnoff99Frosst-1.1.0.offxml"

data = Workflow.generate_default_metadata(dummy_property, dummy_forcefield)

assert data["parameter_gradient_keys"] == []
assert numpy.isclose(
data["target_uncertainty"], math.inf * unit.gram / unit.milliliter
)
assert numpy.isclose(
data["per_component_uncertainty"], math.inf * unit.gram / unit.milliliter
)
3 changes: 1 addition & 2 deletions openff/evaluator/workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def _find_relevant_gradient_keys(
def generate_default_metadata(
physical_property,
force_field_path,
parameter_gradient_keys=None,
parameter_gradient_keys=UNDEFINED,
target_uncertainty=None,
):
"""Generates the default global metadata dictionary.
Expand Down Expand Up @@ -1100,7 +1100,6 @@ def _store_output_data(
output_to_store,
results_by_id,
):

"""Collects all of the simulation to store, and saves it into a directory
whose path will be passed to the storage backend to process.
Expand Down

0 comments on commit 4813d3d

Please sign in to comment.