Skip to content

Commit

Permalink
Merge pull request #179 from mwcraig/add-jupyter-app-launcher
Browse files Browse the repository at this point in the history
Add jupyter app launcher
  • Loading branch information
mwcraig authored Sep 19, 2024
2 parents 82cc08e + b2ea115 commit 208a47f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 33 deletions.
9 changes: 9 additions & 0 deletions .jp_app_launcher_reducer.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ dependencies = [
"numpy",
"scikit-image",
"scipy",
"jupyter-app-launcher",
"ipyautoui",
]

[project.optional-dependencies]
Expand All @@ -54,3 +56,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"
4 changes: 1 addition & 3 deletions reducer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
32 changes: 2 additions & 30 deletions reducer/reducer-template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
]
},
{
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 208a47f

Please sign in to comment.