Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ ignore = [
"TC006", # put types in quotes in typing.cast
]

[lint.per-file-ignores]
"tools/generate_release_notes.py" = ["T20"]
"tools/release_utils.py" = ["T20"]

[lint.flake8-builtins]
builtins-allowed-modules = ["io", "types", "threading"]

Expand Down
137 changes: 137 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
Generate the release notes automatically from GitHub pull requests
------------------------------------------------------------------

We recommend using `uv run --locked` to run this script. This will run the
script in an isolated environment using the adjacent `uv.lock` file.

# GitHub token

You need a GitHub API token to run this script. You can do this in two ways:

1. using the `gh` command line utility
2. generating a token on the GitHub website and making it available to your
shell.

## Method 1: using the `gh` command line interface to fetch a token.

### bash/zsh

```
GH_TOKEN=`gh auth token` python generate_release_notes.py 0.9.1
```

### fish

```
GH_TOKEN=(gh auth token) python generate_release_notes.py 0.9.1
```

### Windows cmd

```
for /f %%i in ('gh auth token') do set GH_TOKEN=%%i
python generate_release_notes.py 0.9.1
```

### Windows PowerShell

```
$env:GH_TOKEN = gh auth token
python generate_release_notes.py 0.9.1
```

## Method 2: manually generating a token and copying it locally

You can create a new GitHub API token by navigating to:

https://github.com/settings/personal-access-tokens/new

Set an expiry date longer than 30 days if desired (but it is restricted to
being shorter than 365 days). The remaining default settings (read-only access
to public repositories) are sufficient for our purposes.

Copy the text to a safe place: you can only see it at creation time. You can
add them to your startup files as follows; in each case, you will need to start
a new shell for the setting to take effect.

### bash

```
echo export GH_TOKEN='<your-gh-api-token>' >> ~/.bashrc
```

### zsh

```
echo export GH_TOKEN='<your-gh-api-token>' >> ~/.zshrc
```

### fish

```
echo set GH_TOKEN <your-gh-api-token> >> ~/.config/fish/config.fish
```

### Windows cmd

```
setx GH_TOKEN <your-gh-api-token>
```

### Windows PowerShell

```
[Environment]::SetEnvironmentVariable("GH_TOKEN", "<your-gh-api-token>",
"User")
```

# Run the script:

```
uv run generate_release_notes.py <milestone>
```

For example:

```
uv run generate_release_notes.py 0.9.1
```

By default, the output will overwrite `../docs/release/release_M_N_P.md` for
milestone M.N.P, but you can override it with the `--target-directory` option:

```
# output to current directory for testing
uv run generate_release_notes.py <milestone> --target-directory=.
```

# Notes

## Contributor names

To substitute GitHub handles for author names, the `name_corrections.yaml` file
is used in cases when the GitHub User API does not return suitable values. You
can a custom file with the `--correction-file` option:

```
uv run generate_release_notes.py <milestone> \
--correction-file /path/to/name_corrections.yaml
```

## Caching

To help with milestones with a large number of commits, the script
caches GitHub API requests to speed up execution and reduce the number of
requests to the GitHub API. Consequently, if you edit some PR titles or labels,
you may not see the changes in the generated release notes until the cache
expires (after 1h by default).

Use the `--no-cache` option to ignore the cache.

The cache is a simple `github_cache` folder in the current directory, so it can
be cleared by deleting that folder.

## Threading

Use of the cache is not thread-safe, so multithreading is disabled when caching
is enabled.
24 changes: 24 additions & 0 deletions tools/additional_notes/0.10.0/breaking_changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
### Dropped support for Qt5 backend

