Closed BalzaniEdoardo closed 2 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
pynapple/core/ts_group.py | 19 | 51 | 37.25% | ||
<!-- | Total: | 19 | 51 | 37.25% | --> |
Totals | |
---|---|
Change from base Build 8561902741: | 0.2% |
Covered Lines: | 2298 |
Relevant Lines: | 2635 |
@BalzaniEdoardo seems to be working smoothly. Fixes #243
Looks great. Last thing for TsGroup is to polish the __repr__
function. I can work on that.
Content
This PR solves issue #243 And also addresses most of the issues raised in #246.
TsGroup Edits
__getattr__
method added.Defined a
__getattr__
that allows the following syntax,Raises an error if the name is not in the metadata.
__setitem__
method modified.TsGroup is now mutable, but allowing only the metadata to change after initialization. The
__setitem__
allows only string as input, and enables,Raises error if the key is non-string.
__getitem__
method modified.The
__getitem__
of TsGroup logic was modified as follows,self.keys()
is passed, then the correspondingTs
is returned.str
, hence it is not in self.keys()), then it returns self._metadata[key]bool
ArrayLike of dim 1 it returns a TsGroup including the Ts corresponding tokeys = np.where(bool_array)[0]
int
ArrayLike of dim 1 it returns a TsGroup including the Ts corresponding to the array entries.Changes to interface_npz.py
Added
keys
to the set of keys that should not be appended to metadata.