Centerline-width

Latest version: v2.0.0

Safety actively analyzes 688087 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

2.0.0

To adhere to the [Pep 8 - Python Style](https://peps.python.org/pep-0008/) `centerline-width` has undergone a large overhaul to user functions and class names. `2.0.0` will be the first version release to include deprecation warnings for older function/variable/class names. These functions will continue to work with their original names, but will start to throw `FutureWarning` and eventually functionality from these original names will be dropped (but will include helpful tips to transition)

The PEP8 update includes changes to:

- [x] Group imports in [alphabetical ordered groups](https://peps.python.org/pep-0008/#imports) (standard library imports, related third party imports, local specific imports
- [x] [Class names](https://peps.python.org/pep-0008/#class-names) use CamelCase convention
- [x] [Function names](https://peps.python.org/pep-0008/#function-and-variable-names) are lowercase and snakecase
- [x] Back end function names preceded by underscore

Why?
These changes is being done to best maintain `centerline-width` for future work and collaboration. `centerline-width` was originally intended to function for personal academic work, but has been expanded to better serve the geoscience community. Many original decisions were made to maximize clarity, but ended up with verbose, non-ideal, and difficult to read naming conventions (i.e. `centerlineEqualDistanceRelative`). As `centerline-width` has been moving to a more complete stage, this seemed like a good time to clean up lingering tech debt before moving onto the next stage of river analysis development.

If you have any questions, feel free to submit it at the [centerline-width/issues](https://github.com/cyschneck/centerline-width/issues)

Impacted Deprecations:

Functions and Variable Names:
extractPointsToTextFile() -> kml_to_csv()
convertColumnsToCSV() -> txt_to_csv()
plotCenterline() -> plot_centerline()
plotCenterlineWidth() -> plot_centerline_width()
riverWidthFromCenterline() -> width()
saveCenterlineCSV() -> save_centerline_csv()
saveCenterlineMAT() -> save_centerline_mat()
kml_to_csv() extra arg -> text_output_name (to be removed)
txt_to_csv() extra arg -> text_file (to be removed)


Class and Variable Names:
riverCenterline -> CenterlineWidth
optional_cutoff extra arg -> cutoff (to be removed)

Variables Names:
centerlineVoronoi -> centerline_voronoi
centerlineEqualDistance -> centerline_equal_distance
centerlineEvenlySpaced -> centerline_evenly_spaced
centerlineSmoothed -> centerline_smoothed
centerlineLength -> centerline_length
rightBankLength -> right_bank_length
leftBankLength -> left_bank_length
centerlineVoronoiRelative -> centerline_voronoi_relative
centerlineEqualDistanceRelative -> centerline_equal_distance_relative
centerlineEvenlySpacedRelative -> centerline_evenly_spaced_relative
centerlineSmoothedRelative -> centerline_smoothed_relative
save_plot_name extra arg -> save_plot (to be removed, plot_centerline, plot_centerline_width)



Additional work
Expanded codecov for new sinuosity functionality, deprecation, and future warnings

_Bug fixes and README.md edits_

_Pytests: Tests for Python 3.10, 3.11, 3.12 against Ubuntu, macOS, Windows_

1.25

1.7.0

New functionality: Sinuosity
`centerline-width` now includes the ability to calculate the sinuosity. Sinuosity is a feature of rivers and can be indicative of meandering rivers

- sinuosity: the total sinuosity of the river
- incremental_sinuosity(): incremental sinuosity of the river at evenly spaced increments


Sinuosity = centerline length / straight distance from first/last point
Sinuosity = river length / straight line length of the river


Where sinuosity is broken in types:


SI < 1.05: Almost straight river

1.6.0

Update to Back End for plotCenterlineWidth()

Update accounts for the curvature of the Earth when calculating the slope for width with `plotCenterlineWidth()`

Previously, slopes were calculated based on `transect_span_distance` without accounting for the curvature of the planet. Updated functionality now accounts for the curvature of the planet (defined by `ellipsoid`, defaults to `WGS84`). Adjusts positions where width lines intersect banks.

Previous (left) and updated (right) places where width lines intersect bank

![original_left](https://github.com/cyschneck/centerline-width/assets/22159116/c4f3cd43-952f-40af-91a0-331235d13cf6)

Area of River
Return the area contained within the polygon generated the left and right bank latitude/longitudes

river_object.riverArea

Area returned in kilometers^2
python
import centerline_width
river_object = centerline_width.riverCenterline(csv_data="data/river_coords.csv")
river_area = river_object.riverArea


Code Coverage
New code coverage and testing to track back end of repo

Expanding pytests to coverage existing functionality for centerline and widths (~93%) error handling and expected outputs

Backwards Compatibility Conflicts

`convertColumnsToCSV()` argument `flipBankDirection` changed to `flip_direction` to be consistent with snake-case variable naming conventions among other functions

Drops active support for Python 3.9 in support of [NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html)

_Bug fixes and README.md edits_

_Pytests: Tests for Python 3.10, 3.11, 3.12 against Ubuntu, macOS, Windows_

1.5

Upcoming `2.0.0` Deprecation Warning
With the exception of any hot-fixes, the next release for `centerline-width` will be version `2.0.0`. This will be a large overhaul of the package to better adhere to [Pep8 Python Style](https://peps.python.org/pep-0008/) best practices. This will include changes made to function and variable names. You will still be able to use the original function names, but they will now throw a `DeprecationWarning` and advise you to use the new function name. Eventually the old names will be deprecated and no longer usable.

All the README and documentation information will be changed to reflect the new names, but if there are any questions, feel free to submit it at the [centerline-width/issues](https://github.com/cyschneck/centerline-width/issues)

Backwards Compatibility Conflicts
- `riverArea` renamed to `area` for better PEP 8 clarity (most will be covered in the `2.0.0` release)
- Distrubtion changed from `setup.py` to `pyproject.toml`

_Bug fixes and README.md edits_

_Pytests: Tests for Python 3.10, 3.11, 3.12 against Ubuntu, macOS, Windows_

1.05

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.