Skip to content

Commit

Permalink
Merge pull request #80 from openearthplatforminitiative/fix/add-wkt
Browse files Browse the repository at this point in the history
Fix/add wkt
  • Loading branch information
giltinde authored Jun 17, 2024
2 parents c255cad + 5e7cc1d commit fb3f837
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 14 additions & 13 deletions data_pipelines/assets/flood/discharge.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,17 +592,6 @@ def forecast(
how="left",
)

new_meta = detailed_forecast_df._meta.copy()
new_meta["wkt"] = "str"

# Apply this optimized function
detailed_forecast_df = detailed_forecast_df.map_partitions(
add_geometry,
half_grid_size=GLOFAS_RESOLUTION / 2,
precision=GLOFAS_PRECISION,
meta=new_meta,
)

detailed_forecast_df["issued_on"] = detailed_forecast_df[
"issued_on"
].astype(str)
Expand All @@ -625,8 +614,6 @@ def forecast(

# Compute summary forecast

detailed_forecast_df = detailed_forecast_df.drop(columns=["wkt"])

peak_timing_df = compute_flood_peak_timing(detailed_forecast_df)
tendency_df = compute_flood_tendency(detailed_forecast_df)
intensity_df = compute_flood_intensity(detailed_forecast_df)
Expand All @@ -653,6 +640,20 @@ def forecast(
how="inner",
)

new_meta = detailed_forecast_df._meta.copy()
new_meta["wkt"] = "str"

# Apply this optimized function
detailed_forecast_df = detailed_forecast_df.map_partitions(
add_geometry,
half_grid_size=GLOFAS_RESOLUTION / 2,
precision=GLOFAS_PRECISION,
meta=new_meta,
)

detailed_forecast_df = detailed_forecast_df.persist()
wait(detailed_forecast_df)

# Save the detailed forecast data to a parquet file
detailed_forecast_df.to_parquet(
detailed_forecast_path,
Expand Down
2 changes: 1 addition & 1 deletion deployment/dagster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dagster-user-deployments:
- name: "data-pipelines"
image:
repository: "ghcr.io/openearthplatforminitiative/data-pipelines"
tag: 0.3.59
tag: 0.3.60
pullPolicy: Always
dagsterApiGrpcArgs:
- "--module-name"
Expand Down

0 comments on commit fb3f837

Please sign in to comment.