-
Notifications
You must be signed in to change notification settings - Fork 18
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
ENH: Include questionnaire objects in the user object #84
Conversation
Codecov Report
@@ Coverage Diff @@
## master #84 +/- ##
==========================================
+ Coverage 98.72% 98.72% +<.01%
==========================================
Files 14 14
Lines 548 551 +3
==========================================
+ Hits 541 544 +3
Misses 7 7
Continue to review full report at Codecov.
|
cache(**exp_objs) | ||
user = get_exp_objs(proposal, run) | ||
for name, obj in qs_objs.items(): | ||
setattr(user, name, obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we at all be concerned about us getting a User
object we can't set attributes on? Or I'm just being paranoid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't consider this. How would this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone made object inherit from some strange object. Probably not worth worrying about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose I can imagine something a little less malicious, like:
@property
def inj_x(self):
return something
But I think for these instances we simply say... don't do that!
Description
User()
, add the questionnaire objects to itSimpleNamespace()
as a fallback for a missing or malformed experiment filex
touser
Motivation and Context
This is a feature of the old python that is very helpful. The
x
oruser
object becomes the object that the users are allowed to call methods from during their experiment.closes #82
How Has This Been Tested?
I added a check to make sure that the experiment object contained a reference to a questionnaire object.
Where Has This Been Documented?
I've added to the docs as appropriate on the startup routine page and on the experiments page. I have built the docs in my environment and they look as intended.