Skip to content

Conversation

@mernst
Copy link
Member

@mernst mernst commented Dec 6, 2025

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

📝 Walkthrough

Walkthrough

This pull request introduces a mechanism for managing external build and style scripts through a plume-scripts repository. The Makefile is refactored to conditionally clone this repository and defer code-style definitions to an external makefile rather than maintaining them inline. The .gitignore is updated to exclude the .plume-scripts/ directory from version control. Additionally, a Python script for generating figures is updated with import reordering, docstring normalization, and modifications to table generation logic, including changes to header construction and data formatting methods.

Pre-merge checks and finishing touches

✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43c6cc9 and 21c7ce7.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • scripts/experiment-scripts/generate-grt-figures.py (6 hunks)
🔇 Additional comments (2)
scripts/experiment-scripts/generate-grt-figures.py (2)

26-31: LGTM! Correct backend setup for headless environments.

The import reordering ensures mpl.use("Agg") is called before importing matplotlib figure-related modules, which is essential for CI/non-GUI execution. The explanatory comment is helpful for maintainability.


301-302: LGTM! Good modernization of pandas API usage.

The change from .values.tolist() to .to_numpy().tolist() aligns with modern pandas best practices. The header construction correctly extracts tool column names from the pivoted DataFrame.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
scripts/experiment-scripts/generate-grt-figures.py (2)

315-352: Update save_to_pdf docstring to match supported figure types and df semantics

The implementation supports fig_type == "table4" and, in that case, expects a raw DataFrame (no averaging). The docstring currently says:

  • fig_type: one of 'fig6-table3', 'fig7', 'fig8-9'
  • df: “Data averaged over repeated runs (output of average_over_loops)”

Both are misleading for the table4 path.

Suggest updating just the docstring, for example:

-def save_to_pdf(df: pd.DataFrame, fig_type: str):
-    """Save a figure/table of the given type to a PDF file.
-
-    Args:
-        df: Data averaged over repeated runs (output of `average_over_loops`).
-        fig_type: One of: 'fig6-table3', 'fig7', 'fig8-9'.
-    """
+def save_to_pdf(df: pd.DataFrame, fig_type: str):
+    """Save a figure or table of the given type to a PDF file.
+
+    Args:
+        df: For 'table4', the raw data frame loaded from CSV; for other
+            figure types, the data averaged over repeated runs
+            (output of `average_over_loops`).
+        fig_type: One of: 'fig6-table3', 'fig7', 'fig8-9', 'table4'.
+    """

23-33: Move mpl.use("Agg") before importing matplotlib.pyplot

The current code calls mpl.use("Agg") after matplotlib.pyplot is imported, which means the backend selection will have no effect. Matplotlib initializes the backend on first import of pyplot, so calling use() after that import is ignored. This will cause backend-related errors in headless environments despite the comment's intent.

Restructure the imports to set the backend immediately after importing matplotlib:

-import matplotlib as mpl
-import matplotlib.figure
-import matplotlib.pyplot as plt
-import pandas as pd
-import seaborn as sns
-from matplotlib.backends.backend_pdf import PdfPages
-
-mpl.use("Agg")  # For headless environments (without GUI)
+import matplotlib as mpl
+mpl.use("Agg")  # For headless environments (without GUI)
+import matplotlib.figure
+import matplotlib.pyplot as plt
+import pandas as pd
+import seaborn as sns
+from matplotlib.backends.backend_pdf import PdfPages
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e93166 and 43c6cc9.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .gitignore (1 hunks)
  • Makefile (1 hunks)
  • pyproject.toml (1 hunks)
  • scripts/experiment-scripts/generate-grt-figures.py (6 hunks)
🔇 Additional comments (5)
.gitignore (1)

28-31: Ignore rule for .plume-scripts/ is appropriate

Ignoring the locally-cloned .plume-scripts/ directory is consistent with the new Makefile behavior and prevents vendored tooling from being committed. LGTM.

scripts/experiment-scripts/generate-grt-figures.py (3)

1-21: Updated module docstring matches the script’s responsibilities

The clarified top-level docstring (including the note about Table IV’s time budgets and runs-per-fault) aligns with the code and usage described below. No issues here.


53-61: load_data docstring improvements look good

The expanded load_data docstring clearly documents arguments and return type and matches the implementation (pd.read_csv). No issues.


257-303: Dynamic header/cell construction for Table IV is sound

The new generate_table_4 docstring and the dynamic construction:

headers = ["Project", "Time", *list(table_data.columns[2:])]
cell_data = [headers, *table_data.to_numpy().tolist()]

correctly derive headers from the pivoted DataFrame and keep rows aligned with the header length. This will also adapt automatically if additional TestSuiteSource values are added in the CSV. LGTM.

If you care about a specific column ordering (e.g., GRT, Randoop, EvoSuite), you may want to sort or reindex table_data.columns[2:] explicitly to avoid surprises from pandas’ default column ordering.

pyproject.toml (1)

7-17: Clarify the scope of the ty dependency

ty>=0.0.1a31 is included in both dependencies (line 11) and the dev group (line 16). Please confirm whether ty is truly required at runtime or if it's only needed for development and tooling—if the latter, remove it from the main dependencies list to avoid unnecessary runtime overhead.

@mernst mernst merged commit fc6f724 into randoop:main Dec 6, 2025
2 checks passed
@mernst mernst deleted the style-mak branch December 6, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant