Open mattwthompson opened 2 weeks ago
Without thinking too hard, I'm generally in favor of this. If there are use cases that don't provide a topology, the user should have to "own" the nonstandardness of whatever they're trying to do and provide a Topology-like object that has enough information to satisfy their use case. Especially since the alternative is to add a ton of complexity to Interchange to handle cases where a Topology isn't available.
Description One of the squishier details of the current designs is how many fields on the
Interchange
model are optional:https://github.com/openforcefield/openff-interchange/blob/v0.3.27/openff/interchange/components/interchange.py#L140-L144
This makes sense for some fields like velocities, but how useful is an
Interchange
without a topology? The standard creation pathway used byForceField.create_interchange(topology)
sets theInterchange.topology
attribute based on the argument to that method, so making it required should have zero impact on all or a vast majority of SMIRNOFF-centric use cases.Are there any use cases involving
Interchange
s without topologies that I'm forgetting?I have a note from @Yoshanuikabundi several months back that
.from_openmm
might be trickier since OpenMM topologies are strictly optionalbut I think ~99% of use cases involve one and that could either be unsupported with minimal impact or hacked around.
Polymorphic fields have some costs - type-checkers have surprising trouble with attributes that can either be
None
or rich classes. In general I'd rather have the set of allowed types on a field be smaller than larger.If this lands, it would be a breaking change as part of the 0.4.0 release.