Skip to content

Upgrade#25

Merged
jpdeleon merged 2 commits into
mainfrom
upgrade
May 13, 2026
Merged

Upgrade#25
jpdeleon merged 2 commits into
mainfrom
upgrade

Conversation

@jpdeleon

Copy link
Copy Markdown
Owner

Plot / pipeline fixes

  • quicklook/plot.py: restore missing odd-even and secondary-eclipse
    panels. New _strip_for_bin() helper drops non-numeric extra columns
    before LightCurve.bin(), so aggregate_downsample no longer chokes on
    string-typed quality columns carried by QLP / TGLC / CDIPS HLSPs.
    Also guards astropy Time-typed columns whose .dtype access raises
    AttributeError. Each .bin().errorbar() is now wrapped in
    try/except (ValueError, TypeError) with logger.warning so any future
    failure surfaces in the per-target log instead of producing a
    silently empty panel.
  • quicklook/tql.py: in append_tls_results, persist pipeline, flux_type,
    exptime, and cadence into the TLS h5 (previously commented out, which
    is why every column for these fields was empty in summaries).

TLS Summary page (new)

  • New template quicklook/app/templates/tls_summary.html and new Flask
    view tls_summary in quicklook/app/app.py. Sortable + searchable table
    of every *_tls.h5 result. Columns: Target, Pipeline, Exp (s), Sector,
    Porb [d], Dur [hr], Rp/Rs, Depth [ppt], SDE, SNR, FAP, Odd-even delta,
    N_tr, Prot [d], GLS power, TOI, TIC, Files. Click any header to sort
    (numeric vs string aware, missing values to the bottom, numerics
    default to descending). Live filter input across all columns with a
    visible / total counter. Light + dark themes.
  • New helper _coerce_scalar() unwraps 0-d / 1-elem numpy arrays into
    Python scalars so Jinja sees real values.
  • New helper _parse_tls_filename() recovers pipeline, flux_type, and
    cadence from the filename for older h5 files saved before the tql.py
    fix above. Falls back to a sensible exptime hint for SPOC short
    cadence.
  • Files that fail to parse are surfaced under a collapsible "skipped"
    details block, not silently dropped.

Directory picker for the TLS Summary page

  • tls_summary accepts ?dir=<absolute_path>. Default (reads
    app/static/outputs/) is preserved. Path is validated; bad / missing
    paths fall back to the default and surface a dir_error banner.
  • Files outside OUTPUT_DIR show their absolute on-disk path in the
    Files column instead of broken /static/outputs/... links. No
    generic file-streaming endpoint is added.
  • Header form offers a path input with Load, a Reset link (only when
    on a custom dir), and a Browse... button.
  • New Flask route list_dirs (/list-dirs?path=...) returns immediate
    subdirectory listings as JSON with a has_tls flag per entry. Scoped
    to allowed roots via _get_allowed_browse_roots() (default: $HOME;
    override with colon-separated ALLOWED_BROWSE_ROOTS env var) and
    _is_under_allowed_root(). Anything outside returns 403 with no info
    leak. Skips hidden directories; reports has_tls_here for the current
    path; provides breadcrumbs and a parent path for navigation.
  • Browse modal: clickable breadcrumb + Up button; folder rows with a
    "tls" pill on dirs that contain *_tls.h5; "Only show folders with
    TLS files" checkbox (persisted in localStorage) that hides non-TLS
    rows via CSS; ESC / backdrop / x / Cancel close the modal.
  • Recent-dir history persisted in localStorage
    (tls-summary-dir-history, last 10). Selected directory itself is
    persisted (tls-summary-current-dir) so bare visits to /tls-summary
    redirect once to ?dir=; Reset link clears it.

Improved error visibility

  • quicklook/app/app.py: the broad except Exception around job runs
    now captures traceback.format_exc() into the per-target log so
    "failed unexpectedly" entries include the offending file:line. The
    GUI badge still shows only the short str(e).

Gallery / index polish

  • gallery.html: added "Summary" button in the top bar linking to
    /tls-summary; added "per page" dropdown (12 / 24 / 48 / 96 / 192)
    beside Next. Pagination links propagate the value; changing the
    dropdown reloads with the new size and resets to page 1. Server-
    side allowlist (GALLERY_PER_PAGE_CHOICES) validates ?per_page=.
    Fixed CSS so the "per page" label text no longer inherits the
    .pagination span button pill style.
  • index.html: added a "TLS Summary" entry to the footer-nav.

Unified loading overlay

  • Same .page-loading markup + .pl-spinner CSS on index.html,
    gallery.html, and tls_summary.html. Shown when the user clicks
    TLS Summary (index + gallery) or changes the selected directory /
    clicks Reset (tls_summary). Lazy lookup of #pageLoading inside the
    click handler so the script-runs-before-element ordering pitfall
    cannot prevent the overlay from showing.

jpdeleon added 2 commits May 13, 2026 09:40
Plot / pipeline fixes
- quicklook/plot.py: restore missing odd-even and secondary-eclipse
  panels. New _strip_for_bin() helper drops non-numeric extra columns
  before LightCurve.bin(), so aggregate_downsample no longer chokes on
  string-typed quality columns carried by QLP / TGLC / CDIPS HLSPs.
  Also guards astropy Time-typed columns whose .dtype access raises
  AttributeError. Each .bin().errorbar() is now wrapped in
  try/except (ValueError, TypeError) with logger.warning so any future
  failure surfaces in the per-target log instead of producing a
  silently empty panel.
