gtfs_kit 5.2.1__tar.gz → 5.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gtfs-kit
3
- Version: 5.2.1
3
+ Version: 5.2.3
4
4
  Summary: A Python 3.8+ library for analyzing GTFS feeds.
5
5
  Home-page: https://github.com/mrcagney/gtfs_kit
6
6
  License: MIT
@@ -27,8 +27,7 @@ Description-Content-Type: text/x-rst
27
27
 
28
28
  GTFS Kit
29
29
  ********
30
- .. image:: https://travis-ci.com/mrcagney/gtfs_kit.svg?branch=master
31
- :target: https://travis-ci.come/mrcagney/gtfs_kit
30
+ .. image:: https://github.com/mrcagney/gtfs_kit/actions/workflows/run_tests.yml/badge.svg
32
31
 
33
32
  GTFS Kit is a Python 3.8+ library for analyzing `General Transit Feed Specification (GTFS) <https://en.wikipedia.org/wiki/GTFS>`_ data in memory without a database.
34
33
  It uses Pandas and Shapely to do the heavy lifting.
@@ -48,19 +47,27 @@ You can find examples in the Jupyter notebook ``notebooks/examples.ipynb``.
48
47
 
49
48
  Authors
50
49
  =========
51
- - Alex Raichev, 2019-09
50
+ - Alex Raichev (2019-09), maintainer
52
51
 
53
52
 
54
53
  Documentation
55
54
  =============
56
- Documentation is built via Sphinx from the source code in the `docs` directory then published to Github Pages at `mrcagney.github.io/gtfs_kit_docs <https://mrcagney.github.io/gtfs_kit_docs>`_.
55
+ Documentation is built via Sphinx from the source code in the ``docs`` directory then published to Github Pages at `mrcagney.github.io/gtfs_kit_docs <https://mrcagney.github.io/gtfs_kit_docs>`_.
57
56
 
58
57
 
59
58
  Notes
60
59
  =====
61
- - Development status is Alpha. I use this project for work and change it breakingly to suit my needs.
60
+ - This project's development status is Alpha.
61
+ I use GTFS Kit for work and change it breakingly to suit my needs.
62
62
  - This project uses semantic versioning.
63
- - Thanks to `MRCagney <http://www.mrcagney.com/>`_ for donating to this project.
64
- - Constructive feedback and contributions are welcome. Please issue pull requests from a feature branch into the ``develop`` branch and include tests.
65
- - GTFS time is measured relative noon minus 12 hours, which can mess things up when crossing into daylight savings time. I don't think this issue causes any bugs in GTFS Kit, but you and i have been warned. Thanks to derhuerst for bringing this to my attention in `closed Issue 8 <https://github.com/mrcagney/gtfs_kit/issues/8#issue-1063633457>`_.
63
+ - I aim for GTFS Kit to handle `the current GTFS <https://developers.google.com/transit/gtfs/reference>`_.
64
+ In particular, i avoid handling `GTFS extensions <https://developers.google.com/transit/gtfs/reference/gtfs-extensions>`_.
65
+ That is the most reasonable scope boundary i can draw at present, given this project's tiny budget.
66
+ If you would like to fund me to expand that scope, feel free to email me.
67
+ - Thanks to `MRCagney <http://www.mrcagney.com/>`_ for periodically donating to this project.
68
+ - Constructive feedback and contributions are welcome.
69
+ Please issue pull requests from a feature branch into the ``develop`` branch and include tests.
70
+ - GTFS time is measured relative noon minus 12 hours, which can mess things up when crossing into daylight savings time.
71
+ I don't think this issue causes any bugs in GTFS Kit, but you and i have been warned.
72
+ Thanks to user derhuerst for bringing this to my attention in `closed Issue 8 <https://github.com/mrcagney/gtfs_kit/issues/8#issue-1063633457>`_.
66
73
 
