Repository: wiseodd/pub-ready-plots

Issue:
Add more templates
UAI, AISTATS, TMLR

Discussion:

Patch:
diff --git a/README.md b/README.md
index 8e06276..d6390ef 100644
--- a/README.md
+++ b/README.md
@@ -62,10 +62,10 @@ pip install pub-ready-plots
 import pub_ready_plots
 
 with pub_ready_plots.get_context(
-    width_frac=1,  # between 0 and 1
-    height_frac=0.15,  # between 0 and 1
-    layout="icml",  # or "iclr", "neurips", "poster-portrait", "poster-landscape"
-    single_col=False,  # only works for the "icml" layout
+    width_frac=1,  # Multiplier for `\linewidth`
+    height_frac=0.15,  # Multiplier for `\textheight`
+    layout="icml",  # or "iclr", "neurips", "aistats", "uai", "tmlr", "poster-portrait", "poster-landscape"
+    single_col=False,  # only works for the "icml", "aistats", "uai" layouts
     nrows=1,  # depending on your subplots, default = 1
     ncols=2,  # depending on your subplots, default = 1
     override_rc_params={"lines.linewidth": 4.123},  # Overriding rcParams
diff --git a/pub_ready_plots/pub_ready_plots.py b/pub_ready_plots/pub_ready_plots.py
index 5f4dbea..8a3f7ba 100644
--- a/pub_ready_plots/pub_ready_plots.py
+++ b/pub_ready_plots/pub_ready_plots.py
@@ -11,8 +11,8 @@ from .styles import PAPER_FORMATS, Style
 
 @contextmanager
 def get_context(
-    width_frac: float,
-    height_frac: float,
+    width_frac: float = 1,
+    height_frac: float = 0.15,
     layout: str = "neurips",
     single_col: bool = False,
     nrows: int = 1,
@@ -32,8 +32,8 @@ def get_context(
 
 
 def get_mpl_rcParams(
-    width_frac: float,
-    height_frac: float,
+    width_frac: float = 1,
+    height_frac: float = 0.15,
     layout: str = "neurips",
     single_col: bool = False,
 ) -> tuple[dict[str, Any], float, float]:
@@ -89,8 +89,8 @@ def get_mpl_rcParams(
     if layout not in PAPER_FORMATS.keys():
         raise ValueError(f"Layout must be in {list(PAPER_FORMATS.keys())}.")
 
-    if layout not in ["icml"] and single_col:
-        raise ValueError("Double-column is only supported for ICML.")
+    if layout not in ["icml", "aistats", "uai"] and single_col:
+        raise ValueError("Double-column is only supported for ICML, AISTATS, and UAI.")
 
     format: Style = PAPER_FORMATS[layout]
     is_poster = "poster" in layout
diff --git a/pub_ready_plots/styles.py b/pub_ready_plots/styles.py
index 792e7ab..a438f92 100644
--- a/pub_ready_plots/styles.py
+++ b/pub_ready_plots/styles.py
@@ -67,6 +67,39 @@ PAPER_FORMATS = {
         tick_size=1.5,
         tick_width=0.5,
     ),
+    "aistats": Style(
+        text_width=6.75133,
+        col_width=3.25063,
+        text_height=9.25182,
+        font_name=FONT_NAME_CM,
+        footnote_size=8,
+        script_size=7,
+        linewidth=1.25,
+        tick_size=1.5,
+        tick_width=0.5,
+    ),
+    "uai": Style(
+        text_width=6.75133,
+        col_width=3.25063,
+        text_height=9.25182,
+        font_name=FONT_NAME_TNR,
+        footnote_size=8,
+        script_size=7,
+        linewidth=1.25,
+        tick_size=1.5,
+        tick_width=0.5,
+    ),
+    "tmlr": Style(
+        text_width=6.50127,
+        col_width=6.50127,
+        text_height=9.00177,
+        font_name=FONT_NAME_CM,
+        footnote_size=8,
+        script_size=7,
+        linewidth=1.25,
+        tick_size=1.5,
+        tick_width=0.5,
+    ),
     "poster-landscape": Style(
         text_width=6.00117,
         col_width=6.00117,
diff --git a/pyproject.toml b/pyproject.toml
index 183abc8..e4997e1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,10 +1,9 @@
 [project]
 name = "pub-ready-plots"
-version = "0.2.1"
+version = "1.0"
 description = "Easy publication-ready matplotlib plots for ML papers and posters."
 authors = [{ name = "Agustinus Kristiadi", email = "agustinus@kristia.de" }]
 classifiers = [
-  "Development Status :: 3 - Alpha",
   "License :: OSI Approved :: MIT License",
   "Operating System :: OS Independent",
   "Programming Language :: Python :: 3.9",
@@ -23,10 +22,10 @@ distribution = true
 
 [tool.uv]
 dev-dependencies = [
-    "pytest>=8.2.2",
-    "pytest-cov>=5.0.0",
-    "ruff>=0.5.0",
-    "mypy>=1.11.1",
+  "pytest>=8.2.2",
+  "pytest-cov>=5.0.0",
+  "ruff>=0.5.0",
+  "mypy>=1.11.1",
 ]
 
 [tool.pytest.ini_options]


Test patch:
diff --git a/tests/test_core_func.py b/tests/test_core_func.py
index 910d45c..ab53c7b 100644
--- a/tests/test_core_func.py
+++ b/tests/test_core_func.py
@@ -3,7 +3,17 @@ import pytest
 
 from pub_ready_plots import get_mpl_rcParams
 
-LAYOUTS = ["icml", "iclr", "neurips", "jmlr", "poster-portrait", "poster-landscape"]
+LAYOUTS = [
+    "icml",
+    "iclr",
+    "neurips",
+    "jmlr",
+    "aistats",
+    "uai",
+    "tmlr",
+    "poster-portrait",
+    "poster-landscape",
+]
 
 
 @pytest.mark.parametrize("layout", LAYOUTS)
@@ -45,7 +55,7 @@ def test_incorrect_layout() -> None:
 
 @pytest.mark.parametrize("layout", LAYOUTS)
 def test_double_column(layout: str) -> None:
-    if layout == "icml":
+    if layout in ["icml", "aistats", "uai"]:
         _ = get_mpl_rcParams(
             width_frac=1, height_frac=0.1, layout=layout, single_col=False
         )