Recent Releases of centerline-width
centerline-width - 2.0.1 - Python 3.13
Updated to Python 3.13
Release updates Python version to accept 3.13 (now requires Python version >= 3.10)
Additional Minor Changes
areafunction returns data as m^2 instead of km^2
Bug fixes and README.md edits
Pytests: Tests for Python 3.11, 3.12, 3.13 against Ubuntu, macOS, Windows
- Python
Published by cyschneck 7 months ago
centerline-width - 2.0.0 - PEP8, FutureWarnings
2.0.0 Future Warnings and Deprecations are Here!
To adhere to the Pep 8 - Python Style 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 (standard library imports, related third party imports, local specific imports
- [x] Class names use CamelCase convention
- [x] Function 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
Impacted Deprecations:
``` Functions and Variable Names: extractPointsToTextFile() -> kmltocsv() convertColumnsToCSV() -> txttocsv() plotCenterline() -> plotcenterline() plotCenterlineWidth() -> plotcenterlinewidth() riverWidthFromCenterline() -> width() saveCenterlineCSV() -> savecenterlinecsv() saveCenterlineMAT() -> savecenterlinemat() kmltocsv() extra arg -> textoutputname (to be removed) txttocsv() extra arg -> textfile (to be removed)
Class and Variable Names: riverCenterline -> CenterlineWidth optional_cutoff extra arg -> cutoff (to be removed)
Variables Names: centerlineVoronoi -> centerlinevoronoi centerlineEqualDistance -> centerlineequaldistance centerlineEvenlySpaced -> centerlineevenlyspaced centerlineSmoothed -> centerlinesmoothed centerlineLength -> centerlinelength rightBankLength -> rightbanklength leftBankLength -> leftbanklength centerlineVoronoiRelative -> centerlinevoronoirelative centerlineEqualDistanceRelative -> centerlineequaldistancerelative centerlineEvenlySpacedRelative -> centerlineevenlyspacedrelative centerlineSmoothedRelative -> centerlinesmoothedrelative saveplotname extra arg -> saveplot (to be removed, plotcenterline, plotcenterline_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
- Python
Published by cyschneck over 1 year ago
centerline-width - 1.7.0 - Sinuosity, Deprecation Warning
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.05 <= SI < 1.25: Winding river
1.25 <= SI < 1.5: Twisty river
1.5 <= Meandering river
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 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
Backwards Compatibility Conflicts
riverArearenamed toareafor better PEP 8 clarity (most will be covered in the2.0.0release)- Distrubtion changed from
setup.pytopyproject.toml
Bug fixes and README.md edits
Pytests: Tests for Python 3.10, 3.11, 3.12 against Ubuntu, macOS, Windows
- Python
Published by cyschneck over 1 year ago
centerline-width - 1.6.0 - riverArea, account for curvature of Earth, flip_direction
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
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
Bug fixes and README.md edits
Pytests: Tests for Python 3.10, 3.11, 3.12 against Ubuntu, macOS, Windows
- Python
Published by cyschneck over 1 year ago
centerline-width - 1.5.0 - show_plot, Python 3.12 support, relative paths
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
- Python
Published by cyschneck almost 2 years ago
centerline-width - 1.4.1 - equal_axis, dark_mode, transect_slope
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
| equalaxis=False | equalaxis=True |
| ------------- | ------------- |
|
|
|
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
| transectslope="Average" | transectslope="Direct" |
| ------------- | ------------- |
|
|
|
dark_mode
New smart dark mode option when generating Matplotlib (for long suffering eyes)
| darkmode=False | darkmode=True |
| ------------- | ------------- |
|
|
|
Additional Changes:
transect_span_distanceminimum 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
- Python
Published by cyschneck almost 2 years ago
centerline-width - 1.3.0 - New option for riverWidthFromCenterlinen
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
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
- Python
Published by cyschneck about 2 years ago
centerline-width - 1.2.1 - Save CSV fix, inclusive of all points
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
- Python
Published by cyschneck over 2 years ago
centerline-width - 1.2.0 - Coordinate Unit Rename, Width Dictionary Fix
coordinatetype renamed to coordinateunit: "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
- Python
Published by cyschneck over 2 years ago
centerline-width - 1.1.0 - Coordinate Type Options
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 - leftbankrelativecoordinates - rightbankrelativecoordinates - bankpolygonrelative - topbankrelative - bottombankrelative - startingnoderelative - endingnoderelative - bankvoronoirelative - xvoronoiridgepointrelative - yvoronoiridgepointrelative
Bug fixes and README.md edits
Pytests: 205 tests
- Python
Published by cyschneck over 2 years ago
centerline-width - 1.0.1 - ZOrder Fix for Centerline, README edits
README.md edits and ZOrder for Centerline
Update README
- Instructions to Generate KML files from Google Earth Pro
- Details about the purpose and example images for equal_distance
ZOrder
- Fix ZOrder so centerline sits on top of the blue Voronoi paths (when display_all_possible_paths=True)
- Centerline sits on top of blue paths when centerline marker_type="Line" and marker_type="Scatter"
Bug fixes and README.md edits Pytests: 180 test
- Python
Published by cyschneck over 2 years ago
centerline-width - 1.0.0 - Full Release of centerline-width Functionality
Feature in Alpha Release:
Convert raw data from Google Earth Pro to CSV - extractPointsToTextFile() - convertColumnsToCSV()
Find centerline and width of river - plotCenterline() - plotCenterlineWidth() - riverWidthFromCenterline() - centerlineVoronoi - centerlineEqualDistance - centerlineEvenlySpaced - centerlineSmoothed - centerlineLength - rightBankLength - leftBankLength
Export centerline to .CSV and .MAT files - saveCenterlineCSV() - saveCenterlineMAT()
| Centerline | Centerline with Width Lines |
| ------------- | ------------- |
| |
|
Pytests: 180 test
- Python
Published by cyschneck over 2 years ago
centerline-width - plotCenterline() options, plotCenterlineWidth() width fix
New Features:
plotCenterline() - centerlinetype option to graph ("Voronoi", "Evenly Spaced", "Smoothed", "Equal Distance") - markertype option to graph (scatter/line) - centerline_color option (matplotlib color options)
riverCenterline() - ellipsoid option to convert degrees to meters
plotCenterlineWidth() - Replace haversine package with geopy - Remove unit options (will generate distances in km) - Fix to prevent lines from being generated outside the polygon
Bug fixes and README.md edits Pytests: 180 test
- Python
Published by cyschneck over 2 years ago
centerline-width - centerlineEqualDistance, saveCenterlineMAT, latitude_header/longitude_header
New Features:
centerlineEqualDistance
- New centerline type that represents equal distances from each points (set by user) and accounts for the radius of the Earth to convert from degrees to meters
- Set by equal_distance optional argument in riverCenterline (defaults to 10 meters)
- Can be saved in saveCenterlineMAT() and saveCenterlineCSV() as
centerline_type="Equal Distance"
saveCenterlineMAT - Save centerline values to a .mat file
latitudeheader and longitudeheader for saveCenterlineMAT and saveCenterlineCSV
- new options to set the header values for the latitude and longtiude in the output file by the user
Bug fixes and README.md edits
Pytests: 166 tests
- Python
Published by cyschneck over 2 years ago
centerline-width - Bug Fixes: Width Centerline
Bug fixes for returning the width based on centerline
- Python
Published by cyschneck over 2 years ago
centerline-width - User Warnings When Using Smoothed Centerline
User warning if smoothed coordinates need to use interpolatencenterpoints (useful for narrow rivers with sparse data)
- Example Error: WARNING: Partially invalid smoothed centerline due to sparse centerline data (6 points lie outside the polygon), fix recommendation: rerun riverCenterline to create river object with interpolate_n_centerpoints set to 62+
Include new centerline-width logo
Updated README.md example images and descriptions
Bug fixes
- Python
Published by cyschneck over 2 years ago
centerline-width - Access Specific Types of Centerline
New function calls to access centerline types - centerlineVoronoi - centerlineEvenlySpaced - centerlineSmoothed - saveCenterlineCSV()
Clean up cluttered graphs with fewer items - Clean up plots on README.md
Bug fixes: Smoothed centerline accesses evenly spaced centerlines
- Python
Published by cyschneck over 2 years ago
centerline-width - Display Suggestions for Invalid Polygon
- check if invalid polygon due to flipped banks, display suggestions:
Invalid Polygon Due to Flipped Banks, fix recommendation: rerun convertColumnsToCSV() and set flipBankDirection=True (or reset to default 'False' if currently set to flipBankDirection=True) - Error handling when leftkml==rightkml
- Bug fixes, remove redundant code and spelling errors
- Python
Published by cyschneck over 2 years ago
centerline-width - Bug Fixes
- Update README.md to clarify function calls
- Additional pytests to account for user accidentally uses the same KML file for the left and right banks
- Python
Published by cyschneck over 2 years ago
centerline-width - River Class Object and interpolate_data argument
Rework functions to work through a riverCenterlineClass object with new argument to interpolate_data to fix jagged edges and gaps that can form in narrow rivers with sparse data
Convert raw data from Google Earth Pro to CSV
- extractPointsToTextFile()
- convertColumnsToCSV()
Find centerline and width of river
- plotCenterline()
- plotCenterlineWidth()
- riverWidthFromCenterline()
- centerlineLatitudeLongtiude
- centerlineLength
- rightBankLength
- leftBankLength
- Python
Published by cyschneck over 2 years ago
centerline-width - Beta Release: extract data and generate centerline/width
Beta Release for existing functions:
Convert raw data from Google Earth Pro to CSV - extractPointsToTextFile() - convertColumnsToCSV()
Find centerline and width of river - centerlineLatitudeLongitude() - plotCenterline() - plotCenterlineWidth() - riverWidthFromCenterline()
- Python
Published by cyschneck over 2 years ago
centerline-width - Release for basic package functionality
Separate functionality into scripts for package functionality
- convertColumnsToCSV()
- plotCenterline()
- centerlineLatitudeLongitude()
- riverWidthFromCenterline()
- Python
Published by cyschneck almost 3 years ago
centerline-width - Initial release for registration
Pre-release centerline-width registration
- Python
Published by cyschneck almost 3 years ago