Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query_geodetic_crs_from_datum #1390

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jjimenezshaw
Copy link
Contributor

@jjimenezshaw jjimenezshaw commented Mar 31, 2024

Adds new API to PROJ. database.query_geodetic_crs_from_datum

@jjimenezshaw jjimenezshaw force-pushed the query-geodetic-datum branch from dc10ebd to d15793e Compare March 31, 2024 10:24
@jjimenezshaw jjimenezshaw force-pushed the query-geodetic-datum branch from d15793e to 66ceda0 Compare April 4, 2024 21:09
@snowman2
Copy link
Member

I tried to re-produce the error and couldn't with main...snowman2:pyproj:docker .

To debug, I suggest modifying the CI tests to specifically run the test that fails and trying these configurations:

  • set PROJ_DEBUG environment variable to 3
  • add -vv flag to tests
  • Install gdb and run gdb -ex=r --args /venv/bin/python -B -m pytest test/test_database.py

@snowman2
Copy link
Member

Also, it may not hurt to rebase this PR against the latest version.

@jjimenezshaw jjimenezshaw force-pushed the query-geodetic-datum branch 2 times, most recently from e237f2e to 7b5cb5c Compare April 19, 2024 16:18
@jjimenezshaw
Copy link
Contributor Author

Also, it may not hurt to rebase this PR against the latest version.

I did rebase (after some problems), but the tests are not running. Is anything broken in the gh actions?

@snowman2 snowman2 closed this Apr 19, 2024
@snowman2 snowman2 reopened this Apr 19, 2024
@snowman2
Copy link
Member

I see this error:

The workflow is not valid. .github/workflows/tests.yaml (Line: 127, Col: 17): Unexpected value ''

@snowman2
Copy link
Member

snowman2 commented Jul 3, 2024

I was able to re-produce this with PROJ 9.3 (both docker & conda envs) and I did not encounter any errors with PROJ 9.4 on the docker image (#1390 (comment)):

test/test_database.py 
Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x000075ff9a5b3079 in proj_list_get_count () from /lib/x86_64-linux-gnu/libproj.so.25

If logic is added in the function to not allow running in PROJ 9.3, I would be okay with adding this in.

@snowman2 snowman2 force-pushed the main branch 6 times, most recently from 36d5482 to 7da1053 Compare August 8, 2024 13:24
@snowman2 snowman2 force-pushed the query-geodetic-datum branch from e283198 to f86934f Compare March 21, 2025 02:46
@snowman2 snowman2 force-pushed the query-geodetic-datum branch from f86934f to 359918e Compare March 21, 2025 02:50
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.56%. Comparing base (6a38287) to head (359918e).
Report is 25 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1390      +/-   ##
==========================================
+ Coverage   96.50%   96.56%   +0.05%     
==========================================
  Files          20       20              
  Lines        1830     1832       +2     
==========================================
+ Hits         1766     1769       +3     
+ Misses         64       63       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -268,3 +269,50 @@ def test_get_database_metadata():

def test_get_database_metadata__invalid():
assert get_database_metadata("doesnotexist") is None


def test_query_geodetic_crs_from_datum():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytest.mark.parametrize could help simplify this test.

assert len(crss) == 3 # EPSG, ESRI, OGC


def test_query_geodetic_crs_from_datum_invalid():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytest.mark.parametrize could help simplify this test.

crss = query_geodetic_crs_from_datum("foo-bar", "EPSG", "6269", None)
assert len(crss) == 0

with pytest.raises(ValueError):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend creating a separate test where ValueError is raised and use pytest.mark.parametrize to help simplify this test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add proj_query_geodetic_crs_from_datum
2 participants