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

minor bug fixes #314

Merged
merged 20 commits into from
Jul 27, 2023
Merged

Conversation

lukashergt
Copy link
Collaborator

@lukashergt lukashergt commented Jul 17, 2023

  • The neff method of WeighedDataFrame was missing its optional beta kwarg. Failing test in 1f479b7 highlights the issue.
  • When running samples.plot_1d() pandas annoyingly introduces the ylabel "Frequency" (see for example the 2.0.0 version of readthedocs), which this PR removes.

Checklist:

  • I have performed a self-review of my own code
  • My code is PEP8 compliant (flake8 anesthetic tests)
  • My code contains compliant docstrings (pydocstyle --convention=numpy anesthetic)
  • New and existing unit tests pass locally with my changes (python -m pytest)
  • I have added tests that prove my fix is effective or that my feature works
  • I have appropriately incremented the semantic version number in both README.rst and anesthetic/_version.py

@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (0d6618e) 100.00% compared to head (b3dfee7) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #314   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           33        33           
  Lines         2792      2807   +15     
=========================================
+ Hits          2792      2807   +15     
Files Changed Coverage Δ
anesthetic/samples.py 100.00% <ø> (ø)
anesthetic/_version.py 100.00% <100.00%> (ø)
anesthetic/plot.py 100.00% <100.00%> (ø)
anesthetic/plotting/_matplotlib/hist.py 100.00% <100.00%> (ø)
anesthetic/weighted_pandas.py 100.00% <100.00%> (ø)

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

…"Frequency" messing with our plotting grid
@lukashergt lukashergt changed the title Fix missing kwarg in neff minor bug fixes Jul 17, 2023
@williamjameshandley
Copy link
Collaborator

To deal with the irritating frequency labelling, it's better to oblate the offending Frequency code. This therefore covers the case when samples.x0.plot.hist_1d is called on its own, rather than hist_1d. This has been fixed in 9925b07. I've also added a test for this on b02eb54 which fails on master.

I've got another bug I'd like to squash associated with hist_1d and its plot range (which is why I'm a bit more into this than one might expect)

Copy link
Collaborator

@williamjameshandley williamjameshandley left a comment

Choose a reason for hiding this comment

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

You should check my additions, and if you think they look good, we should merge this before the PR becomes too unwieldy.

anesthetic/plot.py Show resolved Hide resolved
anesthetic/plotting/_matplotlib/hist.py Outdated Show resolved Hide resolved
Comment on lines +1369 to +1371
@pytest.mark.parametrize('kind', ['kde', 'hist', 'fastkde']
if 'fastkde' in sys.modules else
['kde', 'hist'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the best way to deal with fastkde, or should it be skipped/xfailed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This achieves the same as skipping. Skipping would appear in the tests as a little s rather than in the form of fewer tests. Would we prefer that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fewer lines in the code is good. Being explicit that tests are skipped when not everything is installed is better. Mentioned in #110.

tests/test_samples.py Show resolved Hide resolved
tests/test_samples.py Show resolved Hide resolved
@williamjameshandley
Copy link
Collaborator

Feel free to squash and merge @lukashergt if you agree with the changes

@lukashergt lukashergt merged commit a9e1ea5 into handley-lab:master Jul 27, 2023
23 checks passed
@lukashergt lukashergt mentioned this pull request Aug 1, 2023
6 tasks
@lukashergt lukashergt mentioned this pull request Aug 9, 2023
6 tasks
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.

2 participants