Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
HLasse committed Feb 23, 2024
1 parent 1dda823 commit 734f133
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Fixtures for v1 testing. Delete when v1 is deprecated."""
from __future__ import annotations

import pytest
Expand Down
4 changes: 2 additions & 2 deletions src/timeseriesflattener/feature_specs/test_from_legacy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import pandas as pd
from timeseriesflattener.aggregation_fns import (
from timeseriesflattener.v1.aggregation_fns import (
boolean,
change_per_day,
count,
Expand All @@ -13,7 +13,7 @@
summed,
variance,
)
from timeseriesflattener.feature_specs.group_specs import NamedDataframe
from timeseriesflattener.v1.feature_specs.group_specs import NamedDataframe

from .from_legacy import PredictorGroupSpec
from .predictor import PredictorSpec
Expand Down
4 changes: 3 additions & 1 deletion src/timeseriesflattener/testing/load_synth_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
from __future__ import annotations

import logging
from pathlib import Path

import polars as pl
from timeseriesflattener.misc_utils import PROJECT_ROOT

log = logging.getLogger(__name__)

PROJECT_ROOT = Path(__file__).resolve().parents[3]

TEST_DATA_PATH = PROJECT_ROOT / "src" / "timeseriesflattener" / "testing" / "test_data"


Expand Down
2 changes: 1 addition & 1 deletion src/timeseriesflattener/v1/misc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
split_dfs: Dict[str, pd.DataFrame] = {} #


PROJECT_ROOT = Path(__file__).resolve().parents[2]
PROJECT_ROOT = Path(__file__).resolve().parents[3]


def split_df_and_register_to_dict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def check_dfs_have_same_contents_by_column(df1: pd.DataFrame, df2: pd.DataFrame)
AssertionError: If the dataframes don't have the same contents by column.
"""

cols_to_test = [c for c in df1.columns if "prediction_time_uuid" not in c]
cols_to_test = [c for c in df1.columns if c not in ["prediction_time_uuid", "timestamp"]]

for col in cols_to_test:
# Saving to csv rounds floats, so we need to round here too
Expand Down

0 comments on commit 734f133

Please sign in to comment.