Skip to content

Commit

Permalink
update version to 2.2.2; add PROJ version in wheel update in history (#…
Browse files Browse the repository at this point in the history
…370)

* update version to 2.2.2; add PROJ version in wheel update in history

* FutureWarning->DeprecationWarning for +init= syntax
  • Loading branch information
snowman2 authored Jul 11, 2019
1 parent dab6f32 commit c47e3ac
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
1 change: 1 addition & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Change Log

2.2.2
~~~~~
* Update wheels to PROJ 6.1.1
* Add deprecation warning when using +init= syntax (pull #358)
* Added :meth:`~pyproj.crs.is_proj` (pull #359)
* Fixed case in :meth:`~pyproj.crs.CRS.to_dict` with :meth:`~pyproj.crs.CRS.to_proj4` returning None (pull #359)
Expand Down
2 changes: 1 addition & 1 deletion pyproj/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """
__version__ = "2.2.1"
__version__ = "2.2.2"
__all__ = [
"Proj",
"Geod",
Expand Down
2 changes: 1 addition & 1 deletion pyproj/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _prepare_from_string(in_crs_string):
warnings.warn(
"'+init=<authority>:<code>' syntax is deprecated."
" '<authority>:<code>' is the preferred initialization method.",
FutureWarning,
DeprecationWarning,
)
return in_crs_string

Expand Down
24 changes: 12 additions & 12 deletions test/test_crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_from_string():
assert wgs84_crs.to_proj4() == "+proj=longlat +datum=WGS84 +no_defs +type=crs"
# Make sure this doesn't get handled using the from_epsg()
# even though 'epsg' is in the string
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
epsg_init_crs = CRS.from_string("+init=epsg:26911 +units=m +no_defs=True")
assert (
epsg_init_crs.to_proj4()
Expand Down Expand Up @@ -143,7 +143,7 @@ def test_to_proj4():


def test_is_valid():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert CRS(init="EPSG:4326").is_valid


Expand All @@ -157,7 +157,7 @@ def test_empty_json():


def test_has_wkt_property():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert (
CRS({"init": "EPSG:4326"})
.to_wkt("WKT1_GDAL")
Expand All @@ -172,7 +172,7 @@ def test_to_wkt_pretty():


def test_repr():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert repr(CRS({"init": "EPSG:4326"})) == (
"<Geographic 2D CRS: +init=epsg:4326 +type=crs>\n"
"Name: WGS 84\n"
Expand All @@ -189,7 +189,7 @@ def test_repr():


def test_repr__long():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert repr(CRS(CRS({"init": "EPSG:4326"}).to_wkt())) == (
'<Geographic 2D CRS: GEOGCRS["WGS 84",'
'DATUM["World Geodetic System 1984 ...>\n'
Expand Down Expand Up @@ -267,12 +267,12 @@ def test_repr_compound():


def test_dunder_str():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert str(CRS({"init": "EPSG:4326"})) == CRS({"init": "EPSG:4326"}).srs


def test_epsg():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert CRS({"init": "EPSG:4326"}).to_epsg(20) == 4326
assert CRS({"init": "EPSG:4326"}).to_epsg() is None
assert CRS.from_user_input(4326).to_epsg() == 4326
Expand Down Expand Up @@ -322,7 +322,7 @@ def test_epsg__no_code_available():
def test_crs_OSR_equivalence():
crs1 = CRS.from_string("+proj=longlat +datum=WGS84 +no_defs")
crs2 = CRS.from_string("+proj=latlong +datum=WGS84 +no_defs")
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
crs3 = CRS({"init": "EPSG:4326"})
assert crs1 == crs2
# these are not equivalent in proj.4 now as one uses degrees and the othe radians
Expand Down Expand Up @@ -814,14 +814,14 @@ def test_is_exact_same_different_type():
def test_compare_crs_non_crs():
assert CRS.from_epsg(4326) != 4.2
assert CRS.from_epsg(4326) == 4326
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert CRS.from_dict({"init": "epsg:4326"}) == {"init": "epsg:4326"}
assert CRS.from_dict({"init": "epsg:4326"}) != "epsg:4326"
assert CRS("epsg:4326") == CustomCRS()


def test_is_geocentric__bound():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
ccs = CRS("+init=epsg:4328 +towgs84=0,0,0")
assert ccs.is_geocentric

Expand Down Expand Up @@ -849,7 +849,7 @@ def test_is_engineering():


def test_source_crs__bound():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert CRS("+init=epsg:4328 +towgs84=0,0,0").source_crs.name == "unknown"


Expand All @@ -858,7 +858,7 @@ def test_source_crs__missing():


def test_target_crs__bound():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
assert CRS("+init=epsg:4328 +towgs84=0,0,0").target_crs.name == "WGS 84"


Expand Down
2 changes: 1 addition & 1 deletion test/test_datum_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
WGS84_PROJ = Proj(proj="latlong", datum="WGS84")
UTM_33_PROJ = Proj(proj="utm", zone="33")
with warnings.catch_warnings():
warnings.simplefilter("ignore", FutureWarning)
warnings.simplefilter("ignore", DeprecationWarning)
GAUSSSB_PROJ = Proj(
init="epsg:3004", towgs84="-122.74,-34.27,-22.83,-1.884,-3.400,-3.030,-15.62"
)
Expand Down
2 changes: 1 addition & 1 deletion test/test_proj.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class TypeError_Transform_Issue8_Test(unittest.TestCase):
# https://github.com/jswhit/pyproj/issues/8

def setUp(self):
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
self.p = Proj(init="epsg:4269")

def test_tranform_none_1st_parmeter(self):
Expand Down
20 changes: 10 additions & 10 deletions test/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_tranform_wgs84_to_custom():


def test_transform_wgs84_to_alaska():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
lat_lon_proj = pyproj.Proj(init="epsg:4326", preserve_units=False)
alaska_aea_proj = pyproj.Proj(init="epsg:2964", preserve_units=False)
test = (-179.72638, 49.752533)
Expand All @@ -30,7 +30,7 @@ def test_transform_wgs84_to_alaska():

def test_illegal_transformation():
# issue 202
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
p1 = pyproj.Proj(init="epsg:4326")
p2 = pyproj.Proj(init="epsg:3857")
xx, yy = pyproj.transform(
Expand All @@ -46,7 +46,7 @@ def test_illegal_transformation():

def test_lambert_conformal_transform():
# issue 207
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
Midelt = pyproj.Proj(init="epsg:26191")
WGS84 = pyproj.Proj(init="epsg:4326")

Expand Down Expand Up @@ -80,7 +80,7 @@ def test_equivalent_crs__different():


def test_equivalent_proj():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
transformer = Transformer.from_proj(
"+init=epsg:4326", pyproj.Proj(4326).crs.to_proj4(), skip_equivalent=True
)
Expand Down Expand Up @@ -231,35 +231,35 @@ def test_itransform_time_3rd_invalid():


def test_transform_no_error():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
pj = Proj(init="epsg:4555")
pjx, pjy = pj(116.366, 39.867)
transform(pj, Proj(4326), pjx, pjy, radians=True, errcheck=True)


def test_itransform_no_error():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
pj = Proj(init="epsg:4555")
pjx, pjy = pj(116.366, 39.867)
list(itransform(pj, Proj(4326), [(pjx, pjy)], radians=True, errcheck=True))


def test_transform_no_exception():
# issue 249
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
transformer = Transformer.from_proj("+init=epsg:4326", "+init=epsg:27700")
transformer.transform(1.716073972, 52.658007833, errcheck=True)
transformer.itransform([(1.716073972, 52.658007833)], errcheck=True)


def test_transform__out_of_bounds():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
transformer = Transformer.from_proj("+init=epsg:4326", "+init=epsg:27700")
assert np.all(np.isinf(transformer.transform(100000, 100000, errcheck=True)))


def test_transform_radians():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
WGS84 = pyproj.Proj("+init=EPSG:4326")
ECEF = pyproj.Proj(proj="geocent", ellps="WGS84", datum="WGS84")
assert_almost_equal(
Expand All @@ -283,7 +283,7 @@ def test_transform_radians():


def test_itransform_radians():
with pytest.warns(FutureWarning):
with pytest.warns(DeprecationWarning):
WGS84 = pyproj.Proj("+init=EPSG:4326")
ECEF = pyproj.Proj(proj="geocent", ellps="WGS84", datum="WGS84")
assert_almost_equal(
Expand Down

0 comments on commit c47e3ac

Please sign in to comment.