Skip to content

Commit 84ef631

Browse files
committed
centerlineLength -> centerline_length
1 parent ceaf5b2 commit 84ef631

6 files changed

+12
-9
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Find the centerline and width of rivers based on the latitude and longitude posi
2525
* centerline_equal_distance
2626
* centerline_evenly_spaced
2727
* centerline_smoothed
28-
* centerlineLength
2928
* **Return river features**
29+
* centerline_length
3030
* rightBankLength
3131
* leftBankLength
3232
* area
@@ -229,7 +229,7 @@ The red pins represent the equal distance centerline coordinates produced by cen
229229
* centerline_equal_distance (list of tuples): List of the latitude and longitude coordinates of the centerline generated by equal distances between coordinates from the Voronoi diagrams
230230
* 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
231231
* 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
232-
* centerlineLength (float): Length of the centerline of the river (in km)
232+
* centerline_length (float): Length of the centerline of the river (in km)
233233
* rightBankLength (float): Length of the right bank of the river (in km)
234234
* leftBankLength (float): Length of the left bank of the river (in km)
235235
* area (float): Area contained within river bank polygon (in km^2)
@@ -382,13 +382,13 @@ Returns a .mat file with the Latitude and Longitude coordinates of the specified
382382
### Length of Centerline
383383
Return the length of the centerline found between the left and right bank generated by the Voronoi diagram
384384
```
385-
river_object.centerlineLength
385+
river_object.centerline_length
386386
```
387387
Length returned in kilometers
388388
```python
389389
import centerline_width
390390
river_object = centerline_width.CenterlineWidth(csv_data="data/river_coords.csv")
391-
river_centerline_length = river_object.centerlineLength
391+
river_centerline_length = river_object.centerline_length
392392
```
393393
The length of the river centerline returns `215.34700589636674` km
394394

centerline_width/pytests/test_verifyRiverCenterlineClass.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def test_CenterlineWidth_default():
403403
pytest.approx((-92.86800742482134, 30.03754989867807)),
404404
pytest.approx((-92.86801289742837, 30.03752504557166))
405405
]
406-
assert river_class_example.centerlineLength == pytest.approx(
406+
assert river_class_example.centerline_length == pytest.approx(
407407
0.08284102060354828)
408408
assert river_class_example.equal_distance == 10
409409
assert river_class_example.centerline_equal_distance == [
@@ -1869,7 +1869,7 @@ def test_CenterlineWidth_interpolateTrue():
18691869
pytest.approx((-92.86800742482134, 30.03754989867807)),
18701870
pytest.approx((-92.86801289742837, 30.03752504557166))
18711871
]
1872-
assert river_class_example.centerlineLength == pytest.approx(
1872+
assert river_class_example.centerline_length == pytest.approx(
18731873
0.08592777952584983)
18741874
assert river_class_example.equal_distance == 10
18751875
assert river_class_example.centerline_equal_distance == [

centerline_width/pytests/test_verifyRiverFeatures.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def river_class_object():
111111

112112
## riverFeatures() #####################################################
113113
def test_riverFeatures_centerlineLength():
114-
assert river_class_example.centerlineLength == pytest.approx(
114+
assert river_class_example.centerline_length == pytest.approx(
115115
0.08284102060354828)
116116

117117

centerline_width/riverCenterlineClass.py

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ def __init__(self,
152152
self.centerlineLength = centerline_width.centerlineLength(
153153
centerline_coordinates=shortest_path_coordinates,
154154
ellipsoid=self.ellipsoid)
155+
self.centerline_length = centerline_width.centerlineLength(
156+
centerline_coordinates=shortest_path_coordinates,
157+
ellipsoid=self.ellipsoid)
155158

156159
# Set the different types of Centerline coordinates
157160
self.equal_distance = equal_distance

river_centerline_width_example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
print("centerline_evenly_spaced = {0}".format(
4141
river.centerline_evenly_spaced))
4242
print("centerline_smoothed = {0}".format(river.centerline_smoothed))
43-
'''
4443
print("\nCenterline Length = {0} km".format(river.centerlineLength))
44+
'''
4545
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
4646
print("Right Bank Length = {0} km".format(river.rightBankLength))
4747
print("Left Bank Length = {0} km".format(river.leftBankLength))

river_centerline_width_example_deprecation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
river.centerlineEqualDistance))
4242
print("centerlineEvenlySpaced = {0}".format(river.centerlineEvenlySpaced))
4343
print("centerlineSmoothed = {0}".format(river.centerlineSmoothed))
44-
'''
4544
print("\nCenterline Length = {0} km".format(river.centerlineLength))
45+
'''
4646
print("Centerline Length = {0} m".format(river.centerlineLength * 1000))
4747
print("Right Bank Length = {0} km".format(river.rightBankLength))
4848
print("Left Bank Length = {0} km".format(river.leftBankLength))

0 commit comments

Comments
 (0)