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

Allow Plugins to request additional information #27

Closed
teddyrendahl opened this issue Jan 16, 2018 · 1 comment · Fixed by #31
Closed

Allow Plugins to request additional information #27

teddyrendahl opened this issue Jan 16, 2018 · 1 comment · Fixed by #31
Assignees
Milestone

Comments

@teddyrendahl
Copy link
Contributor

Expected Behavior

There may be use cases where there is information that is needed by multiple Plugins i.e experiment number. In the current schema, this info would have to be duplicated in the YAML file.

Possible Solution

Add an extra class attribute to the BasePlugin called extraneous. This would point to other information in the YAML file that may not be underneath the Plugin explicitly. Then in load_conf.py the extraneous list is checked any additional information needed is added to the info dictionary directly.
For example

YAML file

experiment_no : LJ001

happi:
         ...

Happi Plugin

class Plugin
     name = 'happi'
     extraneous = ['experiment_no']
@teddyrendahl teddyrendahl added this to the 0.1.0 milestone Jan 16, 2018
@teddyrendahl teddyrendahl self-assigned this Jan 16, 2018
@ZLLentz
Copy link
Member

ZLLentz commented Jan 18, 2018

An even simpler implementation might be to not require an extraneous argument at all, and let all plugins reference the original yaml dictionary. Solid idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants