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

added econforge interpolation into LinearInterp and scipy interpolati… #1136

Closed
wants to merge 4 commits into from

Conversation

gms158
Copy link

@gms158 gms158 commented Apr 19, 2022

…on into CubicInterp

Please ensure your pull request adheres to the following guidelines:

  • Tests for new functionality/models or Tests to reproduce the bug-fix in code.
  • Updated documentation of features that add new functionality.
  • Update CHANGELOG.md with major/minor changes.

@sbenthall sbenthall requested a review from alanlujan91 April 20, 2022 16:21
…oved cubic spline interpolation until tolerance issues are resolved
@gms158
Copy link
Author

gms158 commented Apr 25, 2022

I temporarily removed scipy CubicInterp, since it does have minor tolerance value changes, which causes errors in the unit test. I tested scipy CubicHermiteSpline, which resulted in larger tolerance issues than CubicInterp. I removed this to at least get the base LinearInterp changes implemented. I added a try catch around the econforge linear interpolation test, since this will capture the error and should not increase runtimes. If this approach is not desirable, we can try and think of cleaner ways to do this.

@AMonninger
Copy link
Collaborator

I'm interested in this and would be happy to review it after @alanlujan91 is done.

@alanlujan91
Copy link
Member

@gms158 because EconForge uses numba and numba is for speeding up array arithmetic, I wonder if the error is simply because the test is using ints and not arrays

https://github.com/econ-ark/HARK/runs/6178262613?check_suite_focus=true#step:5:558

Maybe Bilinear and Trilinear should check the type first and if inputs are ints then they should be cast as arrays?

@gms158
Copy link
Author

gms158 commented Apr 27, 2022 via email

@albop
Copy link
Collaborator

albop commented Apr 27, 2022 via email

… account for an outlier case where x and y test values are one point with integers which causes an error in the expected data format for python 3.8 and up
@gms158
Copy link
Author

gms158 commented Apr 27, 2022

I updated the interpolation code to account for infrequent and outlier cases where the econ forge library fails when evaluating one point consisting of integers, for python 3.8 and higher.

@alanlujan91
Copy link
Member

@albop @AMonninger did you want to review / have any comments on this before we merge it?

Copy link

@pat749 pat749 left a comment

Choose a reason for hiding this comment

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

yes I have reviewed it's good to merge.

@llorracc
Copy link
Collaborator

@alanlujan91, do you know any reason we should not merge this?

@alanlujan91
Copy link
Member

@alanlujan91, do you know any reason we should not merge this?

No, I was just giving others a chance to comment but it passes all tests so we can merge it

@sbenthall
Copy link
Contributor

Please add an update to the CHANGELOG describing this feature to the PR

https://github.com/econ-ark/HARK/blob/master/Documentation/CHANGELOG.md

@sbenthall
Copy link
Contributor

This PR needs documentation according to the NumPy / SciPy standard:

https://github.com/econ-ark/HARK/blob/master/Documentation/contributing/CONTRIBUTING.md#guidelines

@sbenthall
Copy link
Contributor

Superceded by #1151

@sbenthall sbenthall closed this Jan 4, 2023
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.

7 participants