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

Fix 337 #338

Conversation

xiki-tempula
Copy link
Collaborator

  • Warning issued when the series is None for statistical_inefficiency
  • ValueError issued when df and series for statistical_inefficiency
    doesn't have the same length

Copy link

codecov bot commented Dec 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1360a0d) 98.70% compared to head (b152d54) 98.71%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #338   +/-   ##
=======================================
  Coverage   98.70%   98.71%           
=======================================
  Files          28       28           
  Lines        1860     1864    +4     
  Branches      402      404    +2     
=======================================
+ Hits         1836     1840    +4     
  Misses          2        2           
  Partials       22       22           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xiki-tempula xiki-tempula mentioned this pull request Dec 30, 2023
Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the issue. Could you please also raise a Python warning?

@@ -363,6 +363,15 @@ def _prepare_input(df, series, drop_duplicates, sort):
series : Series
Formatted Series.
"""
if series is None:
logger.warning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also should raise a real warning

warnings.warn(...)

in addition to logging one.



def test_series_none(dHdl, caplog):
statistical_inefficiency(dHdl, series=None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also test with pytest.warns(), see above.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning instead of logger works for me (although I would also be happy with warning + logger if you prefer both). Thanks for addressing my comments!

@orbeckst
Copy link
Member

orbeckst commented Jan 3, 2024

@xiki-tempula looks good as it is but if you want to add the logger back then please do. Please squash-merge whenever you're ready.

@xiki-tempula xiki-tempula merged commit d8a705a into master Jan 3, 2024
8 of 9 checks passed
@xiki-tempula xiki-tempula deleted the 337-statistical_inefficiency-should-raise-an-error-when-not-given-series branch January 3, 2024 17:45
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.

statistical_inefficiency should raise an error when not given series
2 participants