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

Fix deprecation warnings from importlib and numpy #361

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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