Skip to content

Commit

Permalink
decorators: apply to propertiesdata mixin & one debug of previous
Browse files Browse the repository at this point in the history
  • Loading branch information
sadielbartholomew committed Jan 14, 2020
1 parent 9248251 commit c45b7d9
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 127 deletions.
2 changes: 1 addition & 1 deletion cf/decorators.py
Expand Up @@ -3,7 +3,7 @@

# Identifier for 'inplace_enabled' to use as internal '_custom' dictionary key,
# or directly as a (temporary) attribute name if '_custom' is not provided:
INPLACE_ENABLED_PLACEHOLDER = '_is_inplace'
INPLACE_ENABLED_PLACEHOLDER = '_to_assign'


def _inplace_enabled(operation_method):
Expand Down
11 changes: 8 additions & 3 deletions cf/field.py
Expand Up @@ -16836,9 +16836,14 @@ def regrids(self, dst, method, src_cyclic=None, dst_cyclic=None,
# Construct new data from regridded sdst_dictections
new_data = Data.reconstruct_sectioned_data(sections)

# Construct new field
f = _inplace_enabled_define_and_cleanup(self)

# Construct new field.
# Note: cannot call `_inplace_enabled_define_and_cleanup(self)` to apply this
# if-else logic (it deletes the decorator attribute so can only be used once)
if inplace:
f = self
else:
f = self.copy()

# Update ancillary variables of new field
#f._conform_ancillary_variables(src_axis_keys, keep_size_1=False)

Expand Down

0 comments on commit c45b7d9

Please sign in to comment.