- quicklook/tql.py: in append_tls_results, persist pipeline, flux_type,
  exptime, and cadence into the TLS h5 (previously commented out, which
  is why every column for these fields was empty in summaries).

TLS Summary page (new)
- New template quicklook/app/templates/tls_summary.html and new Flask
  view tls_summary in quicklook/app/app.py. Sortable + searchable table
  of every *_tls.h5 result. Columns: Target, Pipeline, Exp (s), Sector,
  Porb [d], Dur [hr], Rp/Rs, Depth [ppt], SDE, SNR, FAP, Odd-even delta,
  N_tr, Prot [d], GLS power, TOI, TIC, Files. Click any header to sort
  (numeric vs string aware, missing values to the bottom, numerics
  default to descending). Live filter input across all columns with a
  visible / total counter. Light + dark themes.
- New helper _coerce_scalar() unwraps 0-d / 1-elem numpy arrays into
  Python scalars so Jinja sees real values.
- New helper _parse_tls_filename() recovers pipeline, flux_type, and
  cadence from the filename for older h5 files saved before the tql.py
  fix above. Falls back to a sensible exptime hint for SPOC short
  cadence.
- Files that fail to parse are surfaced under a collapsible "skipped"
  details block, not silently dropped.

Directory picker for the TLS Summary page
- tls_summary accepts ?dir=<absolute_path>. Default (reads
  app/static/outputs/) is preserved. Path is validated; bad / missing
  paths fall back to the default and surface a dir_error banner.
- Files outside OUTPUT_DIR show their absolute on-disk path in the
  Files column instead of broken /static/outputs/... links. No
  generic file-streaming endpoint is added.
- Header form offers a path input with Load, a Reset link (only when
  on a custom dir), and a Browse... button.
- New Flask route list_dirs (/list-dirs?path=...) returns immediate
  subdirectory listings as JSON with a has_tls flag per entry. Scoped
  to allowed roots via _get_allowed_browse_roots() (default: \$HOME;
  override with colon-separated ALLOWED_BROWSE_ROOTS env var) and
  _is_under_allowed_root(). Anything outside returns 403 with no info
  leak. Skips hidden directories; reports has_tls_here for the current
  path; provides breadcrumbs and a parent path for navigation.
- Browse modal: clickable breadcrumb + Up button; folder rows with a
  "tls" pill on dirs that contain *_tls.h5; "Only show folders with
  TLS files" checkbox (persisted in localStorage) that hides non-TLS
  rows via CSS; ESC / backdrop / x / Cancel close the modal.
- Recent-dir history persisted in localStorage
  (tls-summary-dir-history, last 10). Selected directory itself is
  persisted (tls-summary-current-dir) so bare visits to /tls-summary
  redirect once to ?dir=<saved>; Reset link clears it.

Improved error visibility
- quicklook/app/app.py: the broad except Exception around job runs
  now captures traceback.format_exc() into the per-target log so
  "failed unexpectedly" entries include the offending file:line. The
  GUI badge still shows only the short str(e).

Gallery / index polish
- gallery.html: added "Summary" button in the top bar linking to
  /tls-summary; added "per page" dropdown (12 / 24 / 48 / 96 / 192)
  beside Next. Pagination links propagate the value; changing the
  dropdown reloads with the new size and resets to page 1. Server-
  side allowlist (GALLERY_PER_PAGE_CHOICES) validates ?per_page=.
  Fixed CSS so the "per page" label text no longer inherits the
  .pagination span button pill style.
- index.html: added a "TLS Summary" entry to the footer-nav.

Unified loading overlay
- Same .page-loading markup + .pl-spinner CSS on index.html,
  gallery.html, and tls_summary.html. Shown when the user clicks
  TLS Summary (index + gallery) or changes the selected directory /
  clicks Reset (tls_summary). Lazy lookup of #pageLoading inside the
  click handler so the script-runs-before-element ordering pitfall
  cannot prevent the overlay from showing.
TLS Summary (quicklook/app/templates/tls_summary.html)
- New per-column filter row under the table headers. Each cell
  carries a small input that filters that column's rows live as
  the user types, in addition to the existing global search box.
- Numeric columns accept comparison expressions: >5, <10, >=2, <=1,
  =5 / ==5 (with float tolerance), and a..b for inclusive ranges.
  Bare text falls back to substring on the displayed value.
- String columns: ==text for exact (case-insensitive) match, else
  case-insensitive substring.
- The visible-count badge becomes "{visible} / {total} results" and
  reflects the AND of the global search and every active per-column
  predicate.
- Inputs with non-empty values get a highlighted border + bolder
  text so it's obvious which columns are filtered.
- A small hint line under the title documents the supported syntax.
- Alignment fix: the new table filter row uses a dedicated class
  .col-filter-row instead of .filter-row to avoid colliding with
  the Browse modal's existing .filter-row, which has display: flex.
  That collision turned the <tr> into a flex container and prevented
  cells from inheriting column widths from the table layout. The
  rename fixes the visible misalignment between header text and the
  input below, and stops the JS selector from accidentally picking
  up the modal's "Only TLS folders" checkbox.
- Filter cells use horizontal padding identical to the header and
  body cells (12px) so each input sits flush under its column.

Compare page (quicklook/app/templates/compare.html)
- Added Summary button in the top bar (between Gallery and the
  theme toggle), matching the gallery and tls_summary pages.
- Same .page-loading overlay (CSS, markup, and lazy-lookup click
  handler) shared with index / gallery / tls_summary, so clicking
  Summary on Compare shows the same "Loading TLS Summary…" spinner
  while the slow scan runs.
@jpdeleon jpdeleon merged commit 6c0eb81 into main May 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant