pynapple-org / pynapple

PYthon Neural Analysis Package :pineapple:
https://pynapple-org.github.io/pynapple/
MIT License
243 stars 59 forks source link

Ts group init #259

Closed BalzaniEdoardo closed 3 months ago

BalzaniEdoardo commented 3 months ago

TsGroup Edits

Modified the __init__ of the ts_group. Now it coverts all keys to integer with the following behavior:

  1. Raises ValueError if any of the keys cannot be converted toint
  2. Raises ValuError if the converted key has a different value from the original, for example {1.2: ts} is not accepted because 1.2 would be converted to 1. This avoids issue if one has two float keys with the same integer part
  3. Rasies ValueError if after conversion two keys have the same value. this happens in this weird corner case d={1:ts, "1": ts}

Tests

  1. Added initialization test with corner cases.
  2. Change the parametrize over the class to fixture, more standard, and doesn't need to be passed if not used.
coveralls commented 3 months ago

Pull Request Test Coverage Report for Build 8560392212

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
pynapple/core/ts_group.py 6 10 60.0%
<!-- Total: 6 10 60.0% -->
Files with Coverage Reduction New Missed Lines %
pynapple/core/time_series.py 1 48.69%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 8545295196: 0.05%
Covered Lines: 2259
Relevant Lines: 2591

💛 - Coveralls