Skip to content

Commit

Permalink
Merge pull request #361 from bmorris3/fix-deprecation-warnings
Browse files Browse the repository at this point in the history
Fix deprecation warnings from importlib and numpy
  • Loading branch information
mfixstsci authored Nov 27, 2024
2 parents f2cd70e + 0e32388 commit 0834e98
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pysiaf/iando/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,8 @@ def read_roman_siaf(siaf_file=None):
from pysiaf import specpars

if not siaf_file:
with importlib_resources.path('pysiaf.prd_data.Roman',
'roman_siaf.xml') as siaf_file:
source = importlib_resources.files('pysiaf.prd_data.Roman').joinpath('roman_siaf.xml')
with importlib_resources.as_file(source) as siaf_file:
siaf_file = str(siaf_file)
else:
siaf_file = str(siaf_file)
Expand Down
4 changes: 2 additions & 2 deletions pysiaf/tests/test_polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def makeup_polynomial(order = 5):
a = np.zeros(terms)

np.random.seed(seed=1)
a[1] = 0.05 + 0.01 * np.random.rand(1)
a[1] = 0.05 + 0.01 * np.random.rand()
np.random.seed(seed=2)
a[2] = 0.0001 * np.random.rand(1)
a[2] = 0.0001 * np.random.rand()
np.random.seed(seed=3)
a[3:6] = 1.0e-7 * np.random.rand(3)
np.random.seed(seed=4)
Expand Down
2 changes: 1 addition & 1 deletion pysiaf/utils/polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def prepend_rotation_to_polynomial(a, theta, verbose=False):
for j in range(m-n-mu, m-mu+1):
factor = (-1)**(m-n-mu) * choose(m-j, mu) * choose(j, m-n-mu)
cosSin = c**(j+2*mu-m+n) * s**(2*m-2*mu-j-n)
atrotate[m, n] = atrotate[m, n] + factor * cosSin * at[m, j]
atrotate[m, n] = np.squeeze(atrotate[m, n] + factor * cosSin * at[m, j])
if verbose:
print(m, n, j, factor, 'cos^', j+2*mu-m+n, 'sin^', 2*m-2*mu-j-n, ' A', m, j)
# Put back in linear layout
Expand Down

0 comments on commit 0834e98

Please sign in to comment.