-
Notifications
You must be signed in to change notification settings - Fork 4
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
Migrate keywords to module and xforms libraries #171
Comments
I've been thinking about this a little. These are just a few ideas regarding modules/keywords/plugins I have and not fully fleshed out. Open to ideas and discussions, and I'm not attached to this in any way. I think in terms of organization, each module should be a class. The idea would be to create a metaclass for modules with all the attributes and methods we expect modules to have, such as Separating out the registry and module metaclass into separate classes allows module subclassing without registration, so there could be parent module classes to group module types and help organization. Here's a gist example of what I'm thinking: https://gist.github.com/awctomlinson/865a94d70e8e2c4ccd4bba859761196e I'm sure I'm not thinking of some things. Open to ideas. I think the advantage of classes would be helping logically group everything about a module together. https://www.python.org/dev/peps/pep-0487/#subclass-registration |
Makes a lot of sense. A couple thoughts, with the goal of minimizing complexity:
|
I think the end goal should be to replace it, yes. This system would probably be a good way to keep track of the plotting functions as well in a
This would probably not require much rewriting. The only thing I can see changing would be the
I think keeping the plotting functions separate makes the most sense, to allow reuse the way the current system is set up. It might be good to be consistent in what arguments these plotting functions accept, and perhaps the modules could have a
Instead of being saved in the modelspec? |
No one loves tracking down keywords and editing them in separate files. So why not move them to the library where the corresponding functions live?
@jacobpennington idea: establish decorators for modelspec and xforms keywords. Then the keyword registries can scan all the modules and other libraries when being created. Then the keyword defs can be cleared out of plugins that dir can be reserved for users to add their own module+keywords and preproc/fitter+xforms-keywords
If we do this, we also want to make it easier to list and locate keywords and their associated code. So maybe add a few functions to nems.utils to list/search keywords?
The text was updated successfully, but these errors were encountered: