-
Notifications
You must be signed in to change notification settings - Fork 36
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
Better DX with experiment module #463
Comments
If we already have good canonical way - we should include it somewhere in documentation. |
AFAIK you can also subclass gumby/experiments/algorand/algorand_module.py Lines 23 to 24 in 7a9d428
gumby/gumby/modules/blockchain_module.py Lines 7 to 8 in 400824d
Does this not work? |
Yes, but |
Intuitively that's how it should work in my opinion. I'd almost consider I guess this is not propagating as |
This should be the culprit: Lines 217 to 218 in c5aa64a
My guess would be |
@grimadas do you have a minimum working example? If you do, could you try out this: member_names = set()
for subclass in target.__class__.mro():
for name in dir(subclass):
if name not in member_names and type(getattr(subclass, name, None)).__name__ != "property":
member_names.add(name) |
@qstokkink Thanks it works. Now my code looks like this:
Notice that experiments differ only in their community. While communities have same interface. Do you think it can be further improved? |
Seems like that is about as small as it will get with "plain" Python. You could still minify this by making a new decorating function. It's probably not worth the time investment though (unless it really bothers you). Could you make a PR for the |
Yes, will create pr for this |
As far as I can see, right now gumby works like this:
@static_module
, so it cannot be reused, inherited or extended.However during my experiments I notice that I need a better separation between community object and experiment logic.
As for now your overlay is fixed in
__init__
of your experiment, but I want to reuse same experiment logic for different communities without boilerplate copying.P.S.
DX for Developer Experience
The text was updated successfully, but these errors were encountered: