From e54c7d09a4d937ecf9cbc333833f04da8abddd32 Mon Sep 17 00:00:00 2001 From: Alfredos-Panagiotis Damkalis Date: Thu, 29 Aug 2019 18:04:05 +0300 Subject: [PATCH] Fix overlap validation Signed-off-by: Alfredos-Panagiotis Damkalis --- network/base/validators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/network/base/validators.py b/network/base/validators.py index d5513c4..0bfe9cf 100644 --- a/network/base/validators.py +++ b/network/base/validators.py @@ -76,6 +76,7 @@ def check_overlaps(stations_dict): for j in range(i + 1, total_periods): start_j = periods[j][0] end_j = periods[j][1] - if (start_j <= start_i <= end_j) or (start_j <= end_i <= end_j): + if ((start_j <= start_i <= end_j) or (start_j <= end_i <= end_j) or + (start_i <= start_j and end_i >= end_j)): raise ObservationOverlapError('Observations of station {0} overlap' .format(station))