From d628943d6405ffc1ef23040ab16982fab7495b44 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Thu, 19 Sep 2024 12:44:56 -0500 Subject: [PATCH 1/5] Add jupyter-app-launcher dependency and config --- .jp_app_launcher_reducer.yaml | 9 +++++++++ pyproject.toml | 1 + 2 files changed, 10 insertions(+) create mode 100644 .jp_app_launcher_reducer.yaml diff --git a/.jp_app_launcher_reducer.yaml b/.jp_app_launcher_reducer.yaml new file mode 100644 index 0000000..0b2b59e --- /dev/null +++ b/.jp_app_launcher_reducer.yaml @@ -0,0 +1,9 @@ +# Notebook in the "Stellarphot setup" section of the launcher + +- title: Image calibration + description: Settings for camera, observatory and passbands + source: ../reducer/reducer-template.ipynb + icon: ../reducer/stellarphot-logo.svg + cwd: not_used + type: notebook + catalog: Astro tools diff --git a/pyproject.toml b/pyproject.toml index dc68fc7..8433127 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ dependencies = [ "numpy", "scikit-image", "scipy", + "jupyter-app-launcher", ] [project.optional-dependencies] From 0b1592b5aa0d0f4cfcdf694d540508c6a8df4811 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Thu, 19 Sep 2024 12:55:49 -0500 Subject: [PATCH 2/5] Add jupyter-app-launcher files to wheel --- pyproject.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8433127..45f3e9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,3 +55,11 @@ version-file = "reducer/_version.py" include = [ "/reducer", ] + +[tool.hatch.build.targets.wheel.shared-data] +# This section determines what data files are included in the wheel +# and where they should eventually be installed in the user's environment. +"docs/_static/stellarphot-logo.svg" = "share/jupyter/stellarphot/stellarphot-logo.svg" +# This includes the notebooks used in the launcher +"reducer/reducer-template.ipynb" = "share/jupyter/reducer/reducer-template.ipynb" +".jp_app_launcher_reducer.yaml" = "share/jupyter/jupyter_app_launcher/jp_app_launcher_stellarphot.yaml" From 184e94c006709f26bb64534a951deb355e78a5e8 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Thu, 19 Sep 2024 12:56:09 -0500 Subject: [PATCH 3/5] Add missing dependency --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 45f3e9f..3884a12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ dependencies = [ "scikit-image", "scipy", "jupyter-app-launcher", + "ipyautoui", ] [project.optional-dependencies] From ca30fabb3f55262e46501b1821863a03802b6dce Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Thu, 19 Sep 2024 13:12:53 -0500 Subject: [PATCH 4/5] Make sure __version__ can be imported --- reducer/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/reducer/__init__.py b/reducer/__init__.py index 76608cb..7dfab0e 100644 --- a/reducer/__init__.py +++ b/reducer/__init__.py @@ -3,6 +3,4 @@ from .core import * -from ._version import get_versions -__version__ = get_versions()['version'] -del get_versions +from ._version import __version__, __version_tuple__ # noqa: F401 From b2ea11568b6ec86757d38415af6efe8fd15eeda6 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Thu, 19 Sep 2024 15:18:48 -0500 Subject: [PATCH 5/5] Clean up template notebook --- reducer/reducer-template.ipynb | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/reducer/reducer-template.ipynb b/reducer/reducer-template.ipynb index e2ef752..9bd41d1 100644 --- a/reducer/reducer-template.ipynb +++ b/reducer/reducer-template.ipynb @@ -7,27 +7,6 @@ "## Reducer: (Put your name here)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Reviewer: (Put your name here)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# jupyter notebook crash course" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Click on a code cell (has grey background) then press Shift-Enter (at the same time) to run a code cell. That will add the controls (buttons, etc) you use to do the reduction one-by-one; then use them for reduction." - ] - }, { "cell_type": "code", "execution_count": null, @@ -53,7 +32,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Enter name of directory that contains your data in the cell below, " + "# Select the directory that contains your data in the cell below" ] }, { @@ -167,7 +146,7 @@ "exp_times_chooser = ipw.Dropdown(description=\"Exposure time\", options=EXPOSURE_KEYWORDS)\n", "maybe_exp_time = [exp for exp in EXPOSURE_KEYWORDS if exp.lower() in images.summary.colnames]\n", "exp_times_chooser.value = maybe_exp_time[0] if maybe_exp_time else EXPOSURE_KEYWORDS[0]\n", - " \n", + "\n", "title = ipw.HTML(value=\"Choose the keyword in your images for each type\")\n", "vb = ipw.VBox(children=[title] + list(widgets.values()) + [exp_times_chooser])\n", "vb\n" @@ -489,13 +468,6 @@ "reduced_browser = ImageBrowser(reduced_collection, keys=['imagetyp', 'filter'])\n", "reduced_browser.display()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {