Skip to content

Commit

Permalink
applied black formatting (#307)
Browse files Browse the repository at this point in the history
* applied black formatting

* applied black formatting
  • Loading branch information
tnixon authored Apr 10, 2023
1 parent e6ef8b6 commit 42ca9a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 4 additions & 1 deletion python/tempo/interpol.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ def __generate_time_series_fill(
:param partition_cols: partition column names
:param ts_col: timestamp column name
"""
return df.withColumn("previous_timestamp", col(ts_col),).withColumn(
return df.withColumn(
"previous_timestamp",
col(ts_col),
).withColumn(
"next_timestamp",
lead(df[ts_col]).over(Window.partitionBy(*partition_cols).orderBy(ts_col)),
)
Expand Down
4 changes: 0 additions & 4 deletions python/tempo/intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,12 @@ def __merge_adjacent_overlaps(
"""

if how == "left":

# new boundary for interval end will become the start of the next
# interval
new_boundary_col = self.end_ts
new_boundary_val = f"_lead_1_{self.start_ts}"

else:

# new boundary for interval start will become the end of the
# previous interval
new_boundary_col = self.start_ts
Expand Down Expand Up @@ -386,7 +384,6 @@ def __merge_adjacent_overlaps(
)

if how == "left":

for c in self.metric_columns:
df = df.withColumn(
c,
Expand Down Expand Up @@ -599,7 +596,6 @@ def toDF(self, stack: bool = False) -> DataFrame:
"""

if stack:

n_cols = len(self.metric_columns)
metric_cols_expr = ",".join(
tuple(f"'{col}', {col}" for col in self.metric_columns)
Expand Down
1 change: 0 additions & 1 deletion python/tempo/tsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,6 @@ def interpolate(
return TSDF(interpolated_df, ts_col=ts_col, partition_cols=partition_cols)

def calc_bars(tsdf, freq, func=None, metricCols=None, fill=None):

resample_open = tsdf.resample(
freq=freq, func="floor", metricCols=metricCols, prefix="open", fill=fill
)
Expand Down

0 comments on commit 42ca9a2

Please sign in to comment.