fix: Swaps high and lows for ranges if needed to make negatives behave nicer
All checks were successful
gitea-physics/pdme/pipeline/head This commit looks good

This commit is contained in:
2022-03-28 10:46:26 -05:00
parent f2cb33e78b
commit 8a60967ddf
3 changed files with 47 additions and 0 deletions

View File

@@ -48,3 +48,5 @@ class DotRangeMeasurement():
def __post_init__(self) -> None:
self.r = numpy.array(self.r)
if self.v_low > self.v_high:
self.v_low, self.v_high = self.v_high, self.v_low

View File

@@ -56,3 +56,5 @@ class DotPairRangeMeasurement():
def __post_init__(self) -> None:
self.r1 = numpy.array(self.r1)
self.r2 = numpy.array(self.r2)
if self.v_low > self.v_high:
self.v_low, self.v_high = self.v_high, self.v_low