Skip to content

Commit ceb28a8

Browse files
authored
Merge pull request #244 from lsst/tickets/DM-55497
DM-55497: v30.0.9 release notes
2 parents dc8415d + 0b34d3c commit ceb28a8

6 files changed

Lines changed: 143 additions & 20 deletions

File tree

.github/workflows/pre-commit.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run pre-commit
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v7
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v6
20+
with:
21+
python-version: "3.13"
22+
23+
- name: Run prek
24+
uses: j178/prek-action@v2
25+
with:
26+
extra_args: --all-files

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ repos:
55
- id: check-yaml
66
args:
77
- "--unsafe"
8+
# These files are deliberately invalid YAML for testing error handling.
9+
exclude: "^tests/config/dbAuth/badDbAuth.*\\.yaml$"
810
- id: end-of-file-fixer
911
- id: trailing-whitespace
1012
- id: check-toml

doc/lsst.utils/CHANGES.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
lsst-utils v30.0.9 (2026-07-14)
2+
===============================
3+
4+
New Features
5+
------------
6+
7+
- Added ``DeprecatedDict`` mapping.
8+
This can be used to configure a `dict` that issues deprecation warnings when certain keys are accessed.
9+
110
lsst-utils v30.0.0 (2026-01-15)
211
===============================
312

python/lsst/utils/argparsing.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,36 @@ class AppendDict(argparse.Action):
3030
does not contain exactly one "=" character is invalid. If the default value
3131
is non-empty, the default key-value pairs may be overwritten by values from
3232
the command line.
33+
34+
Parameters
35+
----------
36+
option_strings : `str` | `list` [ `str` ]
37+
The command-line option strings that trigger this action, e.g.
38+
``--config``.
39+
dest : `str`
40+
The name of the `~argparse.Namespace` attribute in which the
41+
accumulated `dict` is stored.
42+
nargs : `int` | `str` | `None`, optional
43+
The number of command-line arguments consumed each time the option
44+
appears, as accepted by `argparse.ArgumentParser.add_argument`.
45+
const : `typing.Any` | `None`, optional
46+
A constant value required by some ``nargs`` settings; unused by this
47+
action.
48+
default : `typing.Any` | `None`, optional
49+
The initial value of the mapping if the option does not appear on the
50+
command line. Must be a `~collections.abc.Mapping` or `None`; `None`
51+
is converted to an empty `dict`.
52+
type : `type` | `None`, optional
53+
A callable applied by argparse to each command-line argument before
54+
it is passed to this action.
55+
choices : `typing.Any` | `None`, optional
56+
A container of the allowable values for the argument.
57+
required : `bool`, optional
58+
Whether the option must appear on the command line.
59+
help : `str` | `None`, optional
60+
A brief description of the argument for usage messages.
61+
metavar : `str` | `None`, optional
62+
The name for the argument's value(s) in usage messages.
3363
"""
3464

3565
def __init__(

python/lsst/utils/plotting/publication_plots.py

Lines changed: 64 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434

3535

3636
def set_rubin_plotstyle() -> None:
37-
"""
38-
Set the matplotlib style for Rubin publications
39-
"""
37+
"""Set the matplotlib style for Rubin publications."""
4038
from matplotlib import style
4139

4240
style.use("lsst.utils.plotting.rubin")
@@ -98,16 +96,33 @@ def mk_colormap(colorNames): # type: ignore
9896

9997

10098
def divergent_cmap(): # type: ignore
101-
"""
102-
Make a divergent color map.
99+
"""Make a divergent color map.
100+
101+
Returns
102+
-------
103+
cmap : `matplotlib.colors.LinearSegmentedColormap`
104+
A colormap stepping from the standard stars color through
105+
gray to the accent color.
103106
"""
104107
cmap = mk_colormap([stars_color(), "#D9DCDE", accent_color()])
105108

106109
return cmap
107110

108111

109112
def stars_cmap(single_color=False): # type: ignore
110-
"""Make a color map for stars."""
113+
"""Make a color map for stars.
114+
115+
Parameters
116+
----------
117+
single_color : `bool`, optional
118+
If `True` use the standard stars color.
119+
120+
Returns
121+
-------
122+
cmap : `matplotlib.colors.Colormap`
123+
A colormap derived from the standard stars color if
124+
``single_color`` is `True`, otherwise the seaborn "mako" palette.
125+
"""
111126
import seaborn as sns
112127
from matplotlib.colors import ListedColormap
113128

