Skip to content

Commit

Permalink
Ignore "You are using [hist/kde] as a plot kind" warnings (#342)
Browse files Browse the repository at this point in the history
* Ignore "You are using [hist/kde] as a plot kind" warnings

* hedge bets that #341 will merge first lol
  • Loading branch information
AdamOrmondroyd authored Sep 27, 2023
1 parent 108d77c commit 96fad22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
anesthetic: nested sampling post-processing
===========================================
:Authors: Will Handley and Lukas Hergt
:Version: 2.3.3
:Version: 2.3.4
:Homepage: https://github.com/handley-lab/anesthetic
:Documentation: http://anesthetic.readthedocs.io/

Expand Down
2 changes: 1 addition & 1 deletion anesthetic/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.3.3'
__version__ = '2.3.4'
8 changes: 6 additions & 2 deletions tests/test_samples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import anesthetic.examples._matplotlib_agg # noqa: F401

import pytest
from contextlib import nullcontext
from math import floor, ceil
import numpy as np
from pandas import MultiIndex
Expand Down Expand Up @@ -823,15 +824,18 @@ def test_stats():
def test_masking_1d(kind):
pc = read_chains("./tests/example_data/pc")
mask = pc['x0'].to_numpy() > 0
pc[mask].plot_1d(['x0', 'x1', 'x2'], kind=kind)
with pytest.warns(UserWarning) if kind in ['kde',
'hist'] else nullcontext():
pc[mask].plot_1d(['x0', 'x1', 'x2'], kind=kind)


@pytest.mark.parametrize('kind', ['kde', 'scatter', 'scatter_2d', 'kde_2d',
'hist_2d', skipif_no_fastkde('fastkde_2d')])
def test_masking_2d(kind):
pc = read_chains("./tests/example_data/pc")
mask = pc['x0'].to_numpy() > 0
pc[mask].plot_2d(['x0', 'x1', 'x2'], kind={'lower': kind})
with pytest.warns(UserWarning) if kind == 'kde' else nullcontext():
pc[mask].plot_2d(['x0', 'x1', 'x2'], kind={'lower': kind})


def test_merging():
Expand Down

0 comments on commit 96fad22

Please sign in to comment.