Closed kolibril13 closed 1 year ago
I like it. Maybe name this EvenOddWidget?
Generally I like examples to be small and simple for each facet of functionality. If I was building with this and I ran into a bug, I would scan for examples to find one that was doing something close to what I wanted, then change that example closer to my usecase, or try to spot what I was doing wrong.
Examples that require a lot of baggage dependencies are a slower to understand. This is good as is.
As a side note, I know that with traitlets you get the change event, unless I'm specifically interested in the delta, I choose to just access the value on the instance self.count
vs reaching into the change event change['new']
. Not sure about the recommended practice.
Generally I like examples to be small and simple for each facet of functionality
I absolutely share this philosophy!
What I really like is to have minimal boilerplate examples that showcase exactly one feature, which I can then use to build my scripts for my usecases.
Regarding the traitlets: I think self.count
looks more familiar, and is easier to understand, so I'd go with that.
check_is_even should not return a string, but a boolean
this is adjusted now!
oops, code suggestions for notebooks are not ideal ;), sorry for breaking it, I think you need to manually edit the json file
What is the suggested way to do PRs on notebooks. I have heard of a bunch of projects around this. What are your thoughts?
I prefer python files in git :)
Yes, some invalid notebook syntax was introduced by 14719dc, but I manually fixed that, now the notebook div should look good again.
Tip: You can enable "Rich Jupyter Notebook Diffs" in Github. It's still beta, but already works quite well:
@maartenbreddels : This is now ready to be merged.
I renamed some variables, changed the traitlets variable type and put the check_is_even logic in a separete function. I think this makes this example easier to understand. What do you think @paddymul?