@@ -0,0 +1,45 @@
1
+ GTFS Kit
2
+ ********
3
+ .. image:: https://github.com/mrcagney/gtfs_kit/actions/workflows/run_tests.yml/badge.svg
4
+
5
+ GTFS Kit is a Python 3.8+ library for analyzing `General Transit Feed Specification (GTFS) <https://en.wikipedia.org/wiki/GTFS>`_ data in memory without a database.
6
+ It uses Pandas and Shapely to do the heavy lifting.
7
+
8
+ This project supersedes `GTFSTK <https://github.com/mrcagney/gtfstk>`_.
9
+
10
+
11
+ Installation
12
+ =============
13
+ ``poetry add gtfs_kit``.
14
+
15
+
16
+ Examples
17
+ ========
18
+ You can find examples in the Jupyter notebook ``notebooks/examples.ipynb``.
19
+
20
+
21
+ Authors
22
+ =========
23
+ - Alex Raichev (2019-09), maintainer
24
+
25
+
26
+ Documentation
27
+ =============
28
+ Documentation is built via Sphinx from the source code in the ``docs`` directory then published to Github Pages at `mrcagney.github.io/gtfs_kit_docs <https://mrcagney.github.io/gtfs_kit_docs>`_.
29
+
30
+
31
+ Notes
32
+ =====
33
+ - This project's development status is Alpha.
34
+ I use GTFS Kit for work and change it breakingly to suit my needs.
35
+ - This project uses semantic versioning.
36
+ - I aim for GTFS Kit to handle `the current GTFS <https://developers.google.com/transit/gtfs/reference>`_.
37
+ In particular, i avoid handling `GTFS extensions <https://developers.google.com/transit/gtfs/reference/gtfs-extensions>`_.
38
+ That is the most reasonable scope boundary i can draw at present, given this project's tiny budget.
39
+ If you would like to fund me to expand that scope, feel free to email me.
40
+ - Thanks to `MRCagney <http://www.mrcagney.com/>`_ for periodically donating to this project.
41
+ - Constructive feedback and contributions are welcome.
42
+ Please issue pull requests from a feature branch into the ``develop`` branch and include tests.
43
+ - GTFS time is measured relative noon minus 12 hours, which can mess things up when crossing into daylight savings time.
44
+ I don't think this issue causes any bugs in GTFS Kit, but you and i have been warned.
45
+ Thanks to user derhuerst for bringing this to my attention in `closed Issue 8 <https://github.com/mrcagney/gtfs_kit/issues/8#issue-1063633457>`_.
@@ -12,4 +12,4 @@ from .validators import *
12
12
  from .feed import *
13
13
 
14
14
 
