Skip to content

Commit

Permalink
Merge branch 'release/0.18.15'
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Nov 3, 2023
2 parents 4d9d9c8 + 37903b4 commit 1fad0dd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion climetlab/loaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ class FastWriter(ArrayLike):
def __init__(self, array, shape):
self.array = array
self.shape = shape
self.cache = np.zeros(shape)
self.dtype = array.dtype
self.cache = np.zeros(shape, dtype=self.dtype)

def __setitem__(self, key, value):
self.cache[key] = value
Expand Down Expand Up @@ -323,6 +324,7 @@ class OffsetView(ArrayLike):

def __init__(self, large_array, *, offset, axis, shape):
self.large_array = large_array
self.dtype = large_array.dtype
self.offset = offset
self.axis = axis
self.shape = shape
Expand Down
6 changes: 2 additions & 4 deletions climetlab/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,18 +1191,16 @@ def parse_config(self):
assert isinstance(self.end, datetime.date), (type(self.end), self.end)
self.step = datetime.timedelta(days=self.step)

if isinstance(self.group_by, int) and self.group_by > 1:
if isinstance(self.group_by, int) and self.group_by > 0:
self.grouper_key = GroupByDays(self.group_by)
else:
self.grouper_key = {
1: lambda dt: 0, # only one group
0: lambda dt: 0, # only one group
"monthly": lambda dt: (dt.year, dt.month),
"daily": lambda dt: (dt.year, dt.month, dt.day),
"MMDD": lambda dt: (dt.month, dt.day),
}[self.group_by]

# assert False, self.grouper_key

def format(self, x):
return x.isoformat()

Expand Down
2 changes: 1 addition & 1 deletion climetlab/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.18.14
0.18.15

0 comments on commit 1fad0dd

Please sign in to comment.