Skip to content

Commit 3fbb336

Browse files
authored
Rename get_values() as get_summary_statistics() (#261)
1 parent eb725e7 commit 3fbb336

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/data_morph/data/stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
)
1313

1414

15-
def get_values(data: pd.DataFrame) -> SummaryStatistics:
15+
def get_summary_statistics(data: pd.DataFrame) -> SummaryStatistics:
1616
"""
1717
Calculate the summary statistics for the given set of points.
1818

src/data_morph/morpher.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import numpy as np
1111
import tqdm
1212

13-
from .data.stats import get_values
13+
from .data.stats import get_summary_statistics
1414
from .plotting.animation import (
1515
ease_in_out_quadratic,
1616
ease_in_out_sine,
@@ -264,7 +264,9 @@ def _is_close_enough(self, df1: pd.DataFrame, df2: pd.DataFrame) -> bool:
264264
np.abs(
265265
np.subtract(
266266
*(
267-
np.floor(np.array(get_values(data)) * 10**self.decimals)
267+
np.floor(
268+
np.array(get_summary_statistics(data)) * 10**self.decimals
269+
)
268270
for data in [df1, df2]
269271
)
270272
)

src/data_morph/plotting/static.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import numpy as np
1111
from matplotlib.ticker import EngFormatter
1212

13-
from ..data.stats import get_values
13+
from ..data.stats import get_summary_statistics
1414
from .style import plot_with_custom_style
1515

1616
if TYPE_CHECKING:
@@ -64,7 +64,7 @@ def plot(
6464
ax.xaxis.set_major_formatter(tick_formatter)
6565
ax.yaxis.set_major_formatter(tick_formatter)
6666

67-
res = get_values(data)
67+
res = get_summary_statistics(data)
6868

6969
labels = ('X Mean', 'Y Mean', 'X SD', 'Y SD', 'Corr.')
7070
locs = np.linspace(0.8, 0.2, num=len(labels))

tests/data/test_stats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""Test the stats module."""
22

33
from data_morph.data.loader import DataLoader
4-
from data_morph.data.stats import get_values
4+
from data_morph.data.stats import get_summary_statistics
55

66

77
def test_stats():
88
"""Test that summary statistics tuple is correct."""
99

1010
data = DataLoader.load_dataset('dino').data
1111

12-
stats = get_values(data)
12+
stats = get_summary_statistics(data)
1313

1414
assert stats.x_mean == data.x.mean()
1515
assert stats.y_mean == data.y.mean()

0 commit comments

Comments
 (0)