Skip to content

Ginga release v7.6.0

Latest

Choose a tag to compare

@ejeschke ejeschke released this 27 Oct 23:05
· 2 commits to main since this release
  • Canvas images drawn with scale_x/scale_y other than 1 are placed
    correctly when zoomed in. The CPU render pipeline cuts out only the
    visible part of an image, but clipped it as if the image were unscaled,
    so once a scaled image overflowed the window it was drawn shifted (or not
    at all) and appeared to jump while zooming. The Vulkan and OpenGL
    renderers were not affected.
  • Plots are drawn at full size on HiDPI displays. On a Retina screen (or
    any display where the backend reports a device pixel ratio above one)
    matplotlib scales the figure's dpi by that ratio, but
    PlotViewBase.set_window_size() divided the window size, in logical
    pixels, by the scaled dpi -- so the figure came out at 1/ratio of the
    size of the widget holding it, and compounded on every resize.
    get_window_size() had the matching error, reporting physical rather
    than logical pixels, which oversized the plot fonts. Reported against
    PypeIt, which carried a workaround for it.
  • Thumbs "Auto scroll" follows a newly arrived thumb only. It used to
    re-apply the scroll whenever anything asked for a thumb list update, so
    pausing or releasing the mouse mid-scroll snapped the pane back to the
    end, as did resizing the pane or removing a thumb. The scroll is now a
    one-shot request made when a thumb is added and consumed by the next
    update.
  • AstroTable.get_thumbnail() and Plotable.get_thumbnail() raise a
    PendingDeprecationWarning. Neither has ever produced a thumbnail:
    both return an identity matrix, which draws as a diagonal line. They
    will be removed in a future version; a viewer's
    get_thumbnail_array() is what produces a thumbnail of a table or a
    plot. BaseImage.get_thumbnail() is unaffected.
  • Plot and table viewers draw their own thumbnails. Neither is
    something the Thumbs thumbnail generator can render, so both were
    handled by screenshotting the viewer's widget. That only ever worked on
    Qt: the gtk3 capture needs the widget mapped and on screen, the gtk4 one
    could not work at all (it tried to instantiate the abstract
    Gsk.Renderer), and the web and tk backends have no capture at all.
    It also only worked while the object happened to be the one the viewer
    was showing, so any later regeneration left a placeholder that was then
    marked as not worth retrying. New ViewerBase.get_thumbnail_array()
    lets a viewer render its own data instead -- PlotViewBase renders its
    matplotlib figure, and TableViewBase draws a miniature of the table
    showing its first rows and columns and its full shape. Both work on
    every backend, with no widget, realized or otherwise. Thumbs now
    asks the viewer rather than testing its type, so a new viewer class gets
    thumbnails without changing the plugin.
  • PlotViewBase.get_rgb_array() renders the figure rather than capturing
    the plot widget, and TableViewGw.get_rgb_array() draws the table
    rather than capturing the table widget. The table viewer no longer
    returns the FITS placeholder icon, a 4-channel RGBA array that callers
    were treating as RGB.
  • ginga.gtk4w.GtkHelp.get_rgb_array() works. It now renders through
    Gtk.WidgetPaintable and the native surface's own renderer, and reads
    the texture back in a way that does not depend on the GTK version's
    pixel-format defaults.
  • Thumbs renders thumbnails one at a time, off the GUI thread. The
    thumb generator is a single stateful viewer -- set an image on it, then
    read the rendered pixels back -- and it was driven both by the GUI thread
    (as images arrived in a channel) and by the autoload worker, with nothing
    serializing them. Interleaving those two steps publishes one thumb's
    pixels under another thumb's name, with nothing raised to say so, and a
    render that threw took the whole thumb with it: generation used to run
    before the thumb was registered, so the image never appeared in the
    pane at all even though Contents listed it. Rendering is now queued
    and performed by a single drain (a pool task when there are threads, a
    coroutine that yields to the event loop when there are not, as under
    Pyodide), the thumb is registered before its image is asked for, and a
    failed render leaves a placeholder that the autoload pass retries. New
    setting gen_yield_interval tunes the yield rate in the single-threaded
    case. add_visible_thumbs() also no longer re-enters itself through
    the update_pending() call at its end.
  • ImageViewBase gained snapshot_attributes() / apply_attributes()
    and the get_attribute_keys() they share with copy_attributes().
    The snapshot holds setting values only, so a caller that must read a live
    viewer's appearance on the GUI thread can apply it to another viewer
    later, or elsewhere. copy_attributes() is unchanged.
  • A TreeView or TableView column can opt out of the header-click sort
    with sortable: False in its column descriptor, on every backend. A
    plain header click sorts, which is easy to do by accident and invisible
    when every value in the column is equal -- the sort is stable, so no row
    moves -- until a later edit to that column reshuffles its row. The flag
    only narrows (it cannot make a column sortable on a widget built with
    sortable=False) and it gates the user's gesture only, leaving
    sort_by_column() / sort_on_column() available for any column;
    treehelper.column_is_sortable() is the shared rule. Columns without
    the flag are unaffected. Along the way: the qt TableView no longer
    reports a sorted callback for header clicks on a table built with
    sortable=False, where nothing was ever sorted, and a header click
    that is not answered by a sort selects the column, as it already did on
    a table with sorting off.
  • The deprecated QTreeWidget-based TableView (_TableViewQTree) is
    removed from ginga.qtw.Widgets. It was superseded by the
    QTableWidget-based TableView in ginga.qtw._tableview, which is
    what the module exports, and was referenced from nowhere.
  • A plot viewer no longer draws into a figure that has no area. A
    widget reports a size of zero until it has been laid out -- a web canvas
    always does -- and a figure sized from that has nothing to draw in.
    matplotlib does not refuse: its layout engine warns that "axes sizes
    collapsed to zero", and the degenerate transforms left behind make the
    tick locator fail on a NaN ("cannot convert float NaN to integer"), once
    per redraw for as long as the widget stays that size. PlotViewBase
    now ignores a resize to a degenerate size, keeping the figure's previous
    one, and skips the redraw (and the tick-reading font-size pass) until
    there is room; the resize that gives the figure a real size redraws it.
  • astropy's log messages now appear in the Log plugin instead of going
    to stderr. astropy installs a StreamHandler on stderr of its own and
    never propagates to the viewer's logger, so its messages bypassed the
    viewer's log entirely on the desktop -- and, running in-situ under
    Pyodide, were painted onto the page behind the viewer, since there stderr
    is rendered into the document. The reference viewer now hands that logger
    its own handlers, through the new
    ReferenceViewer.redirect_logger(name), which also replaces the
    hand-rolled py.warnings redirect that did the same thing for Python
    warnings. Messages reach whatever the viewer's logging was asked for --
    the Log plugin, plus any --log file or --stderr.
  • Running in-situ under Pyodide, Python warnings stay captured into the
    py.warnings logger for the life of the application, so they reach the
    Log plugin too. run() had always handed warnings back to a plain
    stderr writer once the GUI was up, which is what a desktop user wants --
    but in-situ stderr is the page, so every warning raised while the viewer
    ran was printed across it. The desktop behavior is unchanged.
  • Running in-situ under Pyodide, logging.lastResort is pointed at a
    NullHandler. It is a stderr handler at WARNING level that Python uses
    for records from any logger with no handler of its own -- which is every
    logger until the GUI log handler is attached partway through startup --
    so those records were painted onto the page as well.
  • IQCalc.find_bright_peaks() takes a method, and offers 'sep'
    where that package is installed. It estimates the background on a mesh
    and thresholds against its noise map, so it finds sources evenly across
    an array whose background is uneven -- the 'native' method applies
    one threshold to the whole array and loses the fainter sources wherever
    the background runs high -- and it ignores anything smaller than
    minarea pixels, so a hot pixel is not a candidate.
    get_peak_methods() reports the ones a given object can actually use,
    preferred first; for iqcalc_astropy that is 'photutils',
    'sep' and 'native'. The Pick plugin offers them in a "Peak
    finding" combobox in its Settings panel, saved as calc_peak_alg.