-
Notifications
You must be signed in to change notification settings - Fork 225
Closed
Labels
testTest related issuesTest related issues
Description
Hi, I am trying to compile the pyproj library on Alpine Linux. I filed a few bug fixes with the proj project (and musl libc) that were all fixed enabling the proj library to compile and pass tests on Alpine Linux 32/64b on a number of architectures. I am not having similar luck with pyproj though.
Problem description
Please see the attached build and test log, there are a number of failures:
Failures
=================================== FAILURES ===================================
_______________________________ test_datum[Proj] _______________________________
proj_class = <class 'pyproj.proj.Proj'>, aoi_data_directory = None
@pytest.mark.parametrize("proj_class", [Proj, CRS])
def test_datum(proj_class, aoi_data_directory):
p1 = proj_class(proj="latlong", datum="WGS84")
s_1 = -111.5
s_2 = 45.25919444444
p2 = proj_class(proj="utm", zone=10, datum="NAD27")
x2, y2 = transform(p1, p2, s_1, s_2)
if LooseVersion(proj_version_str) < LooseVersion("6.3.0"):
assert_almost_equal((x2, y2), (1402291.0833290431, 5076289.591846835))
else:
# https://github.com/OSGeo/PROJ/issues/1808
> assert_almost_equal((x2, y2), (1402285.9829252, 5076292.4212746))
E AssertionError:
E Arrays are not almost equal to 7 decimals
E
E Mismatched elements: 2 / 2 (100%)
E Max absolute difference: 4.21450818
E Max relative difference: 1.82410064e-06
E x: array([1402288.540836 , 5076296.6357828])
E y: array([1402285.9829252, 5076292.4212746])
test/test_datum.py:20: AssertionError
_______________________________ test_datum[CRS] ________________________________
proj_class = <class 'pyproj.crs.crs.CRS'>, aoi_data_directory = None
@pytest.mark.parametrize("proj_class", [Proj, CRS])
def test_datum(proj_class, aoi_data_directory):
p1 = proj_class(proj="latlong", datum="WGS84")
s_1 = -111.5
s_2 = 45.25919444444
p2 = proj_class(proj="utm", zone=10, datum="NAD27")
x2, y2 = transform(p1, p2, s_1, s_2)
if LooseVersion(proj_version_str) < LooseVersion("6.3.0"):
assert_almost_equal((x2, y2), (1402291.0833290431, 5076289.591846835))
else:
# https://github.com/OSGeo/PROJ/issues/1808
> assert_almost_equal((x2, y2), (1402285.9829252, 5076292.4212746))
E AssertionError:
E Arrays are not almost equal to 7 decimals
E
E Mismatched elements: 2 / 2 (100%)
E Max absolute difference: 4.21450818
E Max relative difference: 1.82410064e-06
E x: array([1402288.540836 , 5076296.6357828])
E y: array([1402285.9829252, 5076292.4212746])
test/test_datum.py:20: AssertionError
________________________________ test_doctests _________________________________
aoi_data_directory = None
def test_doctests(aoi_data_directory):
"""run the examples in the docstrings using the doctest module"""
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
"You will likely lose important projection information when",
UserWarning,
)
failure_count_proj, test_count = doctest.testmod(pyproj.proj, verbose=True)
failure_count_crs, test_count_crs = doctest.testmod(pyproj.crs, verbose=True)
failure_count_geod, test_count_geod = doctest.testmod(pyproj.geod, verbose=True)
failure_count_transform, test_count_transform = doctest.testmod(
pyproj.transformer, verbose=True
)
failure_count = (
failure_count_proj
+ failure_count_crs
+ failure_count_geod
+ failure_count_transform
)
# Missing shapely wheels for Windows, non x86_64 platforms, and python 3.8
expected_failure_count = 0
try:
import shapely # noqa
except ImportError:
if (
os.name == "nt"
or platform.uname()[4] != "x86_64"
or (sys.version_info.major, sys.version_info.minor) >= (3, 8)
):
expected_failure_count = 6
# if the below line fails, doctests have failed
> assert (
failure_count == expected_failure_count
), "{0} of the doctests in " "lib/pyproj/__init__.py failed".format(failure_count)
E AssertionError: 9 of the doctests in lib/pyproj/__init__.py failed
E assert 9 == 6
test/test_doctest_wrapper.py:50: AssertionError
2 items had failures:
3 of 5 in pyproj.geod.Geod.geometry_area_perimeter
3 of 5 in pyproj.geod.Geod.geometry_length
2 items had failures:
1 of 3 in pyproj.transformer.TransformerGroup.__init__
2 of 19 in pyproj.transformer.transform
FAILED test/test_datum.py::test_datum[Proj] - AssertionError:
FAILED test/test_datum.py::test_datum[CRS] - AssertionError:
FAILED test/test_doctest_wrapper.py::test_doctests - AssertionError: 9 of the...
FAILED test/test_transformer.py::test_transform_wgs84_to_alaska - AssertionEr...
FAILED test/test_transformer.py::test_repr - AssertionError: assert '<Concate...
FAILED test/test_transformer.py::test_transformer_group__unavailable - assert...
FAILED test/test_transformer.py::test_transform_group__missing_best - assert ...
FAILED test/crs/test_crs.py::test_coordinate_operation_grids__alternative_grid_name
Expected Output
All tests passing =)
Environment Information
Shown in build log. Errors also occur on other architectures.
(9/39) Installing python3 (3.8.2-r0)
(17/39) Installing proj-datumgrid (7.0.0-r0)
(20/39) Installing proj (7.0.0-r0)
(21/39) Installing proj-dev (7.0.0-r0)
Installation method
From source
Metadata
Metadata
Assignees
Labels
testTest related issuesTest related issues