15
- __version__ = "5.2.1"
15
+ __version__ = "5.2.3"
@@ -724,21 +724,13 @@ def geometrize_routes(
724
724
  d["geometry"] = so.linemerge(group.geometry.tolist())
725
725
  return pd.Series(d)
726
726
 
727
- if use_utm:
728
- lat, lon = feed.shapes[["shape_pt_lat", "shape_pt_lon"]].values[0]
729
- crs = hp.get_utm_crs(lat, lon)
730
- else:
731
- crs = cs.WGS84
732
-
733
727
  return (
734
728
  feed.geometrize_trips(trip_ids, use_utm=use_utm)
735
729
  .filter(["route_id", "direction_id", "geometry"])
736
- # GeoDataFrame disappears here
737
730
  .groupby(groupby_cols)
738
731
  .apply(merge_lines)
739
732
  .reset_index()
740
733
  .merge(feed.routes)
741
- .pipe(gp.GeoDataFrame, crs=crs)
742
734
  )
743
735
 
744
736
 
@@ -77,18 +77,22 @@ def geometrize_shapes_0(
77
77
 
78
78
  If ``use_utm``, then use local UTM coordinates for the geometries.
79
79
  """
80
- f = shapes.copy().sort_values(["shape_id", "shape_pt_sequence"])
81
80
 
82
81
  def my_agg(group):
83
82
  d = {}
84
83
  d["geometry"] = sg.LineString(group[["shape_pt_lon", "shape_pt_lat"]].values)
85
84
  return pd.Series(d)
86
85
 
87
- g = f.groupby("shape_id").apply(my_agg).reset_index()
88
- g = gp.GeoDataFrame(g, crs=cs.WGS84)
86
+ g = (
87
+ shapes.sort_values(["shape_id", "shape_pt_sequence"])
88
+ .groupby("shape_id", sort=False)
89
+ .apply(my_agg)
90
+ .reset_index()
91
+ .pipe(gp.GeoDataFrame, crs=cs.WGS84)
92
+ )
89
93
 
90
94
  if use_utm:
91
- lat, lon = f[["shape_pt_lat", "shape_pt_lon"]].values[0]
95
+ lat, lon = shapes[["shape_pt_lat", "shape_pt_lon"]].values[0]
92
96
  crs = hp.get_utm_crs(lat, lon)
93
97
  g = g.to_crs(crs)
94
98
 
@@ -190,7 +194,7 @@ def get_shapes_intersecting_geometry(
190
194
  geometry: sg.base.BaseGeometry,
191
195
  shapes_g: Optional[gp.GeoDataFrame] = None,
192
196
  *,
193
- geometrized: bool = False
197
+ geometrized: bool = False,
194
198
  ) -> pd.DataFrame:
195
199
  """
196
200
  Return the subset of ``feed.shapes`` that contains all shapes that
@@ -584,11 +584,9 @@ def geometrize_stops_0(
584
584
  ``'stop_lat'``.
585
585
  """
586
586
  g = (
587
- stops.assign(
588
- geometry=lambda x: [sg.Point(p) for p in x[["stop_lon", "stop_lat"]].values]
589
- )
587
+ stops.assign(geometry=gp.points_from_xy(x=stops.stop_lon, y=stops.stop_lat))
590
588
  .drop(["stop_lon", "stop_lat"], axis=1)
591
- .pipe(lambda x: gp.GeoDataFrame(x, crs=cs.WGS84))
589
+ .pipe(gp.GeoDataFrame, crs=cs.WGS84)
592
590
  )
593
591
 
594
592
  if use_utm:
@@ -1477,7 +1477,7 @@ def check_transfers(
1477
1477
  )
1478
1478
 
1479
1479
  # Check transfer_type
1480
- v = lambda x: pd.isna(x) or x in range(5)
1480
+ v = lambda x: pd.isna(x) or x in range(4)
1481
1481
  problems = check_column(
1482
1482
  problems, table, f, "transfer_type", v, column_required=False
1483
1483
  )
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "gtfs_kit"
3
- version = "5.2.1"
3
+ version = "5.2.3"
4
4
  description = "A Python 3.8+ library for analyzing GTFS feeds."
5
5
  authors = ["Alex Raichev <araichev@mrcagney.com>"]
6
6
  readme = "README.rst"
@@ -0,0 +1,38 @@
1
+ # -*- coding: utf-8 -*-
2
+ from setuptools import setup
3
+
4
+ packages = \
5
+ ['gtfs_kit']
6
+
7
+ package_data = \
8
+ {'': ['*']}
9
+
10
+ install_requires = \
11
+ ['folium>=0',
12
+ 'geopandas>=0',
13
+ 'json2html>=1',
14
+ 'pandas>=1',
15
+ 'pycountry>=19',
16
+ 'requests>=2',
17
+ 'rtree>=0',
18
+ 'shapely>=1',
19
+ 'utm>=0']
20
+
21
+ setup_kwargs = {
22
+ 'name': 'gtfs-kit',
23
+ 'version': '5.2.3',
24
+ 'description': 'A Python 3.8+ library for analyzing GTFS feeds.',
25
+ 'long_description': "GTFS Kit\n********\n.. image:: https://github.com/mrcagney/gtfs_kit/actions/workflows/run_tests.yml/badge.svg\n\nGTFS Kit is a Python 3.8+ library for analyzing `General Transit Feed Specification (GTFS) <https://en.wikipedia.org/wiki/GTFS>`_ data in memory without a database.\nIt uses Pandas and Shapely to do the heavy lifting.\n\nThis project supersedes `GTFSTK <https://github.com/mrcagney/gtfstk>`_.\n\n\nInstallation\n=============\n``poetry add gtfs_kit``.\n\n\nExamples\n========\nYou can find examples in the Jupyter notebook ``notebooks/examples.ipynb``.\n\n\nAuthors\n=========\n- Alex Raichev (2019-09), maintainer\n\n\nDocumentation\n=============\nDocumentation is built via Sphinx from the source code in the ``docs`` directory then published to Github Pages at `mrcagney.github.io/gtfs_kit_docs <https://mrcagney.github.io/gtfs_kit_docs>`_.\n\n\nNotes\n=====\n- This project's development status is Alpha.\n I use GTFS Kit for work and change it breakingly to suit my needs.\n- This project uses semantic versioning.\n- I aim for GTFS Kit to handle `the current GTFS <https://developers.google.com/transit/gtfs/reference>`_.\n In particular, i avoid handling `GTFS extensions <https://developers.google.com/transit/gtfs/reference/gtfs-extensions>`_.\n That is the most reasonable scope boundary i can draw at present, given this project's tiny budget.\n If you would like to fund me to expand that scope, feel free to email me.\n- Thanks to `MRCagney <http://www.mrcagney.com/>`_ for periodically donating to this project.\n- Constructive feedback and contributions are welcome.\n Please issue pull requests from a feature branch into the ``develop`` branch and include tests.\n- GTFS time is measured relative noon minus 12 hours, which can mess things up when crossing into daylight savings time.\n I don't think this issue causes any bugs in GTFS Kit, but you and i have been warned.\n Thanks to user derhuerst for bringing this to my attention in `closed Issue 8 <https://github.com/mrcagney/gtfs_kit/issues/8#issue-1063633457>`_.\n",
26
+ 'author': 'Alex Raichev',
27
+ 'author_email': 'araichev@mrcagney.com',
28
+ 'maintainer': None,
29
+ 'maintainer_email': None,
30
+ 'url': 'https://github.com/mrcagney/gtfs_kit',
31
+ 'packages': packages,
32
+ 'package_data': package_data,
33
+ 'install_requires': install_requires,
34
+ 'python_requires': '>=3.8,<4',
35
+ }
36
+
37
+
38
+ setup(**setup_kwargs)
gtfs_kit-5.2.1/README.rst DELETED
@@ -1,38 +0,0 @@
1
- GTFS Kit
2
- ********
3
- .. image:: https://travis-ci.com/mrcagney/gtfs_kit.svg?branch=master
4
- :target: https://travis-ci.come/mrcagney/gtfs_kit
5
-
6
- GTFS Kit is a Python 3.8+ library for analyzing `General Transit Feed Specification (GTFS) <https://en.wikipedia.org/wiki/GTFS>`_ data in memory without a database.
7
- It uses Pandas and Shapely to do the heavy lifting.
8
-
9
- This project supersedes `GTFSTK <https://github.com/mrcagney/gtfstk>`_.
10
-
11
-
12
- Installation
13
- =============
14
- ``poetry add gtfs_kit``.
15
-
16
-
17
- Examples
18
- ========
19
- You can find examples in the Jupyter notebook ``notebooks/examples.ipynb``.
20
-
21
-
22
- Authors
23
- =========
24
- - Alex Raichev, 2019-09
25
-
26
-
27
- Documentation
28
- =============
29
- Documentation is built via Sphinx from the source code in the `docs` directory then published to Github Pages at `mrcagney.github.io/gtfs_kit_docs <https://mrcagney.github.io/gtfs_kit_docs>`_.
30
-
31
-
32
- Notes
33
- =====
34
- - Development status is Alpha. I use this project for work and change it breakingly to suit my needs.
35
- - This project uses semantic versioning.
36
- - Thanks to `MRCagney <http://www.mrcagney.com/>`_ for donating to this project.
37
- - Constructive feedback and contributions are welcome. Please issue pull requests from a feature branch into the ``develop`` branch and include tests.
38
- - GTFS time is measured relative noon minus 12 hours, which can mess things up when crossing into daylight savings time. I don't think this issue causes any bugs in GTFS Kit, but you and i have been warned. Thanks to derhuerst for bringing this to my attention in `closed Issue 8 <https://github.com/mrcagney/gtfs_kit/issues/8#issue-1063633457>`_.
gtfs_kit-5.2.1/setup.py DELETED
@@ -1,38 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from setuptools import setup
3
-
4
- packages = \
5
- ['gtfs_kit']
6
-
7
- package_data = \
8
- {'': ['*']}
9
-
10
- install_requires = \
11
- ['folium>=0',
12
- 'geopandas>=0',
13
- 'json2html>=1',
14
- 'pandas>=1',
15
- 'pycountry>=19',
16
- 'requests>=2',
17
- 'rtree>=0',
18
- 'shapely>=1',
19
- 'utm>=0']
20
-
21
- setup_kwargs = {
22
- 'name': 'gtfs-kit',
23
- 'version': '5.2.1',
24
- 'description': 'A Python 3.8+ library for analyzing GTFS feeds.',
25
- 'long_description': "GTFS Kit\n********\n.. image:: https://travis-ci.com/mrcagney/gtfs_kit.svg?branch=master\n :target: https://travis-ci.come/mrcagney/gtfs_kit\n\nGTFS Kit is a Python 3.8+ library for analyzing `General Transit Feed Specification (GTFS) <https://en.wikipedia.org/wiki/GTFS>`_ data in memory without a database.\nIt uses Pandas and Shapely to do the heavy lifting.\n\nThis project supersedes `GTFSTK <https://github.com/mrcagney/gtfstk>`_.\n\n\nInstallation\n=============\n``poetry add gtfs_kit``.\n\n\nExamples\n========\nYou can find examples in the Jupyter notebook ``notebooks/examples.ipynb``.\n\n\nAuthors\n=========\n- Alex Raichev, 2019-09\n\n\nDocumentation\n=============\nDocumentation is built via Sphinx from the source code in the `docs` directory then published to Github Pages at `mrcagney.github.io/gtfs_kit_docs <https://mrcagney.github.io/gtfs_kit_docs>`_.\n\n\nNotes\n=====\n- Development status is Alpha. I use this project for work and change it breakingly to suit my needs.\n- This project uses semantic versioning.\n- Thanks to `MRCagney <http://www.mrcagney.com/>`_ for donating to this project.\n- Constructive feedback and contributions are welcome. Please issue pull requests from a feature branch into the ``develop`` branch and include tests.\n- GTFS time is measured relative noon minus 12 hours, which can mess things up when crossing into daylight savings time. I don't think this issue causes any bugs in GTFS Kit, but you and i have been warned. Thanks to derhuerst for bringing this to my attention in `closed Issue 8 <https://github.com/mrcagney/gtfs_kit/issues/8#issue-1063633457>`_.\n",
26
- 'author': 'Alex Raichev',
27
- 'author_email': 'araichev@mrcagney.com',
28
- 'maintainer': None,
29
- 'maintainer_email': None,
30
- 'url': 'https://github.com/mrcagney/gtfs_kit',
31
- 'packages': packages,
32
- 'package_data': package_data,
33
- 'install_requires': install_requires,
34
- 'python_requires': '>=3.8,<4',
35
- }
36
-
37
-
38
- setup(**setup_kwargs)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes