Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cnn #210

Merged
merged 22 commits into from
Mar 26, 2020
Merged

Cnn #210

merged 22 commits into from
Mar 26, 2020

Conversation

svdavid
Copy link
Contributor

@svdavid svdavid commented Mar 25, 2020

Dumb branch name, actually dealing with #171 to work on keyword simplification.

new configuration setting LIB_PLUGINS. When you import nems, init.py creates registries (xforms_lib and keyword_lib) it will then import modules listed in LIB_PLUGINS. any function with the decorator xform or xmodule will be imported into the appropriate registry. xforms then uses these existing registries rather than creating new ones when you fit a model. I don't see why it's a problem--unless you want to have two sets of registries around(?)

to test, you can get the new nems_db master and add LIB_PLUGINS = ['nems_lbhb.columbia_helpers'] to nems.configs.settings

Copy link
Member

@arrrobase arrrobase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. This is somewhat similar to a module/plugin implementation I had been working on a while back as a long term project: https://github.com/awctomlinson/ModuleRegistry

@svdavid
Copy link
Contributor Author

svdavid commented Mar 26, 2020

@awctomlinson Thanks. Yeah, this does look very similar. I think the keywords can still be embedded in an object (like you did). Only difference as it is now is that the decorators assume that the function name is the keyword name. ... I guess the question is if it's helpful to have a generic "keyword" method and make the keyword a parameter or if my system will work. Well, we can always make it support either, just by adding an option to nems.registry.xform to pass the keyword name.

@svdavid svdavid merged commit b0bea99 into master Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants