foyer
foyer copied to clipboard
Add initial attempt at a plugin detector.
Here is an attempt at a writing a plugin detector (fixes #290). See foyer.plugins:collect_plugins()
Functions named foyer.forcefields.load_{plugin_name}
are detected as plugins, but there is also a plugin_names
argument to supply a list of plugin function names that don't fit that mold. The version
, xml_file
, and load_function
are collected into a dict
and returned.
I still don't know how to get the version
. Maybe we could add it as an attribute of the plugin forcefield object when we load it up:
def load_OPLSAA():
ff = get_forcefield(name='oplsaa')
ff.version = "0.0.1"
return ff
Codecov Report
Merging #292 into master will decrease coverage by
0.79%
. The diff coverage is25%
.
@@ Coverage Diff @@
## master #292 +/- ##
=========================================
- Coverage 86.55% 85.76% -0.8%
=========================================
Files 14 15 +1
Lines 1220 1236 +16
=========================================
+ Hits 1056 1060 +4
- Misses 164 176 +12
Ideally all of this information (like the xml file location and version) will be stored in the forcefield class, so we don't have to do any globbing. I think this is something @mattwthompson is working on