foyer icon indicating copy to clipboard operation
foyer copied to clipboard

Add initial attempt at a plugin detector.

Open uppittu11 opened this issue 5 years ago • 2 comments

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

uppittu11 avatar Nov 01 '19 14:11 uppittu11

Codecov Report

Merging #292 into master will decrease coverage by 0.79%. The diff coverage is 25%.

@@            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

codecov[bot] avatar Nov 01 '19 15:11 codecov[bot]

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

uppittu11 avatar Nov 22 '19 18:11 uppittu11