openff-evaluator icon indicating copy to clipboard operation
openff-evaluator copied to clipboard

Cannot work with undefined certainties

Open lilyminium opened this issue 5 months ago • 0 comments

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.

lilyminium avatar Jun 25 '25 00:06 lilyminium