Skip to content

Conversation

@Dvermetten
Copy link
Member

by modifying aggregations, this should fix the per-function plots for different polars versions

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes compatibility issues with different Polars versions by updating aggregation operations. The changes replace deprecated methods with more current Polars API calls to ensure compatibility across versions.

  • Replaced map_elements with simpler mathematical operations for geometric mean calculation
  • Updated apply method call for custom operations
  • Modified infinity handling in running time aggregations using conditional logic instead of replace

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

)
if max_budget is None:
max_budget = data[evaluation_variable].max()
max_budget = data[evaluation_variable].max()+1
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

Missing space around the '+' operator. Should be max_budget = data[evaluation_variable].max() + 1 for consistency with Python style guidelines.

Suggested change
max_budget = data[evaluation_variable].max()+1
max_budget = data[evaluation_variable].max() + 1

Copilot uses AI. Check for mistakes.
).alias("ERT"),
(
pl.col(evaluation_variable).replace(np.inf, max_budget * 10).sum()
pl.col(evaluation_variable).sum() + pl.col(evaluation_variable).is_between(max_budget, np.inf).count() * max_budget * 9
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The magic number 9 should be extracted as a named constant or variable (e.g., PAR_MULTIPLIER = 9) to improve code readability and maintainability.

Copilot uses AI. Check for mistakes.
Dvermetten and others added 3 commits September 25, 2025 11:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Dinu23 Dinu23 requested a review from Copilot September 25, 2025 11:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

pl.col(evaluation_variable)
.map_elements(lambda s: custom_op(s), return_dtype=pl.Float64)
.alias(custom_op.__name__)
pl.col(fval_variable).apply(custom_op).alias(custom_op.__name__)
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

The column reference should be evaluation_variable instead of fval_variable to match the function parameter and maintain consistency with the convergence function above.

Copilot uses AI. Check for mistakes.
Comment on lines 347 to +348
if max_budget is None:
max_budget = data[evaluation_variable].max()
max_budget = data[evaluation_variable].max()+1
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

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

Adding 1 to max_budget without explanation creates a magic number. Consider adding a comment explaining why this adjustment is necessary or define it as a named constant.

Copilot uses AI. Check for mistakes.
@Dinu23 Dinu23 merged commit 5573133 into main Sep 26, 2025
4 checks passed
@jacobdenobel jacobdenobel deleted the budfix_polars branch December 2, 2025 14:06
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.

3 participants