sustainable-processes / pura

Clean chemical data quickly
MIT License
10 stars 3 forks source link

Enable no agreement #12

Closed marcosfelt closed 1 year ago

marcosfelt commented 1 year ago

This PR fixes #7 by enabling agreement to be set to zero in the compound resolver functions. If agreement is set to zero, then all services will be tried and the unique results returned.

Example:

resolved = resolve_identifiers(
    ["Josiphos SL-J001-1"],
    input_identifer_type=CompoundIdentifierType.NAME,
    output_identifier_type=CompoundIdentifierType.INCHI_KEY,
    services=[
        PubChem(),
        CIR(),
    ],
    agreement=0,
)
correct_inchi = "ULNUEACLWYUUMO-UHFFFAOYSA-N"
input_compound, resolved_identifiers = resolved[0]
assert resolved_identifiers[0].value == correct_inchi