Skip to content

Cannot work with undefined certainties #674

Open
@lilyminium

Description

@lilyminium

Describe the bug

@barmoral and I are seeing the below when the uncertainty is undefined:

Traceback (most recent call last):
  File "software/anaconda/env/evaluator-cuda118/lib/python3.12/site-packages/pint/facets/numpy/quantity.py", line 244, in __getattr__
    return getattr(self._magnitude, item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'float' object has no attribute 'unit'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "software/anaconda/env/evaluator-cuda118/lib/python3.12/site-packages/openff/evaluator/layers/layers.py", line 328, in _process_results
    input_uncertainty = math.inf * matches[0].value.unit
                                   ^^^^^^^^^^^^^^^^^^^^^
  File "software/anaconda/env/evaluator-cuda118/lib/python3.12/site-packages/pint/facets/numpy/quantity.py", line 246, in __getattr__
    raise AttributeError(
AttributeError: Neither Quantity object nor its magnitude (0.90329) has attribute 'unit'. Did you mean: 'units'?

To Reproduce

Run a benchmark of a dataset where one or more properties has the uncertainty undefined.

e.g.

single-prop.json

Output

Computing environment (please complete the following information):

  • Operating system
  • Output of running conda list

Additional context

I think this is just a typo and we did mean "units" there. A test should probably not try to run through the entire process of simulating something, but instead focus on the _process_results method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions