diff options
| author | Yuval Adam <_@yuv.al> | 2020-09-27 17:40:12 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2020-09-27 17:40:12 +0300 |
| commit | b120c61343b2f738b7d19fde8c92fbcc377f9441 (patch) | |
| tree | 8c400d43c2a2882a968f038e83cd7b9c2c56e430 /iss/predictions.py | |
| parent | 89894bf60a95e7f52717856053738a56d736d341 (diff) | |
Initial prediction rendering in template
Diffstat (limited to 'iss/predictions.py')
| -rw-r--r-- | iss/predictions.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/iss/predictions.py b/iss/predictions.py index 29bcf2c..1bdd10e 100644 --- a/iss/predictions.py +++ b/iss/predictions.py @@ -77,7 +77,13 @@ class Predictions(object): # docs mention the possibilibity of several culminations # https://rhodesmill.org/skyfield/earth-satellites.html#finding-when-a-satellite-rises-and-sets # but this doesn't seem to happen in our case - return list(chunks(ts, 3)) + res = list(chunks(ts, 3)) + + if len(res[-1]) != 3: + # truncate the last event in case it's a partial one + res = res[:-1] + + return res def get_predictions(self): preds = self.get_prediction_events() |
