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
8 changes: 3 additions & 5 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "5000:5000"
- "127.0.0.1:5000:5000"
volumes:
- ${LOG_DATA_DIRECTORY}:/app/log_data/
- ${RESULTS_DIRECTORY}:/app/analysis_results
Expand All @@ -18,8 +18,6 @@ services:
APP_CMD: "flask --app main.py run --host 0.0.0.0 --port 5000"
redis:
image: redis:alpine
ports:
- 6379:6379
celery:
build:
context: .
Expand All @@ -37,7 +35,7 @@ services:
- redis
- db
db:
image: postgres:alpine
image: postgres:17-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
Expand All @@ -50,7 +48,7 @@ services:
image: adminer
restart: always
ports:
- 8081:8080
- "127.0.0.1:8081:8080"

volumes:
db_data:
16 changes: 7 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "5000:5000"
- "127.0.0.1:5000:5000"
working_dir: /app
volumes:
- ${LOG_DATA_DIRECTORY}:/app/log_data/
Expand All @@ -20,8 +20,6 @@ services:
- db
redis:
image: redis:alpine
ports:
- 6379:6379
celery:
build:
context: .
Expand All @@ -40,7 +38,7 @@ services:
- redis
- db
db:
image: postgres:alpine
image: postgres:17-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
Expand All @@ -49,11 +47,11 @@ services:
PGTZ: ${PGTZ}
volumes:
- db_data:/var/lib/postgresql/data
adminer:
image: adminer
restart: always
ports:
- 8081:8080
# adminer:
# image: adminer
# restart: always
# ports:
# - "127.0.0.1:8081:8080"

volumes:
db_data:
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ kiwisolver==1.4.8
kombu==5.5.4
llvmlite==0.44.0
logistro==1.1.0
LogLead==1.2.1
LogLead==1.2.3
Mako==1.3.10
MarkupSafe==3.0.2
matplotlib==3.10.3
Expand All @@ -65,7 +65,8 @@ platformdirs==4.3.8
playwright==1.54.0
plotly==6.1.2
pluggy==1.6.0
polars==1.30.0
polars==1.38.1
polars-runtime-32==1.38.1
prompt_toolkit==3.0.51
psutil==7.0.0
psycopg2-binary==2.9.10
Expand Down
18 changes: 8 additions & 10 deletions server/analysis/utils/line_level_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
def calculate_moving_average_by_columns(
df: pl.DataFrame, window_size: int, columns: list[str]
) -> pl.DataFrame:
df_moving_avg = pl.DataFrame()
for column in columns:
df_moving_avg = df_moving_avg.hstack(
df.select(
pl.col(column)
.rolling_mean(window_size)
.alias(f"moving_avg_{window_size}_{column}")
)
)

return df_moving_avg
if df.height == 0:
return pl.DataFrame({f"moving_avg_{window_size}_{col}": [] for col in columns})

moving_avg_exprs = [
pl.col(col).rolling_mean(window_size).alias(f"moving_avg_{window_size}_{col}")
for col in columns
]
return df.select(moving_avg_exprs)
Loading