Skip to content

Commit a1e854c

Browse files
authored
Deprecate fontsizes.beamer_moml in favour of fontsizes.beamer (pnkraemer#154)
* Deprecate fontsizes.beamer_moml in favour of fontsizes.beamer * Mention the deprecation in the docstring
1 parent 2ca9ced commit a1e854c

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

tests/test_deprecations.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""Test that deprecations are announced appropriately."""
2+
3+
import pytest
4+
5+
from tueplots import fontsizes
6+
7+
8+
def test_fontsize_beamer_function_renamed():
9+
with pytest.deprecated_call(match="renamed"):
10+
_ = fontsizes.beamer_moml()

tests/test_rc_params_cases/case_fontsizes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ def case_fontsizes_jmlr2001():
6767
return fontsizes.jmlr2001()
6868

6969

70-
def case_fontsizes_beamer_moml():
71-
return fontsizes.beamer_moml()
70+
def case_fontsizes_beamer():
71+
return fontsizes.beamer()

tueplots/bundles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def beamer_moml(
260260
axes_config_grid = axes.grid()
261261
axes_config_color = axes.color(base=rgb.tue_dark)
262262
cycler_config = cycler.cycler(color=palettes.tue_plot)
263-
fontsize_config = fontsizes.beamer_moml()
263+
fontsize_config = fontsizes.beamer()
264264
return {
265265
**size,
266266
**font_config,
@@ -280,7 +280,7 @@ def beamer_moml_dark_bg(*, rel_width=1.0, rel_height=0.8):
280280
axes_config_grid = axes.grid()
281281
axes_config_color = axes.color(face=rgb.tue_dark, base="w")
282282
cycler_config = cycler.cycler(color=palettes.tue_plot_dark_bg)
283-
fontsize_config = fontsizes.beamer_moml()
283+
fontsize_config = fontsizes.beamer()
284284
return {
285285
**size,
286286
**font_config,

tueplots/fontsizes.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Fontsize settings."""
22

3+
import warnings
4+
35

46
def icml2022(*, default_smaller=1):
57
r"""Font size for ICML 2022.
@@ -100,8 +102,19 @@ def tmlr2023(*, default_smaller=1):
100102
return _from_base(base=10 - default_smaller)
101103

102104

103-
def beamer_moml(*, default_smaller=1):
104-
"""Font size for a beamer slide in aspectratio 16:9 with 10pt font."""
105+
def beamer_moml(**kwargs):
106+
"""Font size for a beamer slide in aspectratio 16:9 with 10pt font.
107+
108+
Deprecated in v0.0.16. Use 'fontsizes.beamer' instead.
109+
"""
110+
msg = "'fontsizes.beamer_moml' has been renamed to 'fontsizes.beamer' in v0.0.16."
111+
msg += " The old API will be removed any time after January 1st, 2025."
112+
warnings.warn(msg, DeprecationWarning)
113+
return beamer(**kwargs)
114+
115+
116+
def beamer(*, default_smaller=1):
117+
"""Font size for a beamer slide (in aspectratio 16:9 with 10pt font)."""
105118
return _from_base(base=10 - default_smaller)
106119

107120

0 commit comments

Comments
 (0)