Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVPR 2024 #123

Merged
merged 11 commits into from
Nov 12, 2023
8 changes: 8 additions & 0 deletions tests/test_rc_params_cases/case_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
from tueplots import bundles


@pytest_cases.parametrize(column=["full", "half"])
@pytest_cases.parametrize(usetex=[True, False])
def case_bundles_cvpr2024(column, usetex):
return bundles.cvpr2024(
nrows=2, ncols=2, family="serif", column=column, usetex=usetex
)


@pytest_cases.parametrize(column=["full", "half"])
@pytest_cases.parametrize(usetex=[True, False])
def case_bundles_icml2022(column, usetex):
Expand Down
8 changes: 8 additions & 0 deletions tests/test_rc_params_cases/case_figsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ def case_figsizes_cvpr2022_full():
return figsizes.cvpr2022_full(nrows=2, ncols=3, height_to_width_ratio=1.0)


def case_figsizes_cvpr2024_half():
return figsizes.cvpr2024_half(nrows=2, ncols=3, height_to_width_ratio=1.0)


def case_figsizes_cvpr2024_full():
return figsizes.cvpr2024_full(nrows=2, ncols=3, height_to_width_ratio=1.0)


def case_figsizes_neurips2021():
return figsizes.neurips2021(nrows=2, ncols=3, height_to_width_ratio=1.0)

Expand Down
16 changes: 16 additions & 0 deletions tests/test_rc_params_cases/case_fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,19 @@ def case_fonts_aistats2022_tex_custom():

def case_fonts_aistats2023_tex_custom():
return fonts.aistats2023_tex(family="serif")


def case_fonts_cvpr2024_default():
return fonts.cvpr2024()


def case_fonts_cvpr2024_custom():
return fonts.cvpr2024(family="serif")


def case_fonts_cvpr2024_tex_default():
return fonts.cvpr2024_tex()


def case_fonts_cvpr2024_tex_custom():
return fonts.cvpr2024_tex(family="serif")
4 changes: 4 additions & 0 deletions tests/test_rc_params_cases/case_fontsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
from tueplots import fontsizes


def case_fontsizes_cvpr2024():
return fontsizes.cvpr2024()


def case_fontsizes_icml2022():
return fontsizes.icml2022()

Expand Down
14 changes: 14 additions & 0 deletions tueplots/bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
from tueplots.constants.color import palettes, rgb


def cvpr2024(*, column="half", nrows=1, ncols=1, usetex=True, family="serif"):
"""CVPR 2024 bundle."""
if column == "half":
size = figsizes.cvpr2024_half(nrows=nrows, ncols=ncols)
elif column == "full":
size = figsizes.cvpr2024_full(nrows=nrows, ncols=ncols)
if usetex is True:
font_config = fonts.cvpr2024_tex(family=family)
elif usetex is False:
font_config = fonts.cvpr2024(family=family)
fontsize_config = fontsizes.cvpr2024()
return {**font_config, **size, **fontsize_config}


def icml2022(*, column="half", nrows=1, ncols=1, usetex=True, family="serif"):
"""ICML 2022 bundle."""
if column == "half":
Expand Down
53 changes: 53 additions & 0 deletions tueplots/figsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,59 @@ def cvpr2022_full(
)


def cvpr2024_half(
*,
nrows=1,
ncols=1,
constrained_layout=True,
tight_layout=False,
height_to_width_ratio=_GOLDEN_RATIO,
pad_inches=_PAD_INCHES,
):
"""Double-column (half-width) figures for CVPR 2024."""

figsize = _from_base_in(
base_width_in=3.25,
rel_width=1.0,
height_to_width_ratio=height_to_width_ratio,
nrows=nrows,
ncols=ncols,
)
return _figsize_to_output_dict(
figsize=figsize,
constrained_layout=constrained_layout,
tight_layout=tight_layout,
pad_inches=pad_inches,
)


def cvpr2024_full(
*,
rel_width=1.0,
nrows=1,
ncols=2,
constrained_layout=True,
tight_layout=False,
height_to_width_ratio=_GOLDEN_RATIO,
pad_inches=_PAD_INCHES,
):
"""Single-column (full-width) figures for CVPR 2024."""

figsize = _from_base_in(
base_width_in=6.875,
rel_width=rel_width,
height_to_width_ratio=height_to_width_ratio,
nrows=nrows,
ncols=ncols,
)
return _figsize_to_output_dict(
figsize=figsize,
constrained_layout=constrained_layout,
tight_layout=tight_layout,
pad_inches=pad_inches,
)


# Single-column formats


Expand Down
10 changes: 10 additions & 0 deletions tueplots/fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ def iclr2024(*, family="serif"):
return _neurips_and_iclr_common(family=family)


def cvpr2024_tex(*, family="serif"):
"""Fonts for CVPR 2024. LaTeX version."""
return _neurips_and_iclr_tex_common(family=family)


def cvpr2024(*, family="serif"):
"""Fonts for CVPR 2024. LaTeX version."""
return _neurips_and_iclr_common(family=family)


def _neurips_and_iclr_common(*, family="serif"):
"""Default fonts for Neurips."""
return {
Expand Down
7 changes: 7 additions & 0 deletions tueplots/fontsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ def icml2022(*, default_smaller=1):
return _from_base(base=9 - default_smaller)


def cvpr2024(*, default_smaller=1):
"""Font size for CVPR 2024."""
# CVPR text size is 10, but captions are in size 9.
# Therefore, we use base 9 instead of 10.
return _from_base(base=9 - default_smaller)


def neurips2021(*, default_smaller=1):
"""Font size for Neurips 2021."""
return _from_base(base=10 - default_smaller)
Expand Down