def test_geodetic_conformal(geodetic_lat, conformal_lat): assert pm.geodetic2conformal(geodetic_lat) == approx(conformal_lat) assert pm.geodetic2conformal(radians(geodetic_lat), deg=False) == approx(radians(conformal_lat)) assert pm.conformal2geodetic(conformal_lat) == approx(geodetic_lat) assert pm.conformal2geodetic(radians(conformal_lat), deg=False) == approx(radians(geodetic_lat))
def test_geodetic_conformal(geodetic_lat, conformal_lat): clat = pm.geodetic2conformal(geodetic_lat) assert clat == approx(conformal_lat) assert isinstance(clat, float) assert pm.geodetic2conformal(radians(geodetic_lat), deg=False) == approx(radians(conformal_lat)) assert pm.conformal2geodetic(conformal_lat) == approx(geodetic_lat) assert pm.conformal2geodetic(radians(conformal_lat), deg=False) == approx(radians(geodetic_lat))
def test_badvals(lat): # geodetic_isometric is not included on purpose with pytest.raises(ValueError): pm.geodetic2geocentric(lat, 0) with pytest.raises(ValueError): pm.geocentric2geodetic(lat, 0) with pytest.raises(ValueError): pm.geodetic2conformal(lat) with pytest.raises(ValueError): pm.conformal2geodetic(lat) with pytest.raises(ValueError): pm.geodetic2rectifying(lat) with pytest.raises(ValueError): pm.rectifying2geodetic(lat) with pytest.raises(ValueError): pm.geodetic2authalic(lat) with pytest.raises(ValueError): pm.authalic2geodetic(lat) with pytest.raises(ValueError): pm.geodetic2parametric(lat) with pytest.raises(ValueError): pm.parametric2geodetic(lat)
def test_numpy_geodetic_conformal(): pytest.importorskip("numpy") assert pm.geodetic2conformal([45, 0]) == approx([44.80768406, 0]) assert pm.conformal2geodetic([44.80768406, 0]) == approx([45, 0])