@@ -119,20 +134,35 @@ def stars_cmap(single_color=False): # type: ignore
119134

120135

121136
def stars_color() -> str:
122-
"""Return the star color string for lines"""
137+
"""Return the star color string for lines."""
123138
return "#084d96"
124139

125140

126141
def accent_color() -> str:
127-
"""Return a contrasting color for overplotting,
128-
black is the best for this but if you need two colors
142+
"""Return a contrasting color for overplotting.
143+
144+
Notes
145+
-----
146+
Black is the best for this but if you need two colors
129147
this works well on blue.
130148
"""
131149
return "#DE8F05"
132150

133151

134-
def galaxies_cmap(single_color=False): # type: ignore
135-
"""Make a color map for galaxies."""
152+
def galaxies_cmap(single_color: bool = False): # type: ignore
153+
"""Make a color map for galaxies.
154+
155+
Parameters
156+
----------
157+
single_color : `bool`, optional
158+
If `True` use the standard galaxies color.
159+
160+
Returns
161+
-------
162+
cmap : `matplotlib.colors.LinearSegmentedColormap` or `str`
163+
A colormap derived from the standard galaxies color if
164+
``single_color`` is `True`, otherwise the colormap name "inferno".
165+
"""
136166
if single_color:
137167
cmap = mk_colormap([galaxies_color()])
138168
else:
@@ -141,17 +171,29 @@ def galaxies_cmap(single_color=False): # type: ignore
141171

142172

143173
def galaxies_color() -> str:
144-
"""Return the galaxy color string for lines"""
174+
"""Return the galaxy color string for lines."""
145175
return "#961A45"
146176

147177

148178
def sso_color() -> str:
149-
"""Return the SSO color string for lines"""
179+
"""Return the SSO color string for lines."""
150180
return "#01694c"
151181

152182

153-
def sso_cmap(single_color=False): # type: ignore
154-
"""Make a color map for solar system objects."""
183+
def sso_cmap(single_color: bool = False): # type: ignore
184+
"""Make a color map for solar system objects.
185+
186+
Parameters
187+
----------
188+
single_color : `bool`, optional
189+
If `True` use the standard SSO color.
190+
191+
Returns
192+
-------
193+
cmap : `matplotlib.colors.LinearSegmentedColormap` or `str`
194+
A colormap derived from the standard SSO color if
195+
``single_color`` is `True`, otherwise the colormap name "viridis".
196+
"""
155197
if single_color:
156198
cmap = mk_colormap([sso_color()])
157199
else:
@@ -160,16 +202,19 @@ def sso_cmap(single_color=False): # type: ignore
160202

161203

162204
def get_band_dicts() -> dict:
163-
"""
164-
Define palettes, from RTN-045. This includes dicts for colors (bandpass
165-
colors for white background), colors_black (bandpass colors for
166-
black background), plot symbols, and line_styles, keyed on band (ugrizy).
205+
"""Define palettes, from RTN-045.
167206
168207
Returns
169208
-------
170209
band_dict : `dict` of `dict`
171210
Dicts of colors, colors_black, symbols, and line_styles,
172211
keyed on bands 'u', 'g', 'r', 'i', 'z', and 'y'.
212+
213+
Notes
214+
-----
215+
This includes dicts for colors (bandpass colors for white background),
216+
colors_black (bandpass colors for black background), plot symbols, and
217+
line_styles, keyed on band (ugrizy).
173218
"""
174219
colors = get_multiband_plot_colors()
175220
colors_black = get_multiband_plot_colors(dark_background=True)

tests/decorator_test/disable_timer.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,24 @@
1212

1313
@timeMethod(logger=log, logLevel=logging.INFO)
1414
def sleep_and_log(self, duration: float) -> None:
15-
"""Check that this does not log if the decorator was disabled on import."""
15+
"""Check that this does not log if the decorator was disabled on import.
16+
17+
Parameters
18+
----------
19+
duration : `float`
20+
Time to sleep.
21+
"""
1622
time.sleep(duration)
1723

1824

1925
@timeMethod
2026
def sleep_and_nothing(self, duration: float) -> None:
2127
"""Check that this does not have a `__wrapped__` attribute to confirm that
2228
the decorator is disabled.
29+
30+
Parameters
31+
----------
32+
duration : `float`
33+
Time to sleep.
2334
"""
2435
time.sleep(duration)

0 commit comments

Comments
 (0)