Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #158 from andersy005/master
Browse files Browse the repository at this point in the history
Patch #156
  • Loading branch information
andersy005 authored Nov 4, 2019
2 parents ef40a8d + b2ded08 commit b1fe05d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions esmlab/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def compute_time(self):
ds[self.time_coord_name] = groupby_coord.data

if self.time_bound is not None:
ds[self.tb_name].data = self.time_bound.data
self.time_bound[self.time_coord_name] = groupby_coord.data
self.time_bound_diff = self.compute_time_bound_diff(ds)

Expand Down Expand Up @@ -442,6 +443,8 @@ def compute_resample_times(self, ds, temporary_time_coord_name, time_dot, method
ds[self.tb_name] = tb_data
ds[self.tb_name].data = tb_data.data.reshape(tb_data_new_shape)

# TODO: Investigate the correctness of method="right", and "left". Do we need them?

if method == 'right':
time_values = self._ds_time_computed[self.time_coord_name].groupby(time_dot).max()

Expand Down
4 changes: 0 additions & 4 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ def test_resample_ann_mean_values_missing(ds, weights):


def test_resample_mon_mean(dset):

for method in {'left', 'right'}:
ds = esmlab.resample(dset, freq='mon', method=method)
assert len(ds.time) == 12
computed_dset = esmlab.resample(dset, freq='mon')
res = computed_dset.variable_1.data
expected = np.full(shape=(12, 2, 2), fill_value=0.5, dtype=np.float32)
Expand Down

0 comments on commit b1fe05d

Please sign in to comment.