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

Add NeurIPS 2023 style #112

Merged
merged 2 commits into from
Apr 29, 2023
Merged
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
5 changes: 5 additions & 0 deletions tests/test_rc_params_cases/case_bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def case_bundles_neurips2022(usetex):
return bundles.neurips2022(usetex=usetex, nrows=2, ncols=2, family="serif")


@pytest_cases.parametrize(usetex=[True, False])
def case_bundles_neurips2023(usetex):
return bundles.neurips2023(usetex=usetex, nrows=2, ncols=2, family="serif")


@pytest_cases.parametrize(usetex=[True, False])
def case_bundles_iclr2023(usetex):
return bundles.iclr2023(usetex=usetex, nrows=2, ncols=2, family="serif")
Expand Down
4 changes: 4 additions & 0 deletions tests/test_rc_params_cases/case_figsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def case_figsizes_neurips2022():
return figsizes.neurips2022(nrows=2, ncols=3, height_to_width_ratio=1.0)


def case_figsizes_neurips2023():
return figsizes.neurips2023(nrows=2, ncols=3, height_to_width_ratio=1.0)


def case_figsizes_iclr2023():
return figsizes.iclr2023(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 @@ -52,6 +52,22 @@ def case_fonts_neurips2022_tex_custom():
return fonts.neurips2022_tex(family="serif")


def case_fonts_neurips2023_default():
return fonts.neurips2023()


def case_fonts_neurips2023_custom():
return fonts.neurips2023(family="serif")


def case_fonts_neurips2023_tex_default():
return fonts.neurips2023_tex()


def case_fonts_neurips2023_tex_custom():
return fonts.neurips2023_tex(family="serif")


def case_fonts_iclr2023_tex_default():
return fonts.iclr2023_tex()

Expand Down
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 @@ -15,6 +15,10 @@ def case_fontsizes_neurips2022():
return fontsizes.neurips2022()


def case_fontsizes_neurips2023():
return fontsizes.neurips2023()


def case_fontsizes_iclr2023():
return fontsizes.iclr2023()

Expand Down
11 changes: 11 additions & 0 deletions tueplots/bundles.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ def neurips2022(*, usetex=True, rel_width=1.0, nrows=1, ncols=1, family="serif")
return {**font_config, **size, **fontsize_config}


def neurips2023(*, usetex=True, rel_width=1.0, nrows=1, ncols=1, family="serif"):
"""Neurips 2023 bundle."""
if usetex is True:
font_config = fonts.neurips2023_tex(family=family)
elif usetex is False:
font_config = fonts.neurips2023(family=family)
size = figsizes.neurips2023(rel_width=rel_width, nrows=nrows, ncols=ncols)
fontsize_config = fontsizes.neurips2023()
return {**font_config, **size, **fontsize_config}


def iclr2023(*, usetex=True, rel_width=1.0, nrows=1, ncols=1, family="serif"):
"""ICLR 2023 bundle."""
if usetex is True:
Expand Down
22 changes: 22 additions & 0 deletions tueplots/figsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,28 @@ def neurips2022(
)


def neurips2023(
*,
rel_width=1.0,
nrows=1,
ncols=2,
constrained_layout=True,
tight_layout=False,
height_to_width_ratio=_GOLDEN_RATIO,
pad_inches=_PAD_INCHES,
):
"""Neurips 2023 figure size."""
return _neurips_and_iclr_common(
rel_width=rel_width,
nrows=nrows,
ncols=ncols,
constrained_layout=constrained_layout,
tight_layout=tight_layout,
height_to_width_ratio=height_to_width_ratio,
pad_inches=pad_inches,
)


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


def neurips2023(*, family="serif"):
"""Fonts for Neurips 2023."""
return _neurips_and_iclr_common(family=family)


def neurips2023_tex(*, family="serif"):
"""Fonts for Neurips 2023. LaTeX version."""
return _neurips_and_iclr_tex_common(family=family)


def iclr2023_tex(*, family="serif"):
"""Fonts for ICLR 2023. LaTeX version."""
return _neurips_and_iclr_tex_common(family=family)
Expand Down
5 changes: 5 additions & 0 deletions tueplots/fontsizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ def neurips2022(*, default_smaller=1):
return _from_base(base=10 - default_smaller)


def neurips2023(*, default_smaller=1):
"""Font size for Neurips 2023."""
return _from_base(base=10 - default_smaller)


def iclr2023(*, default_smaller=1):
"""Font size for ICLR 2023."""
return _from_base(base=10 - default_smaller)
Expand Down