From 59311f34b00af5a54759441cbbf6f0aad2c4b946 Mon Sep 17 00:00:00 2001 From: Leo Maroni Date: Sat, 1 Aug 2020 00:08:42 +0200 Subject: [PATCH] Prepare release 0.2.0 --- docs/changelog.rst | 10 ++++++++++ docs/conf.py | 2 +- docs/glossary.rst | 3 +++ docs/index.rst | 1 + docs/usage/get_started.rst | 13 +++++++------ pyhafas/client.py | 10 ---------- pyhafas/profile/vsn/requests/__init__.py | 0 setup.py | 2 +- 8 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 docs/changelog.rst create mode 100644 pyhafas/profile/vsn/requests/__init__.py diff --git a/docs/changelog.rst b/docs/changelog.rst new file mode 100644 index 0000000..a5842bb --- /dev/null +++ b/docs/changelog.rst @@ -0,0 +1,10 @@ +Changelog +========= + +.. contents:: + +v0.2.0 +------ +* [BREAKING] Changed return format of :func:`pyhafas.client.HafasClient.arrivals` and :func:`pyhafas.client.HafasClient.departures` methods +* [BREAKING] Removed deprecated parameter `max_journeys` in :func:`pyhafas.client.HafasClient.arrivals` and :func:`pyhafas.client.HafasClient.departures` methods +* [BUG] Fixed :func:`pyhafas.client.HafasClient.journey` request in VSN-Profile diff --git a/docs/conf.py b/docs/conf.py index d0560e8..5bcce78 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,7 +25,7 @@ author = 'n0emis, em0lar' # The full version, including alpha/beta/rc tags -release = '0.1.0' +release = '0.2.0' # -- General configuration --------------------------------------------------- diff --git a/docs/glossary.rst b/docs/glossary.rst index 57eb9cf..97f50cc 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -11,6 +11,9 @@ Glossary Abbreviation for `Friendly Public Transport Format `_ - Used as the basis for returned data + Station Board + Generalization for :func:`arrivals ` and :func:`departures ` requests + product A product is the generalization of all means of transport. When this term is used, all types of transport are meant (e.g. busses, regional trains, ferries). diff --git a/docs/index.rst b/docs/index.rst index e4994bf..09891c1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -44,3 +44,4 @@ Even better than creating an issue is creating a pull request. If you want to do :caption: General glossary + changelog diff --git a/docs/usage/get_started.rst b/docs/usage/get_started.rst index 25b7f5d..ba49ecc 100644 --- a/docs/usage/get_started.rst +++ b/docs/usage/get_started.rst @@ -9,12 +9,13 @@ Most other pyHaFAS-specific words are defined in the :doc:`/glossary`. If one of these words is used in this documentation it's marked as a link with a superscript G as follows: :term:`profile`:superscript:`G` -======= ======= -Term Meaning -======= ======= -profile Customization for each HaFAS deployment - Contains the endpoint, tokens and possible changes for the deployment -FPTF Abbreviation for `Friendly Public Transport Format `_ - Used as the basis for returned data -======= ======= +============= ======= +Term Meaning +============= ======= +profile Customization for each HaFAS deployment - Contains the endpoint, tokens and possible changes for the deployment +FPTF Abbreviation for `Friendly Public Transport Format `_ - Used as the basis for returned data +Station Board Generalization for :func:`arrivals ` and :func:`departures ` requests +============= ======= Installation ------------ diff --git a/pyhafas/client.py b/pyhafas/client.py index 15fa6e5..6db5b1d 100644 --- a/pyhafas/client.py +++ b/pyhafas/client.py @@ -28,7 +28,6 @@ def departures( self, station: Union[Station, str], date: datetime.datetime, - max_journeys: Optional[int] = None, # Deprecated, will be removed in 0.2.0 max_trips: int = -1, duration: int = -1, products: Dict[str, bool] = {}) -> List[StationBoardLeg]: @@ -39,7 +38,6 @@ def departures( :param station: FPTF `Station` object or ID of station :param date: Date and Time when to search - :param max_journeys: (optional, deprecated, will be removed in 0.2.0) Use `max_trips` instead - Maximum number of trips to be returned. Default is "whatever HaFAS wants" :param max_trips: (optional) Maximum number of trips to be returned. Default is "whatever HaFAS wants" :param duration: (optional) Minutes after `date` in which is search is made. Default is "whatever HaFAS wants" :param products: (optional) Dict of product name(s) and whether it should be enabled or not. Modifies the default products specified in the profile. @@ -48,9 +46,6 @@ def departures( if not isinstance(station, Station): station = Station(id=station) - if max_journeys is not None: - max_trips = max_journeys - body = self.profile.format_station_board_request( station, StationBoardRequestType.DEPARTURE, @@ -67,7 +62,6 @@ def arrivals( self, station: Union[Station, str], date: datetime.datetime, - max_journeys: Optional[int] = None, # Deprecated, will be removed in 0.2.0 max_trips: int = -1, duration: int = -1, products: Dict[str, bool] = {}) -> List[StationBoardLeg]: @@ -78,7 +72,6 @@ def arrivals( :param station: FPTF `Station` object or ID of station :param date: Date and Time when to search - :param max_journeys: (optional, deprecated, will be removed in 0.2.0) Use `max_trips` instead - Maximum number of trips to be returned. Default is "whatever HaFAS wants" :param max_trips: (optional) Maximum number of trips to be returned. Default is "whatever HaFAS wants" :param duration: (optional) Minutes after `date` in which is search is made. Default is "whatever HaFAS wants" :param products: (optional) Dict of product name(s) and whether it should be enabled or not. Modifies the default products specified in the profile. @@ -87,9 +80,6 @@ def arrivals( if not isinstance(station, Station): station = Station(id=station) - if max_journeys is not None: - max_trips = max_journeys - body = self.profile.format_station_board_request( station, StationBoardRequestType.ARRIVAL, diff --git a/pyhafas/profile/vsn/requests/__init__.py b/pyhafas/profile/vsn/requests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index 13097c2..3b07166 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ setup( name='pyhafas', - version='0.1.0', + version='0.2.0', description='Python client for HAFAS public transport APIs', long_description=long_description, long_description_content_type="text/markdown",