-
Notifications
You must be signed in to change notification settings - Fork 945
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
Using the new Comm Python package #3533
Conversation
@@ -421,7 +421,7 @@ def get_view_spec(self): | |||
|
|||
_view_count = Int(None, allow_none=True, | |||
help="EXPERIMENTAL: The number of views of the model displayed in the frontend. This attribute is experimental and may change or be removed in the future. None signifies that views will not be tracked. Set this to 0 to start tracking view creation/deletion.").tag(sync=True) | |||
comm = Instance('ipykernel.comm.Comm', allow_none=True) |
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.
See #3602 for removing this as a trait.
Wow. I think it is quite an improvement. |
0f36487
to
fb1aa4d
Compare
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.
Great work.
I do worry we do not have a test yet that exposes ipython/ipykernel#1090
I'm pretty sure this fixes it, but #3653 also didn't pick up this issue, which leaves me a bit worries that we're vulnerable for regressions.
Thanks a lot for your review @maartenbreddels ! I will resolve your comment and get the CI green hopefully :D |
81f707d
to
822f93f
Compare
73b0187
to
647315d
Compare
@maartenbreddels it was difficult to get green but now it seems good! Thankfully, the Python 3.7 build requires an old version of ipykernel (latest ipykernel does not support 3.7?) so we have tests against the old versions and new versions. |
Would you have time to make it a review @maartenbreddels ? |
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.
awesome work, some minor comments
@@ -229,7 +229,7 @@ def test_update_dynamically(self, send_state): #pylint: disable=no-self-use | |||
assert box.layout.grid_template_areas == ('"top-left top-right"\n' + | |||
'"bottom-left bottom-right"') | |||
# check whether frontend was informed | |||
send_state.assert_called_once_with(key="grid_template_areas") | |||
send_state.assert_called_with(key="grid_template_areas") |
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.
why is it not called once? is it called multiple times?
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.
Yes, I think the test was faulty from the beginning. Though it's unclear to me as to why my PR fixes it.
Setting bottom_left
would not only trigger changing grid_template_areas but also a couple more properties from layout
Thanks for the review! I resolved your comments |
Hello. Is there a plan to merge and release this soon? We are seeing deprecation warning from stable version of ipykernel downstream. Thank you! |
@martinRenou do you know what caused that change?
Yes, I think we should get this released asap, which I could do tomorrow if we manage to get this in. |
This test was supposed to fail, as setting the bottom_left value will trigger a ipywidgets.Layout.send_state on `child.layout.grid_area = position` (ipywidgets.widgets.widget_template.py L419) and on `self.layout.grid_template_areas = grid_template_areas_css` (ipywidgets.widgets.widget_template.py L448)
Co-authored-by: Maarten Breddels <[email protected]>
@maartenbreddels all green! |
@martinRenou great work, i guess we also need to backport this to 7.x |
@meeseeksdev please backport to 7.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
* Move comm package * Fix wrongly written test This test was supposed to fail, as setting the bottom_left value will trigger a ipywidgets.Layout.send_state on `child.layout.grid_area = position` (ipywidgets.widgets.widget_template.py L419) and on `self.layout.grid_template_areas = grid_template_areas_css` (ipywidgets.widgets.widget_template.py L448) * Fix Python 3.7 test Co-authored-by: Maarten Breddels <[email protected]> (cherry picked from commit 785d159)
If seeing errors like this in def _create_comm(*args, **kwargs):
"""Create a Comm.
This method is intended to be replaced, so that it returns your Comm instance.
"""
> raise NotImplementedError("Cannot ")
E NotImplementedError: Cannot Adding: import ipykernel.ipkernel # noqa Is enough to trigger the side-effects to overload that manager. Seems like it should go in the docs... or even in that unhelpful traceback itself, cuz 99% of the time, i reckon people are testing with |
- ModelManager features - import a spacy model created by DataManager - set metadata such as author, license, etc - publish the model to hugging face - add `test_model_manager` notebook with example of use - add `spacy-huggingface-hub` and `wheel` to dependencies also - refactor tests - simplify fixtures code in conftest.py - add `model_path` fixture to conftest.py - pin ipywidgets<8.0.5 for now to avoid test failures in CI - looks due to this change: jupyter-widgets/ipywidgets#3533
- ModelManager features - `load()` imports a spacy model created by DataManager - `metadata` dict exposes metadata the user should edit such as author, license, etc - `save()` saves changes (currently only the updated metadata can be changed) - `publish()` publishes the model to hugging face - add `test_model_manager` notebook with example of use - add `spacy-huggingface-hub` and `wheel` to dependencies also - refactor tests - simplify fixtures code in conftest.py - add `model_path` fixture to conftest.py that provides a trained spacy model - pin ipywidgets<8.0.5 for now to avoid test failures in CI - looks like it is due to this change: jupyter-widgets/ipywidgets#3533
This change is required by the upgrade of ipywidgets. jupyter-widgets/ipywidgets#3533 One of the changes in this new version is the removal of the dependency ipykernel, which we require to add it as explicit dependency.
This change is required by the release of ipywidgets at version 8.0.5. jupyter-widgets/ipywidgets#3533 One of the changes in this new version is the removal of the dependency ipykernel, which we would require to add it as explicit dependency. Due to potential breaking changes, we fix its maximum version below 8.0.5.
This change is required by the release of ipywidgets at version 8.0.5. jupyter-widgets/ipywidgets#3533 One of the changes in this new version is the removal of the dependency ipykernel, which we would require to add it as explicit dependency. Due to potential breaking changes, we fix its maximum version below 8.0.5.
Related discussions:
Currently working on a Python comm package on https://github.com/martinRenou/comm for now, but it should probably be moved in the IPython org
This has the benefit of being able to: