Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ts group init #259

Merged
merged 4 commits into from
Apr 4, 2024
Merged

Ts group init #259

merged 4 commits into from
Apr 4, 2024

Conversation

BalzaniEdoardo
Copy link
Collaborator

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 to int
  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.

@BalzaniEdoardo BalzaniEdoardo requested a review from gviejo as a code owner April 4, 2024 19:39
@gviejo gviejo merged commit b2dabfc into main Apr 4, 2024
11 checks passed
@gviejo gviejo deleted the ts_group_init branch April 4, 2024 19:58
@coveralls
Copy link

coveralls commented Apr 5, 2024

Pull Request Test Coverage Report for Build 8560392212

Details

  • 6 of 10 (60.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 85.059%

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

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants