Skip to content

Fixing issues with maxpolydeg#175

Merged
jacob-prince merged 1 commit intomainfrom
glmsingle-tests
Mar 22, 2025
Merged

Fixing issues with maxpolydeg#175
jacob-prince merged 1 commit intomainfrom
glmsingle-tests

Conversation

@jacob-prince
Copy link
Collaborator

Small fixes that address the following issues:

Also, reverting changes that were made in this pull request:

We have verified that these changes allow the example01.ipynb script to run correctly. We will continue testing to be sure that this issue is fully resolved across all the latest versions of numpy/python.

@jacob-prince jacob-prince added the bug Something isn't working label Mar 22, 2025
@jacob-prince jacob-prince self-assigned this Mar 22, 2025
@jacob-prince
Copy link
Collaborator Author

The error was occurring because make_polynomial_matrix() expects degrees to be an array/list of polynomial degrees, but it was receiving a single integer value. This was happening because maxpolydeg was being handled as a single integer rather than an array of degrees.

We've modified the make_polynomial_matrix function to handle both cases:

  • When degrees is an array/list: it behaves as before
  • When degrees is a single integer: it creates an array of degrees from 0 to that number (inclusive)

This change should fix the TypeError while maintaining the intended functionality. The function will now:

  • For a single degree N, create polynomials of degree 0 through N
  • For an array of degrees, create polynomials for exactly those degrees

@jacob-prince jacob-prince merged commit f83014b into main Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant