Skip to content

Commit

Permalink
feat!: change Verbosity enum values (#84)
Browse files Browse the repository at this point in the history
Having all values positive allows convenient constructs such as
`section_verbosity = section_verbosity or default_verbosity`,
where `section_verbosity` can be optional, i.e. `Verbosity | None`.

BREAKING CHANGE: Change Verbosity values. LOW is now 1 (was 0), MEDIUM
is 2 (was 1) and HIGH is 3 (was 2).
  • Loading branch information
lukany authored Aug 11, 2023
1 parent bbe398a commit 6a2bbcf
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions edvart/report_sections/section_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class Verbosity(IntEnum):
data type inference and default statistics become customizable.
"""

LOW = 0
MEDIUM = 1
HIGH = 2
LOW = 1
MEDIUM = 2
HIGH = 3


class Section(ABC):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bivariate_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def test_default_config_verbosity():

def test_high_verobisities():
with pytest.raises(ValueError):
bivariate_analysis.BivariateAnalysis(verbosity=3)
bivariate_analysis.BivariateAnalysis(verbosity=4)
with pytest.raises(ValueError):
bivariate_analysis.BivariateAnalysis(verbosity_contingency_table=3)
bivariate_analysis.BivariateAnalysis(verbosity_contingency_table=4)
with pytest.raises(ValueError):
bivariate_analysis.BivariateAnalysis(verbosity_pairplot=5)
with pytest.raises(ValueError):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_group_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_default_config_verbosity():

def test_invalid_verbosities():
with pytest.raises(ValueError):
GroupAnalysis(df=pd.DataFrame(), groupby=[], verbosity=3)
GroupAnalysis(df=pd.DataFrame(), groupby=[], verbosity=4)
with pytest.raises(ValueError):
GroupAnalysis(df=pd.DataFrame(), groupby=[], verbosity=-1)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_multivariate_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_default_config_verbosity():

def test_high_verobisities():
with pytest.raises(ValueError):
MultivariateAnalysis(df=get_test_df(), verbosity=3)
MultivariateAnalysis(df=get_test_df(), verbosity=4)
with pytest.raises(ValueError):
MultivariateAnalysis(df=get_test_df(), verbosity_pca=5)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_overview_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_high_verbosities():
with pytest.raises(ValueError):
Overview(verbosity_data_types=4)
with pytest.raises(ValueError):
Overview(verbosity_quick_info=3)
Overview(verbosity_quick_info=4)
with pytest.raises(ValueError):
Overview(verbosity_missing_values=5)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_timeseries_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def test_default_config_verbosity():

def test_high_verobisities():
with pytest.raises(ValueError):
TimeseriesAnalysis(verbosity=3)
TimeseriesAnalysis(verbosity=4)
with pytest.raises(ValueError):
TimeseriesAnalysis(verbosity_time_analysis_plot=3)
TimeseriesAnalysis(verbosity_time_analysis_plot=4)
with pytest.raises(ValueError):
TimeseriesAnalysis(verbosity_stationarity_tests=5)
with pytest.raises(ValueError):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_univariate_analysis_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_invalid_verbosity():
with pytest.raises(ValueError):
univariate_analysis.UnivariateAnalysis(df=test_df, verbosity=-1)
with pytest.raises(ValueError):
univariate_analysis.UnivariateAnalysis(df=test_df, verbosity=3)
univariate_analysis.UnivariateAnalysis(df=test_df, verbosity=4)
with pytest.raises(ValueError):
univariate_analysis.UnivariateAnalysis(df=test_df, verbosity=100)
with pytest.raises(ValueError):
Expand Down

0 comments on commit 6a2bbcf

Please sign in to comment.