Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dwreeves committed Jun 19, 2024
1 parent 9087ff0 commit ecf57b6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
18 changes: 9 additions & 9 deletions app/data/processing/predictive_models/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ def process_data(df_hobolink: pd.DataFrame, df_usgs: pd.DataFrame) -> pd.DataFra
df_hobolink.groupby("time")
.agg(
{
"pressure": np.mean,
"par": np.mean,
"rain": np.sum,
"rh": np.mean,
"dew_point": np.mean,
"wind_speed": np.mean,
"gust_speed": np.mean,
"wind_dir": np.mean,
"pressure": "mean",
"par": "mean",
"rain": "sum",
"rh": "mean",
"dew_point": "mean",
"wind_speed": "mean",
"gust_speed": "mean",
"wind_dir": "mean",
# 'water_temp': np.mean,
"air_temp": np.mean,
"air_temp": "mean",
}
)
.reset_index()
Expand Down
4 changes: 2 additions & 2 deletions app/data/processing/predictive_models/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def process_data(df_hobolink: pd.DataFrame, df_usgs: pd.DataFrame) -> pd.DataFra
df_usgs.groupby("time")
.agg(
{
"log_stream_flow": np.mean,
"log_stream_flow": "mean",
}
)
.reset_index()
)
df_hobolink = (
df_hobolink.groupby("time")
.agg({"rain": np.sum, "log_air_temp": np.mean, "days_since_sig_rain": np.min})
.agg({"rain": "sum", "log_air_temp": "mean", "days_since_sig_rain": "min"})
.reset_index()
)

Expand Down
18 changes: 9 additions & 9 deletions app/data/processing/predictive_models/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ def process_data(df_hobolink: pd.DataFrame, df_usgs: pd.DataFrame) -> pd.DataFra
df_hobolink.groupby("time")
.agg(
{
"pressure": np.mean,
"par": np.mean,
"rain": np.sum,
"rh": np.mean,
"dew_point": np.mean,
"wind_speed": np.mean,
"gust_speed": np.mean,
"wind_dir": np.mean,
"pressure": "mean",
"par": "mean",
"rain": "sum",
"rh": "mean",
"dew_point": "mean",
"wind_speed": "mean",
"gust_speed": "mean",
"wind_dir": "mean",
# 'water_temp': np.mean,
"air_temp": np.mean,
"air_temp": "mean",
}
)
.reset_index()
Expand Down
4 changes: 2 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ def update_db_command(async_: bool = False, tweet_status: bool = False):
from app.data.celery import update_db_task

if async_:
res = update_db_task.delay(tweet_status=tweet_status)
res = update_db_task.s(tweet_status=tweet_status).delay()
click.echo(f"Started update database task ({res.id!r}).")
else:
click.echo("Updating the database...")
update_db_task.run(tweet_status=tweet_status)
update_db_task.s(tweet_status=tweet_status).run()
click.echo("Updated the database successfully.")

@app.cli.command("gen-mock-data")
Expand Down
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[pytest]
mocked-sessions = app.data.database.db.session
addopts = --cov=app
testpaths =
tests
Expand Down

0 comments on commit ecf57b6

Please sign in to comment.