-
Notifications
You must be signed in to change notification settings - Fork 0
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
C++ #49
Merged
C++ #49
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bd9a816
microbug fix in interp2d
alexeybelkov f4678f8
remove rewriting values in interp2d
alexeybelkov 6896bae
add test, version upd
alexeybelkov bdf950c
codestyle :kekw:
alexeybelkov 0ef1533
codestyle 2
vovaf709 15dca7d
bump actions
vovaf709 aa0c6a9
fix comments
alexeybelkov bdf3848
more tests :billy_sleep:
alexeybelkov 5212e88
codestyle :angrypepe:
alexeybelkov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.8.5' | ||
__version__ = '0.8.6' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,12 +52,12 @@ | |
): | ||
if triangles is not None: | ||
if not isinstance(triangles, np.ndarray): | ||
raise TypeError(f'Wrong type of `triangles` argument, expected np.ndarray. Got {type(triangles)}') | ||
if triangles.ndim != 2 or triangles.shape[1] != 3 or triangles.shape[0] * 3 != triangles.size: | ||
raise ValueError('Passed `triangles` argument has an incorrect shape') | ||
|
||
if not isinstance(points, np.ndarray): | ||
raise TypeError(f'Wrong type of `points` argument, expected np.ndarray. Got {type(points)}') | ||
|
||
if values is not None: | ||
if not isinstance(values, np.ndarray): | ||
|
@@ -81,7 +81,7 @@ | |
points: np.ndarray | ||
2-D array of data point coordinates to interpolate at | ||
values: np.ndarray | ||
1-D array of fp32/fp64 values to use at initial points. If passed, existing values will be rewritten | ||
1-D array of fp32/fp64 values to use at initial points. If passed, existing values will NOT be rewritten | ||
fill_value: float | ||
value to fill past edges | ||
|
||
|
@@ -90,22 +90,22 @@ | |
new_values: np.ndarray | ||
interpolated values at given points | ||
""" | ||
self.values = values or self.values | ||
x_values = values if values is not None else self.values | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not just if values is None:
values = self.values ? the new variable seems redundant There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
|
||
if self.values is None: | ||
if x_values is None: | ||
raise ValueError('`values` argument was never passed neither in __init__ or __call__ methods') | ||
|
||
if not isinstance(self.values, np.ndarray): | ||
raise TypeError(f'Wrong type of `values` argument, expected np.ndarray. Got {type(self.values)}') | ||
if not isinstance(x_values, np.ndarray): | ||
raise TypeError(f'Wrong type of `values` argument, expected np.ndarray. Got {type(x_values)}') | ||
|
||
if self.values.ndim > 1: | ||
raise ValueError(f'Wrong shape of `values` argument, expected ndim=1. Got shape {self.values.shape}') | ||
if x_values.ndim > 1: | ||
raise ValueError(f'Wrong shape of `values` argument, expected ndim=1. Got shape {x_values.shape}') | ||
|
||
_, neighbors = self.kdtree.query( | ||
points, 1, **{'workers': self.num_threads} if python_version()[:3] != '3.6' else {} | ||
) | ||
|
||
if not isinstance(points, np.ndarray): | ||
raise TypeError(f'Wrong type of `points` argument, expected np.ndarray. Got {type(points)}') | ||
|
||
return super().__call__(points, self.values, neighbors, fill_value) | ||
return super().__call__(points, x_values, neighbors, fill_value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"If passed, existing values will NOT be rewritten" - you don't need to specify this. This is what the user expects anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed