openforcefield / openff-qcsubmit

Automated tools for submitting molecules to QCFractal
https://openff-qcsubmit.readthedocs.io/en/latest/index.html
MIT License
26 stars 4 forks source link

Add `verify=False` as an optional named argument to `collection.to_records()` #269

Open j-wags opened 4 months ago

j-wags commented 4 months ago

When a user has to specify verify=False to construct a PortalClient, they aren't able to run to_records later on, since that makes a new PortalClient with the default (verify=True)

from qcportal import PortalClient

qc_client = PortalClient("https://api.qcarchive.molssi.org:443")
from openff.qcsubmit.results import (
    BasicResultCollection,
    OptimizationResultCollection,
    TorsionDriveResultCollection,
)

# Pull down the torsion drive records from the 'OpenFF Protein Capped 3-mer Backbones v1.0' dataset.
torsion_drive_result_collection = TorsionDriveResultCollection.from_server(
    client=qc_client,
    datasets="OpenFF Protein Capped 3-mer Backbones v1.0",
    spec_name="default",
)
from openff.qcsubmit.results.filters import SMARTSFilter

filtered_collection = torsion_drive_result_collection.filter(SMARTSFilter(smarts_to_include=["C[SH]"]))
filtered_collection
torsion_drive_records = filtered_collection.to_records()

(returns a "you should set verify=False" error)