Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/data_morph/data/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)


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

Expand Down
6 changes: 4 additions & 2 deletions src/data_morph/morpher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
import tqdm

from .data.stats import get_values
from .data.stats import get_summary_statistics
from .plotting.animation import (
ease_in_out_quadratic,
ease_in_out_sine,
Expand Down Expand Up @@ -264,7 +264,9 @@ def _is_close_enough(self, df1: pd.DataFrame, df2: pd.DataFrame) -> bool:
np.abs(
np.subtract(
*(
np.floor(np.array(get_values(data)) * 10**self.decimals)
np.floor(
np.array(get_summary_statistics(data)) * 10**self.decimals
)
for data in [df1, df2]
)
)
Expand Down
4 changes: 2 additions & 2 deletions src/data_morph/plotting/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
from matplotlib.ticker import EngFormatter

from ..data.stats import get_values
from ..data.stats import get_summary_statistics
from .style import plot_with_custom_style

if TYPE_CHECKING:
Expand Down Expand Up @@ -64,7 +64,7 @@ def plot(
ax.xaxis.set_major_formatter(tick_formatter)
ax.yaxis.set_major_formatter(tick_formatter)

res = get_values(data)
res = get_summary_statistics(data)

labels = ('X Mean', 'Y Mean', 'X SD', 'Y SD', 'Corr.')
locs = np.linspace(0.8, 0.2, num=len(labels))
Expand Down
4 changes: 2 additions & 2 deletions tests/data/test_stats.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""Test the stats module."""

from data_morph.data.loader import DataLoader
from data_morph.data.stats import get_values
from data_morph.data.stats import get_summary_statistics


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

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

stats = get_values(data)
stats = get_summary_statistics(data)

assert stats.x_mean == data.x.mean()
assert stats.y_mean == data.y.mean()
Expand Down