Skip to content

Commit

Permalink
Issue/dont save if nan (#71)
Browse files Browse the repository at this point in the history
* drop nans if in generation_mw

* pydantic<2.0

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
peterdudfield and pre-commit-ci[bot] authored Sep 5, 2023
1 parent 880ee11 commit 8169936
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gspconsumer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ def pull_data_and_save(
else:
logger.debug(f"This is the first lot gsp yield data for GSP {(gsp.gsp_id)}")

# drop any nan values in generation_mw column
gsp_yield_df = gsp_yield_df.dropna(subset=["generation_mw"])

# need columns datetime_utc, solar_generation_kw
gsp_yield_df["solar_generation_kw"] = 1000 * gsp_yield_df["generation_mw"]
gsp_yield_df["datetime_utc"] = gsp_yield_df["datetime_gmt"]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
numpy
pydantic<2.0
pandas
pyyaml
urllib3
Expand Down

0 comments on commit 8169936

Please sign in to comment.