Skip to content

Commit

Permalink
update Dockerfile and aggregators.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBernstorff committed Aug 30, 2024
1 parent 6cf5078 commit 84c008a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ WORKDIR /app
VOLUME psycop-common

COPY . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen
RUN --mount=type=cache,target=/root/.cache/pip \
pip install .
2 changes: 1 addition & 1 deletion src/timeseriesflattener/aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class SlopeAggregator(Aggregator):

def __call__(self, column_name: str) -> pl.Expr:
# Convert to days for the slope. Arbitrarily chosen to be the number of days since 1970-01-01.
x_col = (pl.col(self.timestamp_col_name) - dt.datetime(1970, 1, 1)).dt.days()
x_col = (pl.col(self.timestamp_col_name) - dt.datetime(1970, 1, 1)).dt.total_days()
y_col = pl.col(column_name)

numerator = pl.corr(x_col, y_col, propagate_nans=True) * y_col.std()
Expand Down

0 comments on commit 84c008a

Please sign in to comment.