Skip to content

Commit

Permalink
leftBankLength -> left_bank_length
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Aug 17, 2024
1 parent 84ef631 commit 4cd9460
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Find the centerline and width of rivers based on the latitude and longitude posi
* centerline_smoothed
* **Return river features**
* centerline_length
* rightBankLength
* leftBankLength
* right_bank_length
* left_bank_length
* area
* sinuosity
* incremental_sinuosity()
Expand Down Expand Up @@ -230,8 +230,8 @@ The red pins represent the equal distance centerline coordinates produced by cen
* centerline_evenly_spaced (list of tuples): List of the latitude and longitude coordinates of the centerline generated by evenly spacing out points generated by the Voronoi diagrams
* centerline_smoothed (list of tuples): List of the latitude and longitude coordinates of the centerline generated by smoothing out the evenly spaced-out points generated by the Voronoi diagrams
* centerline_length (float): Length of the centerline of the river (in km)
* rightBankLength (float): Length of the right bank of the river (in km)
* leftBankLength (float): Length of the left bank of the river (in km)
* right_bank_length (float): Length of the right bank of the river (in km)
* left_bank_length (float): Length of the left bank of the river (in km)
* area (float): Area contained within river bank polygon (in km^2)
* sinuosity (float): Sinuosity of the river based on evenly spaced centerline coordinates
* centerlineVoronoiRelative (list of tuples): List of the relative distance coordinates of the centerline generated by Voronoi diagrams
Expand Down
8 changes: 4 additions & 4 deletions centerline_width/pytests/test_verifyRiverCenterlineClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ def test_CenterlineWidth_default():
pytest.approx((69.70659214132293, 133.54671863851024)),
pytest.approx((74.46421931823045, 133.19494595720758))
]
assert river_class_example.rightBankLength == pytest.approx(
assert river_class_example.right_bank_length == pytest.approx(
0.09705816897006408)
assert river_class_example.leftBankLength == pytest.approx(
assert river_class_example.left_bank_length == pytest.approx(
0.10570962276643736)
assert river_class_example.area == pytest.approx(11.4030195647527)
assert river_class_example.starting_node == pytest.approx(
Expand Down Expand Up @@ -1548,9 +1548,9 @@ def test_CenterlineWidth_interpolateTrue():
pytest.approx((74.46421931823045, 133.19494595720758)),
pytest.approx((74.46421931823045, 133.19494595720758))
]
assert river_class_example.rightBankLength == pytest.approx(
assert river_class_example.right_bank_length == pytest.approx(
0.09705816897212159)
assert river_class_example.leftBankLength == pytest.approx(
assert river_class_example.left_bank_length == pytest.approx(
0.1057096227682203)
assert river_class_example.area == pytest.approx(11.403019517285152)
assert river_class_example.starting_node == pytest.approx(
Expand Down
4 changes: 2 additions & 2 deletions centerline_width/pytests/test_verifyRiverFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def test_riverFeatures_centerlineLength():


def test_riverFeatures_rightBankLength():
assert river_class_example.rightBankLength == pytest.approx(
assert river_class_example.right_bank_length == pytest.approx(
0.09705816897006408)


def test_riverFeatures_leftBankLength():
assert river_class_example.leftBankLength == pytest.approx(
assert river_class_example.left_bank_length == pytest.approx(
0.10570962276643736)


Expand Down
8 changes: 7 additions & 1 deletion centerline_width/riverCenterlineClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ def __init__(self,

# Right/Length Bank Length
self.rightBankLength = centerline_width.centerlineLength(
centerline_coordinates=right_bank_coordinates,
ellipsoid=self.ellipsoid) # Pending Deprecation
self.right_bank_length = centerline_width.centerlineLength(
centerline_coordinates=right_bank_coordinates,
ellipsoid=self.ellipsoid)
self.leftBankLength = centerline_width.centerlineLength(
centerline_coordinates=left_bank_coordinates,
ellipsoid=self.ellipsoid) # Pending Deprecation
self.left_bank_length = centerline_width.centerlineLength(
centerline_coordinates=left_bank_coordinates,
ellipsoid=self.ellipsoid)

Expand Down Expand Up @@ -151,7 +157,7 @@ def __init__(self,
# Centerline length
self.centerlineLength = centerline_width.centerlineLength(
centerline_coordinates=shortest_path_coordinates,
ellipsoid=self.ellipsoid)
ellipsoid=self.ellipsoid) # Pending Deprecation
self.centerline_length = centerline_width.centerlineLength(
centerline_coordinates=shortest_path_coordinates,
ellipsoid=self.ellipsoid)
Expand Down
6 changes: 3 additions & 3 deletions river_centerline_width_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
print("centerline_evenly_spaced = {0}".format(
river.centerline_evenly_spaced))
print("centerline_smoothed = {0}".format(river.centerline_smoothed))
print("\nCenterline Length = {0} km".format(river.centerlineLength))
print("\nCenterline Length = {0} km".format(river.centerline_length))
print("Right Bank Length = {0} km".format(river.right_bank_length))
print("Left Bank Length = {0} km".format(river.left_bank_length))
'''
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
print("Right Bank Length = {0} km".format(river.rightBankLength))
print("Left Bank Length = {0} km".format(river.leftBankLength))
print("ellipsoid = {0}".format(river.ellipsoid))
print("centerlineVoronoiRelative = {0}".format(
river.centerlineVoronoiRelative))
Expand Down
4 changes: 2 additions & 2 deletions river_centerline_width_example_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced))
print("centerlineSmoothed = {0}".format(river.centerlineSmoothed))
print("\nCenterline Length = {0} km".format(river.centerlineLength))
'''
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
print("Right Bank Length = {0} km".format(river.rightBankLength))
print("Left Bank Length = {0} km".format(river.leftBankLength))
'''
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
print("ellipsoid = {0}".format(river.ellipsoid))
print("centerlineVoronoiRelative = {0}".format(
river.centerlineVoronoiRelative))
Expand Down

0 comments on commit 4cd9460

Please sign in to comment.