Skip to content

Commit

Permalink
Merge pull request #421 from geopy/v2/osm-to-nominatim
Browse files Browse the repository at this point in the history
geopy 2.0: rename `osm` module to `nominatim`
  • Loading branch information
KostyaEsmukov committed Jun 27, 2020
2 parents 0d83574 + c264a08 commit 54c30bb
Show file tree
Hide file tree
Showing 8 changed files with 413 additions and 386 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ A checklist for adding a new geocoder:
`geopy/geocoders` package. Please look around to make sure that you're
not reimplementing something that's already there! For example, if you're
adding a Nominatim-based service, then your new geocoder class should
probably extend the `geopy.geocoders.osm.Nominatim` class.
probably extend the `geopy.geocoders.Nominatim` class.

2. Follow the instructions in the `geopy/geocoders/__init__.py` module for
adding the required imports.
Expand Down
15 changes: 11 additions & 4 deletions docs/changelog_2xx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you have checked your code on the latest 1.x release with enabled
warnings (i.e. with ``-Wd`` key of the ``python`` command) and fixed
all of them, then it should be safe to upgrade.

New features
New Features
~~~~~~~~~~~~

- :mod:`geopy.adapters` module. Previously all geocoders used :mod:`urllib`
Expand All @@ -41,7 +41,7 @@ New features
- :class:`.AsyncRateLimiter` -- an async counterpart of :class:`.RateLimiter`.
- :class:`.RateLimiter` is now thread-safe.

Packaging changes
Packaging Changes
~~~~~~~~~~~~~~~~~

- Dropped support for Python 2.7 and 3.4.
Expand All @@ -50,8 +50,8 @@ Packaging changes
+ ``geopy[requests]`` for :class:`geopy.adapters.RequestsAdapter`.
+ ``geopy[aiohttp]`` for :class:`geopy.adapters.AioHTTPAdapter`.

Chores
~~~~~~
Breaking Changes
~~~~~~~~~~~~~~~~

- ``geopy.distance`` algorithms now raise ``ValueError`` for points with
different altitudes, because :ref:`altitude is ignored in calculations
Expand Down Expand Up @@ -87,3 +87,10 @@ Chores
:class:`.GeoNames`, :class:`.OpenMapQuest` and :class:`.Yandex`.
- ``parse_*`` methods in geocoders have been prefixed with ``_``
to explicitly mark that they are private.

Deprecations
~~~~~~~~~~~~

- :class:`.Nominatim` has been moved from ``geopy.geocoders.osm`` module
to ``geopy.geocoders.nominatim``. The old module is still present for
backwards compatibility, but it will be removed in geopy 3.
8 changes: 4 additions & 4 deletions geopy/geocoders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@
"MapBox",
"MapQuest",
"MapTiler",
"Nominatim",
"OpenCage",
"OpenMapQuest",
"PickPoint",
"Nominatim",
"Pelias",
"Photon",
"LiveAddress",
Expand Down Expand Up @@ -236,9 +236,9 @@
from geopy.geocoders.mapbox import MapBox
from geopy.geocoders.mapquest import MapQuest
from geopy.geocoders.maptiler import MapTiler
from geopy.geocoders.nominatim import Nominatim
from geopy.geocoders.opencage import OpenCage
from geopy.geocoders.openmapquest import OpenMapQuest
from geopy.geocoders.osm import Nominatim
from geopy.geocoders.pelias import Pelias
from geopy.geocoders.photon import Photon
from geopy.geocoders.pickpoint import PickPoint
Expand Down Expand Up @@ -267,10 +267,10 @@
"mapbox": MapBox,
"mapquest": MapQuest,
"maptiler": MapTiler,
"nominatim": Nominatim,
"opencage": OpenCage,
"openmapquest": OpenMapQuest,
"pickpoint": PickPoint,
"nominatim": Nominatim,
"pelias": Pelias,
"photon": Photon,
"liveaddress": LiveAddress,
Expand All @@ -286,7 +286,7 @@ def get_geocoder_for_service(service):
>>> from geopy.geocoders import get_geocoder_for_service
>>> get_geocoder_for_service("nominatim")
geopy.geocoders.osm.Nominatim
geopy.geocoders.nominatim.Nominatim
If the string given is not recognized, a
:class:`geopy.exc.GeocoderNotFound` exception is raised.
Expand Down

0 comments on commit 54c30bb

Please sign in to comment.