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

simplifying and clarifying sample child classes #56

Closed
nsheff opened this issue Feb 23, 2017 · 0 comments
Closed

simplifying and clarifying sample child classes #56

nsheff opened this issue Feb 23, 2017 · 0 comments

Comments

@nsheff
Copy link
Contributor

nsheff commented Feb 23, 2017

Right now sample subtype objects can be installed or loaded by importing a file; sample subtype classes must define a __library__ attribute, like in this code:

        for _, module in inspect.getmembers(sys.modules["pipelines"], lambda member: inspect.ismodule(member)):
            st = inspect.getmembers(module, lambda member: inspect.isclass(member) and hasattr(member, "__library__"))
            sample_types += st

Instead, we could:

  • simply search the modules for class members that extend Sample
  • eliminate __library__
  • perhaps indicate in pipeline_interface if such a class exists ?

Currently in make_sample here each sample re-loads and re-imports modules, which is inefficient.

The pipeline interface has this information and could be used to map a sample to its specific Sample child classes.

In the future, we need to continue to allow 2 ways of doing this:

  1. easy-user way, where users clone pipelines and then analysis scripts can load sample child classes as needed from those files, which may differ from project to project
  2. developer mode, where python-savvy user uses virtual environments per project and installs pipeline scripts, so they need to be imported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant