Centerline-width

Latest version: v2.0.0

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

Scan your dependencies

Page 2 of 5

1.5.0

New options: show_plot

New option `show_plot` and the option to use relative paths. New options are optional and backwards compatible, so there should be no impact on existing scripts.

**show_plot**

New option in `plotCenterline()` and `plotCenterlineWidth()`

New option to not show a newly generated plot. The plot will still save if `save_plot` is still in use. Useful when running `centerline-width` as part of a loop to save multiple plots without having to close each plot after it is generated. `show_plot=False` is the same as not using plt.show() in Matplotlib.

**Relative Paths**

New back-end option to use a relative instead of absolute path when `convertColumnsToCSV()`


relative path: file_path = "../../B/aaa.txt"
absolute path: file_path = "test/testing/B/aaa.txt"


**Python 3.12 Support**

Expanded testing suite and verify support with Python 3.12. Currently supporting Python 3.9, 3.10, 3.11, 3.12

**Developer Environment**

New conda environment file `environment.yml` for working with or testing against the `centerline-width`

_Bug fixes and README.md edits_

_Pytests: 233 tests for Python 3.9, 3.10, 3.11, 3.12 against Ubuntu, macOS, Windows_

1.4.1

New Options: `equal_axis`, `transect_slope`, `dark_mode`
All new options are optional and backwards compatible so there should be no impact to existing scripts

equal_axis

Closes: 4 where perpendicular width lines do not appear perpendicular

equal_axis will set the x and y axis of the plot to be equal. Useful to show the perpendicular width lines as perpendicular since it can appear distorted by default in Matplotlib

| equal_axis=False | equal_axis=True |
| ------------- | ------------- |
| ![river_not_equal+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_not_equal_default_ax.png) | ![river_equal+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_equal_ax.png)|

transect_slope
The width lines are generated as perpendicular to the slopes of the points across `transect_span_distance`

By default, `transect_slope="Average"` where the width lines are perpendicular to the average slopes of the across span distance. For example: `[A, B, C, D] = avg( slope([A, B]) + slope([B, C]) + slope([C+D]) )`

Optionally, if `transect_slope="Direct"` then the width lines will be perpendicular to slope of the first and last point. For example: `[A, B, C, D] = slope([A, D])` to avoid being susceptible to rapid small changes along the centerline

![transect_span_distance](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/slope_description.png)
| transect_slope="Average" | transect_slope="Direct" |
| ------------- | ------------- |
| ![river_transect_avg+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_transect_avg.png) | ![river_transect_direct+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_transect_direct.png) |

dark_mode

New smart dark mode option when generating Matplotlib (for long suffering eyes)

| dark_mode=False | dark_mode=True |
| ------------- | ------------- |
| ![river_white+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_dark_mode_false.png) | ![river_black+png](https://raw.githubusercontent.com/cyschneck/centerline-width/main/data/doc_examples/river_coords_width_dark_mode_true.png)|

Additional Changes:
- `transect_span_distance` minimum has been change from 3 to 2 (to measure a single slope)

Note: Re-release of 1.4.0 with hot fix for PyPi package

__Bug fixes and README.md edits__
__Pytests: 229 tests for Python 3.9, 3.10, 3.11__

1.3.0

New Option for riverWidthFromCenterline: coordinate_reference
New option for `riverWidthFromCenterlinen()` to reference a width line
- Two options: `Centerline` and `Banks`
- By default, `coordinate_reference="Centerline"` where width lines are referenced in respect to the centerline coordinate that it intersects
- New option, `coordinate_reference="Banks"` where width lines are referenced in respect to the right and left banks that it intersects (resolves: 1)
- No changes to existing behavior and function is backwards compatible

More details: [riverWidthFromCenterline](https://github.com/cyschneck/centerline-width#return-width-of-river)

Bug fix: centerlineLength()
Length was being calculated incorrectly as the pairs of coordinates being calculated were not correctly updating (A->B + A->C, fix: A->B + B->C)

Thanks to mthaddon for identifying the bug and PR fix 2 🎉

_Bug fixes and README.md edits_

_Pytests: 211 tests_

1.2.1

Bug Fix: riverWidthFromCenterline()
Fix allows for width from centerline to be saved to a csv
- Bug introduced when `coordinate_type` renamed to `coordinate_unit`
- Backend updated: new script saveOutput.py
- saveOutput.py: saveCenterlineCSV() and saveCenterlineMAT() moved to a separate script

Inclusive of all points
`left_bank_relative_coordinates` now inclusive for all points
- Includes the first point of the left bank to be a Relative Distance of (0,0)

_Bug fixes and README.md edits_

_Pytests: 205 tests_

1.2.0

coordinate_type renamed to coordinate_unit: "Relative Distance" vs. "Decimal Degrees"
Original argument renamed from `coordinate_type` to `coordinate_unit`

Change can impact backward functionality in:

- plotCenterline()
- plotCenterlineWidth()
- saveCenterlineCSV()
- saveCenterlineMAT()

Fix to `riverWidthFromCenterline()`
Returns accurate coordinates and width size when using `coordinate_unit = "Relative Distance"`

_Bug fixes and README.md edits_

_Pytests: 205 tests_

1.1.0

New Coordinate Option: "Relative Distance" vs "Decimal Degrees"
**New optional argument to designate which coordinate system to use: `coordinate_type`**

`Decimal Degrees`: Default option that uses a latitude/longitude of each point

`Relative Distance`: New option that converts each point to a distance from the first point on the left bank

Function that accept new coordinate_type option:
- plotCenterline()
- plotCenterlineWidth()
- saveCenterlineCSV()
- saveCenterlineMAT()

New river class options:
- centerlineVoronoiRelative
- centerlineEqualDistanceRelative
- centerlineEvenlySpacedRelative
- centerlineSmoothedRelative
- left_bank_relative_coordinates
- right_bank_relative_coordinates
- bank_polygon_relative
- top_bank_relative
- bottom_bank_relative
- starting_node_relative
- ending_node_relative
- bank_voronoi_relative
- x_voronoi_ridge_point_relative
- y_voronoi_ridge_point_relative

_Bug fixes and README.md edits_

_Pytests: 205 tests_

Page 2 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.