Skip to content
Open
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
6 changes: 3 additions & 3 deletions fastcore/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ def __setstate__(self,data): self.__dict__.update(data)
def __getattr__(self,k): return gather_attrs(self, k, 'fs')
def __dir__(self): return super().__dir__() + gather_attr_names(self, 'fs')

def decode (self, o, full=True):
if full: return compose_tfms(o, tfms=self.fs, is_enc=False, reverse=True, split_idx=self.split_idx)
def decode (self, o, full=True, **kwargs):
if full: return compose_tfms(o, tfms=self.fs, is_enc=False, reverse=True, split_idx=self.split_idx, **kwargs)
#Not full means we decode up to the point the item knows how to show itself.
for f in reversed(self.fs):
if self._is_showable(o): return o
o = f.decode(o, split_idx=self.split_idx)
o = f.decode(o, split_idx=self.split_idx, **kwargs)
return o

def show(self, o, ctx=None, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions nbs/05_transform.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1230,12 +1230,12 @@
" def __getattr__(self,k): return gather_attrs(self, k, 'fs')\n",
" def __dir__(self): return super().__dir__() + gather_attr_names(self, 'fs')\n",
"\n",
" def decode (self, o, full=True):\n",
" if full: return compose_tfms(o, tfms=self.fs, is_enc=False, reverse=True, split_idx=self.split_idx)\n",
" def decode (self, o, full=True, **kwargs):\n",
" if full: return compose_tfms(o, tfms=self.fs, is_enc=False, reverse=True, split_idx=self.split_idx, **kwargs)\n",
" #Not full means we decode up to the point the item knows how to show itself.\n",
" for f in reversed(self.fs):\n",
" if self._is_showable(o): return o\n",
" o = f.decode(o, split_idx=self.split_idx)\n",
" o = f.decode(o, split_idx=self.split_idx, **kwargs)\n",
" return o\n",
"\n",
" def show(self, o, ctx=None, **kwargs):\n",
Expand Down