Skip to content

Commit ca6587d

Browse files
committed
Updates to fix CI testing errors/warnings with 3.13: update list formatting in test_convert.py; update array index for numpy deprecation warnings.
1 parent 6e1b168 commit ca6587d

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Python ${{ matrix.python-version }}
1717
uses: actions/setup-python@v2
1818
with:
19-
python-version: '3.11'
19+
python-version: '3.13'
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip

geodepy/tests/test_convert.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ def test_geo_grid_transform_interoperability(self):
7272
dtype='S4,i4,f8,f8',
7373
names=['site', 'zone', 'east', 'north'])
7474

75-
geoed_grid = np.array(list(grid2geo(*x) for x in test_grid_coords[['zone', 'east', 'north']]))
75+
geoed_grid = np.array([grid2geo(*x) for x in test_grid_coords[['zone', 'east', 'north']]])
7676
np.testing.assert_almost_equal(geoed_grid[:, :2], hp2dec_v(np.array(test_geo_coords[['lat', 'lon']].tolist())),
7777
decimal=8)
7878

79-
gridded_geo = np.stack(geo2grid(*x) for x in hp2dec_v(np.array(test_geo_coords[['lat', 'lon']].tolist())))
79+
gridded_geo = np.stack([geo2grid(*x) for x in hp2dec_v(np.array(test_geo_coords[['lat', 'lon']].tolist()))])
8080
np.testing.assert_almost_equal(gridded_geo[:, 2:4].astype(float),
8181
np.array(test_grid_coords[['east', 'north']].tolist()),
8282
decimal=3)
@@ -93,11 +93,14 @@ def test_geo_grid_transform_interoperability_isg(self):
9393
dtype='S4,i4,f8,f8',
9494
names=['site', 'zone', 'east', 'north'])
9595

96-
geoed_grid = np.array(list(grid2geo(*x, ellipsoid=ans, prj=isg) for x in test_grid_coords[['zone', 'east', 'north']]))
96+
geoed_grid = np.array([grid2geo(*x, ellipsoid=ans, prj=isg)
97+
for x in test_grid_coords[['zone', 'east', 'north']]])
9798
np.testing.assert_almost_equal(geoed_grid[:, :2], np.array(test_geo_coords[['lat', 'lon']].tolist()),
9899
decimal=8)
99100

100-
gridded_geo = np.stack(geo2grid(*x, ellipsoid=ans, prj=isg) for x in np.array(test_geo_coords[['lat', 'lon']].tolist()))
101+
gridded_geo = np.stack([geo2grid(*x, ellipsoid=ans, prj=isg)
102+
for x in np.array(test_geo_coords[['lat', 'lon']].tolist())
103+
])
101104
np.testing.assert_almost_equal(gridded_geo[:, 2:4].astype(float),
102105
np.array(test_grid_coords[['east', 'north']].tolist()),
103106
decimal=3)

geodepy/transform.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def conform7(x, y, z, trans, vcv=None):
5858
# Conformal Transform Eq
5959
xyz_after = translation + scale * rot_xyz
6060
# Convert Vector to Separate Variables
61-
xtrans = float(xyz_after[0])
62-
ytrans = float(xyz_after[1])
63-
ztrans = float(xyz_after[2])
61+
xtrans = float(xyz_after[0][0])
62+
ytrans = float(xyz_after[1][0])
63+
ztrans = float(xyz_after[2][0])
6464

6565
# Transformation uncertainty propagation
6666
# Adapted from Harvey B.R. (1998) Practical least squares and statistics for surveyors,

0 commit comments

Comments
 (0)