mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
BC, Geometry: Add safety condition to value computation.
This commit is contained in:
1 parent
1c89b7fb1b
commit
e842fef434
4 files changed
+39
-1
No files matched your search
@@ -368,6 +368,9 @@ class Reach(SQLSubModel):
|
||||
|
||||
def inter_profiles_rk(self):
|
||||
profiles = sorted(self.profiles, key=lambda p: p.rk)
|
||||
if len(profiles) == 0:
|
||||
return []
|
||||
|
||||
first = profiles[0]
|
||||
last = profiles[-1]
|
||||
|
||||
@@ -750,6 +753,9 @@ class Reach(SQLSubModel):
|
||||
cnt += 1
|
||||
|
||||
def get_incline(self):
|
||||
if len(self.profiles) == 0:
|
||||
return 0.0
|
||||
|
||||
first = self.profile(0)
|
||||
last = self.profile(len(self) - 1)
|
||||
|
||||
@@ -767,6 +773,9 @@ class Reach(SQLSubModel):
|
||||
|
||||
def get_incline_mean(self):
|
||||
profiles = self.profiles
|
||||
if len(profiles) == 0:
|
||||
return 0.0
|
||||
|
||||
previous = profiles[0]
|
||||
|
||||
incline_acc = 0
|
||||
@@ -790,6 +799,9 @@ class Reach(SQLSubModel):
|
||||
|
||||
def get_incline_median(self):
|
||||
profiles = self.profiles
|
||||
if len(profiles) == 0:
|
||||
return 0.0
|
||||
|
||||
previous = profiles[0]
|
||||
|
||||
incline_acc = []
|
||||
@@ -814,6 +826,9 @@ class Reach(SQLSubModel):
|
||||
|
||||
def get_incline_median_mean(self):
|
||||
profiles = self.profiles
|
||||
if len(profiles) == 0:
|
||||
return 0.0
|
||||
|
||||
previous = profiles[0]
|
||||
|
||||
incline_acc = []
|
||||
|
||||
Reference in new issue
Block a user