Skip to content

Commit

Permalink
better naming _test_ func -> _get_expected_digits_
Browse files Browse the repository at this point in the history
  • Loading branch information
milcent committed Apr 17, 2021
1 parent 2bd940f commit 309068b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions benford/benford.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .utils import _set_N_, input_data, prepare, \
subtract_sorted, prep_to_roll, mad_to_roll, mse_to_roll, \
get_mantissas
from .expected import First, Second, LastTwo, _test_
from .expected import _get_expected_digits_ # First, Second, LastTwo
from .viz import _get_plot_args, plot_digs, plot_sum, plot_ordered_mantissas,\
plot_mantissa_arc_test, plot_roll_mse, plot_roll_mad
from .reports import _inform_, _report_mad_, _report_test_, _deprecate_inform_,\
Expand Down Expand Up @@ -113,7 +113,7 @@ class Test(DataFrame):

def __init__(self, base, digs, confidence, limit_N=None, sec_order=False):
# create a separated Expected distributions object
super(Test, self).__init__(_test_(digs))
super(Test, self).__init__(_get_expected_digits_(digs))
# create column with occurrences of the digits in the base
self['Counts'] = base[digs_dict[digs]].value_counts()
# create column with relative frequencies
Expand Down
2 changes: 1 addition & 1 deletion benford/expected.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __init__(self, num=False, plot=True, save_plot=None, save_plot_kwargs=None):
save_plot_kwargs=save_plot_kwargs)


def _test_(digs):
def _get_expected_digits_(digs):
"""Chooses the Exxpected class to be used in a test
Args:
Expand Down
4 changes: 2 additions & 2 deletions benford/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pandas import Series, DataFrame
from numpy import array, arange, log10, ndarray
from .expected import _test_
from .expected import _get_expected_digits_
from .constants import digs_dict, rev_digs
from .stats import Z_score
from .checks import _check_num_array_, _check_sign_, _check_decimals_
Expand Down Expand Up @@ -136,7 +136,7 @@ def get_found_proportions(data):
def join_expect_found_diff(data, digs):
"""
"""
dd = _test_(digs).join(data).fillna(0)
dd =_get_expected_digits_(digs).join(data).fillna(0)
# create column with absolute differences
dd['Dif'] = dd.Found - dd.Expected
dd['AbsDif'] = dd.Dif.abs()
Expand Down

0 comments on commit 309068b

Please sign in to comment.