-
Notifications
You must be signed in to change notification settings - Fork 174
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
Change progress bar instantiation for IPython >= 3 compatibility. #693
Conversation
For interest's sake, SymPy's equivalent function for doing this is |
In our case it is not really any printing functionality that gets initialized ... |
Are we still aiming to support Python 2.6 in Nengo 2.1? I'm using the |
We haven't made any changes to drop support yet; ideally we would have at least one release of Nengo OCL that works on 2.6, but if Nengo OCL can target 2.0.1 then we can drop it. |
Can we add |
Yeah, for sure; we do it for |
Nengo OCL is working for most features on 2.0.1. You can take a look at which tests I'm skipping to see which features aren't supported. I think for the most part, they're pretty minor, so I think we can go ahead with a release. In #633 I drop support of 2.6, basically just by removing the 2.6 tests. |
@tbekolay Do you know why they moved from an extension to a function in SymPy? I was thinking about changing The only way to automatically load the IPython progress bar (instead of the text version), seems to be to set an environment variable in |
I dug around and found an answer to my question. As in our case it only ever makes sense to run the function within IPython, an extension should be fine. |
Nice, I can finally close this tab ;) I didn't know off the top of my head so I'd have dug around as you did. That issue also linked to this one, so if they manage to figure that out then we can use their solution perhaps? |
Nah, we can't. :( |
Fist shake! ✊ 🍶 |
7ebe2e8
to
597e1b9
Compare
This should be ready for review now. |
bump |
Note to self: Add changelog entries:
|
Or do we prefer to add |
I'd prefer adding |
That's my preference as well. :) It'd be nice to not require importlib as well for Py 2.6, but it's not too bad.... |
The importlib code is just 38 lines of code. We could include it in Nengo? |
Eh... we already have some Python 2.6 specific dependencies ( |
Where is this list kept? There's |
Will let @jgosmann decide ;) |
I prefer more and smaller commits. |
So should we leave it at the 6 it is now then? |
Would be my vote. |
Yeah, I'm good with that. @hunse, acceptable? |
The changelog commit should definitely be squashed, IMO. Also, cfb5933 not only makes the change it purports to, but also does some refactoring. It's things like that which make me prefer fewer commits in some cases, because it seems less surprising to me that a commit changing the whole ProgressBar system would refactor things, versus a commit that says it changes when a warning is shown. Furthermore, 9a93fb8 unindents |
For the sake of concreteness, here are the two versions: Separated, the three commits have 262 insertions and 221 deletions. Squashed, the one commit has 187 insertions and 152 deletions. |
The refactoring is necessary to get rid of that warning mentioned in the commit message. In general I find it easier to understand the changes in smaller commits than one big commit and smaller commits are also more helpful with tools like I'm ok with squashing the changelog commit. "Fixes to the IPythonProgressWidget" implies that |
btw: "Remove IPython notebook detection (cannot be done with IPython notebook >3 aka Jupyter)" is not 100% correct. It cannot be done with IPython == 3 (not yet jupyter) either. |
My view is that the person making the PR has final say on the history, as they know better the intention behind each commit. That's why I like adding fixup / squash commits and getting a +1 before actually squashing / fixuping them (although admittedly I do a fair bit of squashing without an OK when a commit doesn't pass unit tests without a further commit). So, my vote would be to squash the changelog commit only.
I'll amend that commit message, whichever version we move forward with! |
Also, I think it's better to have changes in code and movement of code to other places in separate commits as it makes for a more helpful diff for the changes. Though I admit, removing identation and moving code around might not be as critical. The two commits I might squash in the long history are d81d2c7 and 6912d66 because the first of these directly caused the necessity of the second in a sense (to be able to set the IPython progress bar as a default in the config file). |
I probably use the word "fixes" too much; I use it whenever I change something. As I said, feel free to amend the message. I understand the reasoning behind smaller commits, but there are reasons for larger ones, too. I like them because they make the history easier to read, and easier to tell what's going on. If commits depend on commits around them for context, I think that's bad (not that that's the case here, per se). Obviously there's a balance; if commits are too small, then the history is too long and difficult to work with, and if they're too large, then any given commit is too hard to analyse. The question is where that balance is. I think in general, we should always put changelog entries in the commits making the changes, not by themselves. I think that will help guide the size of commits, because if you're making a change that only requires one changelog entry, then it's more difficult to split it across multiple commits (though of course you could, if for example the first commit makes the change and then the following are just refactoring, etc.). For this one, I'm fine with whatever. |
That's a case where non-fast-forward merges can make sense. (If the other option of squashing those commits together would end up with an unreasonable large commit.)
I agree. |
* Add RC option to set progress bar. * Remove IPython notebook detection (cannot be done with IPython notebook >=3 aka Jupyter) * Make into an extension that must be loaded with ``%load_ext``. Addresses #687.
Yeah, I would be open to something like that. I think that can still be considered a linear history, if the branch is always rebased to master before merging. |
a.k.a. IPython 4. Also ensure that tests run with IPython < 3.
I did the squash @jgosmann suggested in the long history. Is that version OK with everyone? Looks like the best compromise to me. Will bring that over here and merge if everyone's good with it. |
Fine by me. |
LGTM 🍰 |
af3ec0e
to
0ca50f6
Compare
notebook >3 aka Jupyter)
activate_ipynb_features()
function.Todo:
activate_ipynb_features()
activate_ipynb_features()
to examples?activate_ipynb_features()
automatically when a kernel in a notebook is started.We are still deploying the progress bar front-end code in IPython notebook in the non-recommended way:
This is for backwards compatibility (the recommended way does not work prior to IPython 3). It would be possible to deploy the code in the recommended way for IPython 3 only and in the old way otherwise. But that might require some code duplication. Thus, I would vote to keep it how it is at the moment and switch over at a later point when we drop support for older IPython versions. The downsides of the old way are: