Skip to content

Commit

Permalink
Fix the test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jul 27, 2022
1 parent 37869d4 commit c769028
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pygmt/tests/test_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ def test_accessor_grid_source_file_not_found():
# manually set the registration and gtype
dataset.height.gmt.registration = 1
dataset.height.gmt.gtype = 1
# the registration and gtype should be correct now.
assert dataset.height.gmt.registration == 1
assert dataset.height.gmt.gtype == 1
# the registration and gtype still have default values.
# Quote from https://docs.xarray.dev/en/stable/internals/extending-xarray.html
# > New instances, like those created from arithmetic operations or when
# > accessing a DataArray from a Dataset (ex. ds[var_name]), will have
# > new accessors created.
assert dataset.height.gmt.registration == 0
assert dataset.height.gmt.gtype == 0

0 comments on commit c769028

Please sign in to comment.