Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the polyfit function to np.polynomial.Polynomial.fit() #120

Merged
merged 3 commits into from Jan 7, 2022

Conversation

kperrynrel
Copy link
Collaborator

Description

Addresses issue #119, by updating the np.polyfit() function to newer np.polynomial.Polynomial.fit() function.

@cwhanse cwhanse added this to the v0.2 milestone Jan 4, 2022
@cwhanse cwhanse added the dependency Issues relating to dependencies or dependency management label Jan 4, 2022
coefficients = np.polyfit(xs, ys, 2)
return np.poly1d(coefficients)
# fit a quadratic function of `xs` to the data in `ys`
coefficients = list(np.polynomial.Polynomial.fit(xs, ys, 2).convert())
Copy link
Member

Choose a reason for hiding this comment

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

I think if you use polynomial.polyfit and flipud this would be simpler.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

Tried it out and verified same results--thank you for the suggestion @cwhanse !

@kperrynrel
Copy link
Collaborator Author

@cwhanse what's our policy here on merging PR's in this package, ie are there a certain amount of reviewers I need to check off on this? Or are we good to merge and close now?

@cwhanse
Copy link
Member

cwhanse commented Jan 7, 2022

@kperrynrel was just thinking about that. If either Will or I approve and we don't indicate that the other needs to look, then it's OK to merge. If your work is held up by a PR, feel free to nag us about it.

@cwhanse cwhanse merged commit 2ba8ae2 into pvlib:master Jan 7, 2022
@kperrynrel
Copy link
Collaborator Author

Awesome, thanks for the clarification @cwhanse !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Issues relating to dependencies or dependency management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants