choderalab / YankTools

Test systems for Yank
GNU General Public License v2.0
0 stars 2 forks source link

[WIP] Added __init__.py #6

Closed kyleabeauchamp closed 10 years ago

kyleabeauchamp commented 10 years ago

This is a first pass at exposing the important classes at the topmost package level. I will file a corresponding PR in Yank that uses this interface.

kyleabeauchamp commented 10 years ago

PS: here's what the top-level namespace currently looks like:

In [1]: import testsystems

In [2]: testsystems.
testsystems.AlanineDipeptideExplicit             testsystems.Diatom                               testsystems.LennardJonesFluid                    testsystems.SrcExplicit
testsystems.AlanineDipeptideImplicit             testsystems.HarmonicOscillator                   testsystems.LysozymeImplicit                     testsystems.SrcImplicit
testsystems.ConstraintCoupledHarmonicOscillator  testsystems.HarmonicOscillatorArray              testsystems.MethanolBox                          testsystems.systems
testsystems.CustomGBForceSystem                  testsystems.IdealGas                             testsystems.MolecularIdealGas                    testsystems.WaterBox
testsystems.CustomLennardJonesFluid              testsystems.LennardJonesCluster                  testsystems.SodiumChlorideCrystal                
kyleabeauchamp commented 10 years ago

OK this PR now properly installs each of the data directories when you run setup.py install

jchodera commented 10 years ago

Whoa, I totally missed this. Looks like yours works, mine doesn't. OK to merge yours.

kyleabeauchamp commented 10 years ago

Let me look over your PR and integrate the remaining differences...

kyleabeauchamp commented 10 years ago

PS this is what it feels like working with Robert--he's always 1 hour ahead of you...

jchodera commented 10 years ago

PS this is what it feels like working with Robert--he's always 1 hour ahead of you...

As they say, "a version control system is not a substitute for developer communication". :)

kyleabeauchamp commented 10 years ago

OK I just added in the other changes you had made in your PR--mainly the n_atoms sanity check for XML. I think you can start taking a look at this PR now.

jchodera commented 10 years ago

Looks good to merge.

My only question for the future is whether we want to specifically list all of the imported TestSystem derived classes in __init__.py, since that might get hairy if we add more. Or is this desirable behavior, since it lets us remove experimental test systems from the official imports?

kyleabeauchamp commented 10 years ago

So I could have done from systems import *, but that adds all the extra global "junk" that is present in the global namespace of systems.py. The selective import let's us keep things clean. Either way is fine, though.