Skip to content

Commit

Permalink
tweak duration logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dschep committed Jan 10, 2025
1 parent 9c6c048 commit abc9064
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/sev1_median_duration.geojson

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/sev2_median_duration.geojson

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/sev3_median_duration.geojson

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion process.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ def format_quote(raw_note: str) -> str:
duration = datetime.fromisoformat(
feat.properties["CreationDate"]
) - datetime.fromisoformat(feat.properties["when_did_you_lose_water"])
if feat.properties["when_did_you_regain_water"]:
if (
feat.properties["when_did_you_regain_water"]
and feat.properties["when_did_you_regain_water"]
< feat.properties["CreationDate"]
):
duration = datetime.fromisoformat(
feat.properties["when_did_you_regain_water"]
) - datetime.fromisoformat(feat.properties["when_did_you_lose_water"])
Expand Down

0 comments on commit abc9064

Please sign in to comment.