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

[fix] vario_estimate: prevent altering the input field #180

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to **GSTools** will be documented in this file.

## [Unreleased]

### Bugfixes
- `vario_estimate` was altering the input field unter certain circumstances [#180](https://github.com/GeoStat-Framework/GSTools/issues/180)


## [1.3.1] - Pure Pink - 2021-06

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion gstools/variogram/variogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def vario_estimate(
bin_centres = (bin_edges[:-1] + bin_edges[1:]) / 2.0
# allow multiple fields at same positions (ndmin=2: first axis -> field ID)
# need to convert to ma.array, since list of ma.array is not recognised
field = np.ma.array(field, ndmin=2, dtype=np.double)
field = np.ma.array(field, ndmin=2, dtype=np.double, copy=True)
masked = np.ma.is_masked(field) or np.any(mask)
# catch special case if everything is masked
if masked and np.all(mask):
Expand Down