Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache various statistics to improve performance #204

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dependencies = [
"matplotlib>=3.3",
"numpy>=1.20",
"pandas>=1.2",
"sortedcounter",
"tqdm>=4.64.1",
]
optional-dependencies.dev = [
Expand Down
3 changes: 3 additions & 0 deletions src/data_morph/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def __init__(
self.df: pd.DataFrame = self._validate_data(df).pipe(self._scale_data, scale)
"""pandas.DataFrame: DataFrame containing columns x and y."""

self._x = self.df['x'].to_numpy()
self._y = self.df['y'].to_numpy()

self.name: str = name
"""str: The name to use for the dataset."""

Expand Down
Loading
Loading