Skip to content

Commit 73a2e5c

Browse files
committed
Converting docs to rst, first pass
1 parent 02791f6 commit 73a2e5c

File tree

4 files changed

+137
-111
lines changed

4 files changed

+137
-111
lines changed

LICENSE.md LICENSE.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
MIT License
2+
===========
23

3-
Copyright (c) 2021 Tariq Shihadah
4+
*Copyright (c) 2021 Tariq Shihadah*
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy
67
of this software and associated documentation files (the "Software"), to deal

README.md

-108
This file was deleted.

README.rst

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
Overview
2+
========
3+
The ``linref`` library builds on tabular and geospatial libraries ``pandas`` and ``geopandas`` to implement powerful features for linearly referenced data through ``EventsCollection`` and other object classes. Linear referencing operations powered by the ``numpy``, ``shapely``, and ``rangel`` open-source libraries allow for optimized implementations of common and advanced linearly referenced data management, manipulation, and analysis operations.
4+
5+
Some of the main features of this library include:
6+
* Event dissolves using ``EventsCollection.dissolve()``
7+
* Merging and overlaying multiple tables of events with the ``EventsCollection.merge()`` method and the ``EventsMerge`` class API and its many linearly-weighted overlay aggregators
8+
* Linear aggregations of data such as sliding window analysis with the powerful ``EventsMerge.distribute()`` method
9+
* Resegmentation of linear data with ``EventsCollection.to_windows()`` and related methods
10+
* Creating unions of multiple ``EventsCollection`` instances with the ``EventsUnion`` object class.
11+
12+
Code Snippets
13+
=============
14+
Create an events collection for a sample roadway events dataframe with unique
15+
route identifier represented by the 'Route' column and data for multiple years,
16+
represented by the 'Year' column. The begin and end mile points are defined by
17+
the 'Begin' and 'End' columns.
18+
``>>> ec = EventsCollection(df, keys=['Route','Year'], beg='Begin', end='End')``
19+
20+
To select events from a specific route and a specific year, indexing for all
21+
keys can be used, producing an EventsGroup.
22+
``>>> eg = ec['Route 50', 2018]``
23+
24+
To select events on all routes but only those from a specific year, indexing
25+
for only some keys can be used.
26+
``>>> ec_2018 = ec[:, 2018]``
27+
28+
To get all events which intersect with a numeric range, the intersecting()
29+
method can be used on an EventsGroup instance.
30+
``>>> df_intersecting = eg.intersecting(0.5, 1.5, closed='left_mod')``
31+
32+
The intersecting() method can also be used for point locations by ommitting the
33+
second location attribute.
34+
``>>> df_intersecting = eg.intersecting(0.75, closed='both')``
35+
36+
The linearly weighted average of one or more attributes can be obtained using
37+
the overlay_average() method.
38+
``>>> df_overlay = eg.overlay_average(0.5, 1.5, cols=['Speed_Limit','Volume'])``
39+
40+
If the events include information on the roadway speed limit and number of
41+
lanes, they can be dissolved on these attributes. During the dissolve, other
42+
attributes can be aggregated, providing a list of associated values or
43+
performing an aggregation function over these values.
44+
``>>> ec_dissolved = ec.dissolve(attr=['Speed_Limit','Lanes'], aggs=['County'])``
45+
46+
Version Notes
47+
=============
48+
0.0.9 (2023-03-02)
49+
------------------
50+
First update of 2023. Been a quiet start to the year.
51+
* Add missing .any() aggregation method to EventsMergeAttribute API. Was previously available but missed during a previous update.
52+
* Update documentation
53+
* Performance improvements
54+
* Various bug fixes, minor features
55+
56+
0.0.8.post2 (2022-12-23)
57+
------------------------
58+
Final update of 2022 including small feature updates and bug fixes from 0.0.8. Happy Holidays!
59+
* Add .set_df() method for in-line modification of an EventsFrame's dataframe, inplace or not.
60+
* Addition of suffixes parameter and default setting to EventsUnion.union() method.
61+
* Performance improvements
62+
* Various bug fixes, minor features
63+
64+
0.0.8.post1 (2022-12-16)
65+
------------------------
66+
* Improve performance of .project() method when nearest=False by removing dependence on join_nearby() function and using native gpd features.
67+
* Add .size and .shape properties to EventsFrames and subclasses.
68+
* Various bug fixes, minor features
69+
70+
0.0.8 (2022-12-14)
71+
------------------
72+
* Improve performance of essential .get_group() method, reducing superfluous initialization of empty dataframes and events collections and improving logging of initialized groups.
73+
* Improve performance of .union() method with updated RangeCollection.union() features and optimized iteration and aggregation of unified data. Performance times are significantly improved, especially for large datasets with many events groups.
74+
* Improve distribute method performance which was added in recent versions.
75+
* Drop duplicates in .project() method when using sjoin_nearest with newer versions of geopandas. Improved validation in .project() method, address edge case where projecting geometry column has a non-standard label (e.g., not 'geometry').
76+
* Added .sort() method to events collection. Default sorting methods remain unchanged.
77+
* Added warnings for missing data in target columns when initializing an EventsFrames through standard methods.
78+
* Remove .project_old() method from events collection due to deprecation.
79+
* Performance improvements
80+
* Various bug fixes, minor features
81+
82+
0.0.7 (2022-10-14)
83+
------------------
84+
* Refactoring of EventsMerge system from 2D to 3D vectorized relationships for improved performance and accuracy. API and aggregation methods are largely the same.
85+
* Modified closed parameter use in merge relationships in accordance with rangel v0.0.6, which now performs intersections which honor the closed parameter on the left collection as well as the right collection. This provides more accurate results for events which fall on the edges of intersecting events when using left_mod or right_mod closed parameters.
86+
* Updates to account for rangel 0.0.6 version which is now a minimum version requirement. Added other minimum version requirements for related packages.
87+
* Performance improvements
88+
* Various bug fixes, minor features
89+
90+
0.0.5.post1 (2022-09-06)
91+
------------------------
92+
* Address deprecation of length of and iteration over multi-part geometries in shapely
93+
* Remove code redundancies in linref.events.collection for get_most and get_mode
94+
95+
0.0.5 (2022-09-01)
96+
------------------
97+
* Added sumproduct and count aggregators to EventsMergeAttribute class
98+
* Address deprecation of length of and iteration over multi-part geometries in shapely
99+
* Performance improvements
100+
* Various bug fixes, minor features
101+
102+
0.0.4 (2022-06-24)
103+
------------------
104+
* Minor feature additions
105+
* Performance improvements
106+
* Addition of logos in github repo
107+
* Various bug fixes, minor features
108+
109+
0.0.3 (2022-06-07)
110+
------------------
111+
* Various updates for geopandas 0.10+ dependency including improved performance of project methods
112+
* Automatic sorting of events dataframe prior to performing dissolve
113+
* Performance improvements
114+
* Various bug fixes, minor features
115+
116+
0.0.2 (2022-04-11)
117+
------------------
118+
* Various bug fixes, minor features
119+
120+
0.0.1 (2022-03-31)
121+
------------------
122+
* Original experimental release.

pyproject.toml

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
[build-system]
2-
requires = ["sphinx","myst-parser","sphinx-rtd-theme","geopandas"]
2+
requires = ["setuptools", "setuptools-scm", "sphinx", "myst-parser", "sphinx-rtd-theme", "geopandas"]
3+
build-backend = "setuptools.build_meta"
34

45
[project]
56
name = "linref"
7+
version = "0.0.9.post1"
8+
description = "Linearly referenced data management, manipulation, and operations"
9+
readme = "README.md"
10+
requires-python = ">=3.8"
11+
license = {file = "LICENSE.md"}
12+
keywords=["python", "geospatial", "linear", "data", "event", "dissolve", "overlay", "range", "numeric", "interval"]
613
authors = [{name = "Tariq Shihadah", email = "tariq.shihadah@gmail.com"}]
7-
dynamic = ["version", "description"]
14+
dependencies = ["numpy", "matplotlib", "shapely>=1.7", "pandas>=1.1", "geopandas>=0.10.2", "rangel>=0.0.7"]
15+
16+
[project.urls]
17+
documentation = "https://readthedocs.org"
18+
repository = "https://github.com"

0 commit comments

Comments
 (0)