schrodinger.comparison.results module

class schrodinger.comparison.results.OptResult(st0, e, x, lattice_params)

Bases: tuple

e

Alias for field number 1

lattice_params

Alias for field number 3

st0

Alias for field number 0

x

Alias for field number 2

class schrodinger.comparison.results.SyncedOptResult(st1: Structure, st2: Structure, e: float, x: ndarray, lattice_params: dict)

Bases: NamedTuple

OptResult containing a pair of structures with shared e, x, and lattice_params, useful for the Z’=2 workflow to store two clusters that will be stacked.

st1: Structure

Alias for field number 0

st2: Structure

Alias for field number 1

e: float

Alias for field number 2

x: ndarray

Alias for field number 3

lattice_params: dict

Alias for field number 4

class schrodinger.comparison.results.OptResultSet(window, is_close: Callable = None, bin_size: float = 30, first_come_first_serve: bool = False)

Bases: object

This data structure holds unique data entries up to the is_close function.

To get the results, access data.

  1. energy windowing

  2. de-duplication

__init__(window, is_close: Callable = None, bin_size: float = 30, first_come_first_serve: bool = False)
Parameters:
  • window – allowed energy window from the lowest energy

  • is_close – it takes two OptResult objects as input and returns True if they are redundant.

  • bin_size – only OptResult objects whose energies are within bin_size will be compared by is_close

add(res: OptResult, dry_run=False) bool

Attempt to add new element and return True if succeeded.

@param dry_run: If set, only return whether the entry would be added.

Also its behavior follows first_come_first_serve

update(*others, skip_similarity_check=False)

@type others: variable number of OptResultSet objects @param skip_similarity_check: if False, only add element if it is unique

It is recommended to run this function with a list of OptResultSet objects in others rather than to run it in an external for loop over individual OptResultSet objects, as the former will ensure that the global lowest energy and window are set correctly, which will allow for energy filtering to eliminate more structures and require less of the more-expensive deduplication.

load_raw(unique_results: List[OptResult])

Add results directly without checking uniqueness.

insert_raw(res: OptResult)

insert res without checking closeness.

remove_high_energy_results()

Remove results with energy higher than cutoff. This keeps the size of the OptResultSet to a minimum.

property cutoff

Return energy cutoff

property data: List[OptResult]