From 0d70bb7b82765e5b93e19de10a1ace7d6cc36be7 Mon Sep 17 00:00:00 2001 From: MARCHAND MANON Date: Tue, 25 Jun 2024 17:40:43 +0200 Subject: [PATCH] fix: mocs can now be added without calling serialize --- ...intro-to-python-vizier-and-ipyaladin.ipynb | 26 ++++++++++++------- content/03-draw_me_a_MOC.ipynb | 17 ++++++++---- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/content/01-intro-to-python-vizier-and-ipyaladin.ipynb b/content/01-intro-to-python-vizier-and-ipyaladin.ipynb index 02d202c..2bbf681 100644 --- a/content/01-intro-to-python-vizier-and-ipyaladin.ipynb +++ b/content/01-intro-to-python-vizier-and-ipyaladin.ipynb @@ -13,7 +13,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install anywidget\n", + "%pip install ipywidgets==8.1.2\n", + "%pip install ipyaladin\n", "%pip install sidecar" ] }, @@ -136,12 +137,11 @@ "metadata": {}, "outputs": [], "source": [ - "aladin.add_moc_from_dict(catalog_coverage.serialize(\"json\"),\n", - " {\"color\": \"lightblue\",\n", - " \"fill\": True,\n", - " \"edge\": True,\n", - " \"opacity\": 0.2\n", - " })" + "aladin.add_moc(catalog_coverage,\n", + " color=\"lightblue\",\n", + " fill=True,\n", + " edge=True,\n", + " opacity=0.2)" ] }, { @@ -203,7 +203,7 @@ ], "metadata": { "kernelspec": { - "display_name": "jupyterlite-cds", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -219,13 +219,19 @@ "pygments_lexer": "ipython3", "version": "3.10.11" }, - "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "86f746604a95311db3b65fdbe489811da477d28d9b9887fbfebf91cebe84b237" } + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/content/03-draw_me_a_MOC.ipynb b/content/03-draw_me_a_MOC.ipynb index 74661f0..8de83d8 100644 --- a/content/03-draw_me_a_MOC.ipynb +++ b/content/03-draw_me_a_MOC.ipynb @@ -36,8 +36,7 @@ "metadata": {}, "outputs": [], "source": [ - "await micropip.install(\"emfs:\" + str(path) for path in whl_paths)\n", - "await micropip.install(\"widgetsnbextension\")" + "await micropip.install(\"emfs:\" + str(path) for path in whl_paths)" ] }, { @@ -46,7 +45,8 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install anywidget" + "%pip install ipywidgets==8.1.2\n", + "%pip install ipyaladin" ] }, { @@ -147,7 +147,7 @@ "metadata": {}, "outputs": [], "source": [ - "aladin.add_moc_from_dict(polygon_moc.serialize(\"json\"), {\"color\": \"pink\", \"opacity\": 0.5})" + "aladin.add_moc(polygon_moc, color=\"pink\", opacity=0.5)" ] } ], @@ -167,12 +167,19 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.15" + "version": "3.10.11" }, "vscode": { "interpreter": { "hash": "85bb43f988bdbdc027a50b6d744a62eda8a76617af1f4f9b115d38242716dbac" } + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": {}, + "version_major": 2, + "version_minor": 0 + } } }, "nbformat": 4,