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 dfe2899
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 27 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
12 changes: 6 additions & 6 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,18 @@ def _wrap(*args, **kwargs):

@app.cli.command("update-db")
@click.option(
"--async",
"async_",
"--tweet-status/--dont-tweet-status",
is_flag=True,
default=False,
help="If set, then run this command in Celery."
" This can help save a bit of money on Heroku compute.",
help="If set, then send a tweet indicating the status of the flags.",
)
@click.option(
"--tweet-status/--dont-tweet-status",
"--async",
"async_",
is_flag=True,
default=False,
help="If set, then send a tweet indicating the status of the flags.",
help="If set, then run this command in Celery."
" This can help save a bit of money on Heroku compute.",
)
@with_appcontext
@mail_on_fail
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 dfe2899

Please sign in to comment.