Skip to content

Commit

Permalink
Merge pull request #68 from Pennycook/fix-navchart-column
Browse files Browse the repository at this point in the history
Fix navchart column
  • Loading branch information
Pennycook authored Sep 18, 2024
2 parents b799af1 + 247011b commit 4186665
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p3analysis/plot/backend/matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def __init__(
else:
if eff not in ["app", "arch"]:
raise ValueError("'eff' must be 'app' or 'arch'.")
pp_column = eff + " eff"
pp_column = eff + " pp"
if pp_column not in pp:
msg = "DataFrame does not contain an '%s' column."
raise ValueError(msg % (pp_column))
Expand Down
2 changes: 1 addition & 1 deletion p3analysis/plot/backend/pgfplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def __init__(
else:
if eff not in ["app", "arch"]:
raise ValueError("'eff' must be 'app' or 'arch'.")
pp_column = eff + " eff"
pp_column = eff + " pp"
if pp_column not in pp:
msg = "DataFrame does not contain an '%s' column."
raise ValueError(msg % (pp_column))
Expand Down
13 changes: 13 additions & 0 deletions tests/plot/test_navchart.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ def test_required_columns(self):
with self.assertRaises(ValueError):
navchart(pp, cd, eff="invalid")

pp = pd.DataFrame({
"problem": ["problem"],
"platform": ["platform"],
"application": ["application"],
"app pp": [1.0],
})
cd = pd.DataFrame({
"problem": ["problem"],
"application": ["application"],
"divergence": [0.0],
})
navchart(pp, cd)

def test_options(self):
"""p3analysis.plot.navchart.options"""

Expand Down

0 comments on commit 4186665

Please sign in to comment.