We started warning about this in release v0.8.0; it is now time to fully drop support of Qt5! Qt5 has reached End Of Life on the 26th of May 2025. We migrated our bundle to Qt6 (PySide6) a year ago.
[#9650](https://github.com/napari/napari/pull/9650) is effectively removing PyQt5 support. PySide2 support was already removed in release [0.7.0](https://github.com/napari/napari/pull/8450), so we are now fully on Qt6!

### Tidied up mouse callbacks

Custom mouse callbacks can be [defined via generators](https://napari.org/stable/howtos/extending/connecting_events.html#listening-for-mouse-events). Some quirks with this machinery have been smoothed out and some bugs fixed ([#9513](https://github.com/napari/napari/pull/9513)); this might cause some callbacks to no longer work as before. In principle, this should only affect callbacks that relied on buggy behavior, but please make sure to check if your old callbacks are still working, and open an issue on the napari repository if that's not the case.

A notable change is that `mouse_move` callbacks previously did not work during `drag`, but now they do. If that's not what you want, guard your callback with `if not event.is_dragging`!

### Removed `scale_bar.unit`

After deprecating it, we're finally removing this field completely ([#9218](https://github.com/napari/napari/pull/9218)). Now the only way to set the unit on the scale bar is by [setting units on the layers themselves](https://napari.org/stable/guides/units.html#scale-and-units-live-on-layers)!

### Unified default font sizes

We previously hardcoded default font sizes for all visuals in the canvas. Now ([#8667](https://github.com/napari/napari/pull/8667), [#9524](https://github.com/napari/napari/pull/9524)), they respond to the global application settings (`Preferences > Appearance > Font size`) unless the font size is explicitly set for that specific model (by default it will be `None`).

So if you use the `scale_bar`, or `Points.text` or other layers and overlays that display text and you don't like the new default, make sure to set your font size explicitly!

### Key-bindings auto-repeat enabled by default

With [#9361](https://github.com/napari/napari/pull/9361), key-binding callbacks are now auto-repeated as everything else on your system. If your callbacks is a single-shot function, it will repeat when held; if it's a generator, it will behave as before. The flag `repeatable=True` no longer has an effect.
56 changes: 56 additions & 0 deletions tools/additional_notes/0.10.0/highlights.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
This release contains several new features and many enhancements and bugfixes. We also welcomed a ton of new contributors to the community!

### Coordinate Grid with axes and ticks
This features has been requested for years, and we finally managed to get a version that we're happy with! With [#7827](https://github.com/napari/napari/pull/7827), you can now use `viewer.scene.overlays.coordinate_grid` to display a grid on your data, including unit-aware tick marks and axis labels! Try it out:

```py
import napari

viewer = napari.Viewer(ndisplay=3)
layers = viewer.open_sample('napari', 'cells3d')

for layer in layers:
layer.units = 'nm'
layer.axis_labels = ['z', 'y', 'x']

viewer.scene.overlays.coordinate_grid.visible = True
```

![screenshot of the viewer with the coordinate_grid overlay enabled, showing the grid with axis labels and units, and axis ticks](https://github.com/user-attachments/assets/54993979-4774-4e66-87fb-d1bfcb27fb98)

### Colorful names

Another long-requested feature: displaying [layer names](https://napari.org/stable/getting_started/layers.html#layer-overlays) on the canvas now has colormap-aware colors ([#9598](https://github.com/napari/napari/pull/9598))! This comes with some fancy machinery to ensure that colors are shifted enough to be always readable.

```py
import napari

viewer = napari.Viewer()
layers = viewer.open_sample('napari', 'lily')

for layer in layers:
layer.name_overlay.visible = True

viewer.canvas.grid.enabled = True
viewer.canvas.grid.stride = 2
```

![screenshot of the viewer with layer names overlays enabled, colored based on each layer's colormap](https://github.com/user-attachments/assets/629e63f5-381a-4a92-ba17-de02fa408edf)

### Cursor crosshair

Ever use the [grid mode](https://napari.org/stable/gallery/grid_mode.html#grid-mode) for your multichannel data but then struggle to know where you're clicking? Struggle no more! You can now enable the new crosshair overlay ([#8017](https://github.com/napari/napari/pull/8017)) to always locate your exact position in every viewbox.

![screenshot of the viewer with grid-mode and the crosshair enabled](https://github.com/user-attachments/assets/cff866f3-fa28-42a8-a8df-94062b118573)

### Default dock area and tabify for plugin dock widgets

Some plugin dock widgets are wider than they are tall, fitting poorly on the right-side dock and forcing users to manually move the widget to a different area every time on first launch. With [#9526](https://github.com/napari/napari/pull/9526)) and ([#9707](https://github.com/napari/napari/pull/9707), you can now specify a default dock area and tabify behaviour for a dock widget contribution, which will prevent the need for this manual rearranging step:

```yaml
widgets:
- command: example-plugin.my_widget
display_name: My wide widget
default_dock_area: bottom
tabify: True
```
14 changes: 14 additions & 0 deletions tools/additional_notes/0.4.19/api changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

[#6102](https://github.com/napari/napari/pull/6102) added the ability to set
linear colormaps from black to a named color by using `colormap="color-name"`
syntax. It turns out that "orange" is both the name of a
white-to-orange colormap in VisPy, and one of the color names in the color
dictionary, therefore implicitly a *black-to-orange* colormap! We decided to use
the new, color-name behavior in this update. So if you are wondering why your
`imshow(data, colormap='orange')` calls look different — this is why.

In [#6178](https://github.com/napari/napari/pull/6178), the "action" type of
events emitted when editing Shapes or Points was changed to be more granular.
The types are no longer "add", "remove", and "change", but "adding", "added",
"removing", "removed", "changing", and "changed". This gives listeners more
control over when to take action in response to an event.
21 changes: 21 additions & 0 deletions tools/additional_notes/0.4.19/deprecations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[#6542](https://github.com/napari/napari/pull/6542) made a number of
deprecations to the Labels API to simplify it. Rather than having color-related
properties strewn all over the layer, color control is moved strictly to the
layer's `colormap`. Here is the full list of deprecated attributes and their
replacements:

- num_colors: `layer.num_colors` becomes `len(layer.colormap)`.
`layer.num_colors = n` becomes `layer.colormap = label_colormap(n)`.
- `napari.utils.colormaps.LabelColormap` is deprecated and has been renamed to
`napari.utils.colormaps.CyclicLabelColormap`.
- color: `layer.color` becomes `layer.colormap.color_dict`.
`layer.color = color_dict` becomes
`layer.colormap = DirectLabelColormap(color_dict)`.
- _background_label: `layer._background_label` is now at
`layer.colormap.background_value`.
- color_mode: `layer.color_mode` is set by setting the colormap using the
corresponding colormap type (`CyclicLabelColormap` or `DirectLabelColormap`;
these classes can be imported from `napari.utils.colormaps`.).
- `seed`: was only used for shifting labels around in [0, 1]. It is
superseded by `layer.new_colormap()` which was implemented in
[#6460](https://github.com/napari/napari/pull/6460).
109 changes: 109 additions & 0 deletions tools/additional_notes/0.4.19/highlights.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
This release mostly contains a lot of bug fixes and performance improvements.
But look out for 0.5.0, coming to a software repository near you — we expect to
release a lot of new features then!

### BIG improvements to the Labels layer

[#3308](https://github.com/napari/napari/pull/3308) closed *many* long-standing
bugs in the handling of colors in the Labels layer: the color swatch in the
Labels controls now always matches the color on the canvas, direct color
mapping with thousands of colors works fine, and shuffling colors (when two
touching labels coincidentally had the same color) is now much more likely to
map them to different colors. 🎨🚀🚀🚀

Unfortunately, the fix turned out to have rather
terrible consequences for the rendering performance of 3D Labels, and each time
we fixed one thing something else reappeared in a game of bug fix whack-a-mole
that any programmer would recognize. A great many
fixes later (
[#6411](https://github.com/napari/napari/pull/6411),
[#6439](https://github.com/napari/napari/pull/6439),
[#6459](https://github.com/napari/napari/pull/6459),
[#6460](https://github.com/napari/napari/pull/6460),
[#6461](https://github.com/napari/napari/pull/6461),
[#6467](https://github.com/napari/napari/pull/6467),
[#6479](https://github.com/napari/napari/pull/6479),
[#6520](https://github.com/napari/napari/pull/6520),
[#6540](https://github.com/napari/napari/pull/6540),
[#6571](https://github.com/napari/napari/pull/6571),
[#6580](https://github.com/napari/napari/pull/6580),
[#6596](https://github.com/napari/napari/pull/6596),
[#6602](https://github.com/napari/napari/pull/6602),
[#6607](https://github.com/napari/napari/pull/6607),
[#6616](https://github.com/napari/napari/pull/6616),
[#6618](https://github.com/napari/napari/pull/6618)
) — thank you for your patience! 😅 — Labels are faster than ever
*and* color accurate. *But*, to get the best performance, if you can use
8- or 16-bit integers as your data type, you should do so, and if not, you
should install *numba*, a just-in-time compiler for numerical code in Python.
(Ultimately, the data sent to the GPU will be 8- or 16-bit, so if you use a
larger data type, you will pay some conversion cost.)

These improvements in color handling are accompanied by updates to the Labels
API. You can now easily set a specific color cycle for Labels data. For
example, to use the famous [Glasbey look-up table/color
cycle](https://onlinelibrary.wiley.com/doi/10.1002/col.20327), you can combine
the [`glasbey`](https://pypi.org/project/glasbey/) Python package with the new
`CyclicLabelColormap` API:

```python
import glasbey
from napari.utils.colormaps import CyclicLabelColormap
# ...
labels_layer = viewer.add_labels(
segmentation, colormap=CyclicLabelColormap(glasbey.create_palette(256))
)
```

See the ["Deprecations" section below](#Deprecations) for more information on
the new API. ([#6542](https://github.com/napari/napari/pull/6542))

### More on colormaps!

Yes, this is the colors update! 🌈

Making image layers with linear colormaps using custom colors is easier than
ever! You can just do `viewer.add_image(data, color='turquoise')` to get a
black-to-turquoise linear colormap for that image. For the full list of colors
available, see the
[VisPy color dict](https://github.com/vispy/vispy/blob/269ed1ac4d8126421fd5a7eb06a2996d63f46b17/vispy/color/_color_dict.py#L181)
([#6102](https://github.com/napari/napari/pull/6102)). You can also pass in an
RGB hex color prefixed with `#`, as in
`napari.imshow(data, colormap=`#88ff1a`)`.

(For an amusing side note, though, check out the [API Changes](#api-changes)
note related to this PR. 😅)

### Some technical stuff

If you were worried about those pesky "public access to `qt_viewer` will be
removed" warnings, fret not! Its removal has been postponed until at least
0.6.0! We want to spend more time working with the community to ensure your
use case is supported before pulling out the rug. 🤝 If you are using the
`qt_viewer` because we don't have another public API to do what you need,
please [raise an issue](https://github.com/napari/napari/issues/new) so we can
make sure your use case is supported before we remove it.
([#6283](https://github.com/napari/napari/pull/6283))

Finally, although we still use pydantic 1.0 objects internally, napari
installs correctly with both pydantic v1 and pydantic v2. If you wanted to
upgrade your napari library or plugin to use Pydantic 2, now you can!

Note though, for 0.4.19, the napari bundled app still ships with Pydantic 1.x.
However, we will bundle v2 starting with 0.5.0, so if you use Pydantic
internally, now is a good time to check that you are compatible either v2 or
both v1 and v2
([#6358](https://github.com/napari/napari/pull/6358)).

### Onwards!

As always, napari is developed by the community, for the community. We want to
hear from you and help you get your napari visualization and/or plugin use done
faster! And if napari is missing something you need, we can help you add it! So
please remember to ask [questions on
image.sc](https://forum.image.sc/tag/napari), join our [Zulip chat
room](https://napari.zulipchat.com/), come to our [community
meetings](https://napari.org/stable/community/meeting_schedule.html), or [tag
us on Mastodon](https://fosstodon.org/@napari)!

Read on for the full list of changes that went into this release.
10 changes: 10 additions & 0 deletions tools/additional_notes/0.5.0/header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*Thursday, Jul 11, 2024*

We're happy to announce the release of napari 0.5.0!
napari is a fast, interactive, multi-dimensional image viewer for Python.
It's designed for exploring, annotating, and analyzing multi-dimensional
images. It's built on Qt (for the GUI), VisPy (for performant GPU-based
rendering), and the scientific Python stack (NumPy, SciPy, and friends).

For more information, examples, and documentation, please visit our website:
https://napari.org/
Loading
Loading