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 #71 init of core.Grid metadata #72

Merged
merged 5 commits into from
Nov 8, 2019
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
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Contributors:
* Tyler Luchko <tluchko>
* Giacomo Fiorin <giacomofiorin>
* Eloy Félix <eloyfelix>
* René Hafner (Hamburger) <renehamburger1993>
7 changes: 6 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ The rules for this file:
* accompany each entry with github issue/PR number (Issue #xyz)

------------------------------------------------------------------------------
??/??/2019 eloyfelix
??/??/2019 eloyfelix, renehamburger1993

* 0.6.0

Enhancements

* Allow parsing/writing gzipped DX files


Fixes

* fix initialization of mutable instance variable of Grid class (metadata dict) (#71)


05/16/2019 giacomofiorin, orbeckst
Expand Down
4 changes: 2 additions & 2 deletions gridData/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Grid(object):
default_format = 'DX'

def __init__(self, grid=None, edges=None, origin=None, delta=None,
metadata={}, interpolation_spline_order=3,
metadata=None, interpolation_spline_order=3,
file_format=None):
"""
Create a Grid object from data.
Expand Down Expand Up @@ -131,7 +131,7 @@ def __init__(self, grid=None, edges=None, origin=None, delta=None,
'PYTHON': self._load_python, # compatibility
}

self.metadata = metadata
self.metadata = metadata if metadata is not None else {}
self.__interpolated = None # cache for interpolated grid
self.__interpolation_spline_order = interpolation_spline_order
self.interpolation_cval = None # default to using min(grid)
Expand Down