Skip to content

MNT set default colorbar_location for quickshow flatmaps to 'right'#594

Open
mvdoc wants to merge 1 commit intogallantlab:mainfrom
mvdoc:nf/colorbar_location
Open

MNT set default colorbar_location for quickshow flatmaps to 'right'#594
mvdoc wants to merge 1 commit intogallantlab:mainfrom
mvdoc:nf/colorbar_location

Conversation

@mvdoc
Copy link
Contributor

@mvdoc mvdoc commented Feb 26, 2026

Let's have saner defaults...

(The rest of the edits are linting.)

Copilot AI review requested due to automatic review settings February 26, 2026 17:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the default colorbar_location for quickflat flatmap rendering to place the colorbar on the right by default, along with various formatting/linting-only edits in the quickflat view helpers.

Changes:

  • Change make_figure default colorbar_location from "center" to "right".
  • Reformat/standardize string quoting and argument formatting across quickflat rendering helpers.
  • Minor cleanup of imports/formatting in make_movie stub.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fig=None,
extra_hatch=None,
colorbar_ticks=None,
colorbar_location="right",
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function default was changed to colorbar_location="right", but the docstring still states the default is "center". Please update the docstring so it matches the new default to avoid confusing API users.

Copilot uses AI. Check for mistakes.
fig=None,
extra_hatch=None,
colorbar_ticks=None,
colorbar_location="right",
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR changes the default colorbar location behavior, but existing tests only cover explicit colorbar_location values. Please add a regression test that calling make_figure(..., with_colorbar=True) without specifying colorbar_location places the colorbar at the new default location.

Suggested change
colorbar_location="right",
colorbar_location="center",

Copilot uses AI. Check for mistakes.
Comment on lines 576 to 582
"""Create a movie of an 4D data set"""
raise NotImplementedError
import sys
import shlex
import shutil
import tempfile
import subprocess as sp
import multiprocessing as mp

Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make_movie unconditionally raises NotImplementedError but still contains a large block of unreachable implementation code below the raise. Please either remove the dead code (and keep only the explicit stub), or drop the raise and make this function functional; leaving unreachable code makes maintenance and linting harder.

Copilot uses AI. Check for mistakes.
Comment on lines 545 to +549
tmpdir.cleanup()

imageio.mimsave(output_destination, images, format='gif', duration=frame_duration)
imageio.mimsave(output_destination, images, format="gif", duration=frame_duration)

if hasattr(output_destination, 'seek'):
if hasattr(output_destination, "seek"):
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tmpdir.cleanup() is called manually. If an exception happens earlier (e.g., during fig.savefig / imageio.imread), this cleanup path may be skipped and temp files can be left behind. Prefer using with tempfile.TemporaryDirectory() as tmpdir: (or try/finally) so cleanup is guaranteed.

Copilot uses AI. Check for mistakes.
vmax=None,
**kwargs,
):
"""Create a movie of an 4D data set"""
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar in the docstring: "an 4D data set" should be "a 4D data set".

Suggested change
"""Create a movie of an 4D data set"""
"""Create a movie of a 4D data set"""

Copilot uses AI. Check for mistakes.
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.

2 participants