Skip to content

clean up tests and validate functions - #6

Merged
alexhallam merged 1 commit into
mainfrom
1-check-orthogonal-polygon-calculations-i-do-not-think-they-match-rs
Sep 20, 2025
Merged

clean up tests and validate functions#6
alexhallam merged 1 commit into
mainfrom
1-check-orthogonal-polygon-calculations-i-do-not-think-they-match-rs

Conversation

@alexhallam

Copy link
Copy Markdown
Owner

No description provided.

@alexhallam alexhallam linked an issue Sep 20, 2025 that may be closed by this pull request
@alexhallam
alexhallam merged commit c285725 into main Sep 20, 2025
2 of 13 checks passed
@alexhallam
alexhallam deleted the 1-check-orthogonal-polygon-calculations-i-do-not-think-they-match-rs branch September 20, 2025 20:48

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread compare_polynomials.py

# Load the data
mtcars = pl.read_csv("data/mtcars.csv")
r_poly = pl.read_csv("data/mtcars_poly_4.csv")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Missing Data Files Cause Test Failures

The new polynomial comparison test and script rely on hardcoded paths to data/mtcars_poly_4.csv and data/mtcars.csv. These data files aren't included in the repository, so tests and the script will fail with a FileNotFoundError if they're missing.

Additional Locations (1)

Fix in CursorFix in Web

beta_k = np.dot(P[:, k], P[:, k]) / np.dot(P[:, k-1], P[:, k-1])

# Three-term recurrence: P_{k+1} = (x - alpha_k) * P_k - beta_k * P_{k-1}
P[:, k + 1] = (x_data - alpha_k) * P[:, k] - beta_k * P[:, k - 1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Orthogonal Polynomial Calculation Errors

The orthogonal polynomial calculation has a few issues. Division by zero can occur in alpha_k and beta_k calculations when P vectors become all zeros, particularly with constant input data. The alpha_k calculation uses P[:, k]**2 instead of P[:, k], leading to incorrect orthogonal polynomial coefficients. Empty input data also causes np.mean to return NaN, which propagates through subsequent calculations.

Fix in CursorFix in Web

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.

Check orthogonal polygon calculations. I do not think they match Rs.

1 participant