Skip to content

Commit

Permalink
Updated default file format
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCappelletti94 committed Jan 19, 2020
1 parent 967c427 commit abcd579
Show file tree
Hide file tree
Showing 34 changed files with 20 additions and 19 deletions.
16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ displaying the bar labels as a shared legend.
.. raw:: html

<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/horizontal_legend_minor_rotation_val_auroc.jpg?raw=true" height="400px">
<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/horizontal_legend_minor_rotation_val_auroc.png?raw=true" height="400px">


Horizontal Example B
Expand All @@ -103,7 +103,7 @@ displaying the bar labels as a shared legend.
.. raw:: html

<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/horizontal_legend_subplots_minor_rotation_val_auroc.jpg?raw=true">
<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/horizontal_legend_subplots_minor_rotation_val_auroc.png?raw=true">


Horizontal Example C
Expand All @@ -126,7 +126,7 @@ displaying the bar labels as minor ticks.
.. raw:: html

<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/horizontal_major_rotation_val_auroc.jpg?raw=true" height="400px">
<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/horizontal_major_rotation_val_auroc.png?raw=true" height="400px">


Horizontal Example D
Expand All @@ -151,7 +151,7 @@ displaying the bar labels as minor ticks.
.. raw:: html

<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/horizontal_subplots_major_rotation_val_auroc.jpg?raw=true">
<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/horizontal_subplots_major_rotation_val_auroc.png?raw=true">


Vertical Example A
Expand All @@ -173,7 +173,7 @@ displaying the bar labels as a shared legend.
.. raw:: html

<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/vertical_legend_val_auroc.jpg" height="400px">
<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/vertical_legend_val_auroc.png" height="400px">


Vertical Example B
Expand All @@ -196,7 +196,7 @@ subplots with vertical bars and displaying the bar labels as a shared legend.
.. raw:: html

<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/vertical_legend_subplots_val_auroc.jpg">
<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/vertical_legend_subplots_val_auroc.png">


Vertical Example C
Expand All @@ -219,7 +219,7 @@ displaying the bar labels as minor ticks.
.. raw:: html

<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/vertical_minor_rotation_val_auroc.jpg" height="400px">
<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/vertical_minor_rotation_val_auroc.png" height="400px">


Vertical Example D
Expand All @@ -244,7 +244,7 @@ displaying the bar labels as minor ticks.
.. raw:: html

<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/vertical_subplots_minor_rotation_val_auroc.jpg">
<img src="https://github.com/LucaCappelletti94/barplots/blob/master/examples/vertical_subplots_minor_rotation_val_auroc.png">


Future features
Expand Down
2 changes: 1 addition & 1 deletion barplots/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Current version of package barplots"""
__version__ = "1.0.0"
__version__ = "1.1.0"
2 changes: 1 addition & 1 deletion barplots/barplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def barplots(
data_label: str = "{feature}",
The label to use for the data axis.
The `feature` placeholder is replaced with the considered column name.
path: str = "barplots/{feature}.jpg",
path: str = "barplots/{feature}.png",
The path where to store the pictures.
The `feature` placeholder is replaced with the considered column name.
sanitize_metrics: bool = True,
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/horizontal_major_rotation_val_auroc.jpg
Binary file not shown.
Binary file added examples/horizontal_major_rotation_val_auroc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/vertical_legend_subplots_val_auroc.jpg
Binary file not shown.
Binary file added examples/vertical_legend_subplots_val_auroc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/vertical_legend_val_auroc.jpg
Binary file not shown.
Binary file added examples/vertical_legend_val_auroc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/vertical_minor_rotation_val_auroc.jpg
Binary file not shown.
Binary file added examples/vertical_minor_rotation_val_auroc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Diff not rendered.
Binary file added test_barplots/val_auroc.png
4 changes: 2 additions & 2 deletions tests/test_barplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_barplots():
if kwargs["unique_major_labels"]:
path += "_unique_major_labels"

path += "_{feature}.jpg"
path += "_{feature}.png"

barplots(**kwargs, path=path,
custom_defaults=custom_defaults, verbose=False)
Expand All @@ -117,6 +117,6 @@ def test_single_index():
barplots(
df,
["cell_line"],
path="{root}/{{feature}}.jpg".format(root=root),
path="{root}/{{feature}}.png".format(root=root),
verbose=False
)
15 changes: 8 additions & 7 deletions tests/test_wrong_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@
import pytest
from barplots import barplots


def test_wrong_parameters():
root = "test_barplots"
df = pd.read_csv("tests/test_case.csv")

with pytest.raises(ValueError):
barplots(
df[df.cell_line == "CIAO"],
["cell_line","task","balancing","model"],
["cell_line", "task", "balancing", "model"],
orientation="pinco",
path="{root}/{{feature}}.jpg".format(root=root)
path="{root}/{{feature}}.png".format(root=root)
)

with pytest.raises(ValueError):
barplots(
df,
["cell_line","task","balancing","model"],
["cell_line", "task", "balancing", "model"],
orientation="pinco",
path="{root}/{{feature}}.jpg".format(root=root)
path="{root}/{{feature}}.png".format(root=root)
)

with pytest.raises(ValueError):
barplots(
df,
["model"],
path="{root}/{{feature}}.jpg".format(root=root),
path="{root}/{{feature}}.png".format(root=root),
subplots=True
)

Expand All @@ -35,6 +36,6 @@ def test_wrong_parameters():
df,
["model"],
plots_per_row="pinco",
path="{root}/{{feature}}.jpg".format(root=root),
path="{root}/{{feature}}.png".format(root=root),
subplots=True
)

0 comments on commit abcd579

Please sign in to comment.