From 04759966834c30ac2b29843e12a603bc2a50cfea Mon Sep 17 00:00:00 2001 From: Karl Gordon Date: Fri, 15 Nov 2024 10:46:20 -0500 Subject: [PATCH 1/2] updating test tolerance --- dust_extinction/shapes.py | 5 +++-- dust_extinction/tests/test_corvals.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dust_extinction/shapes.py b/dust_extinction/shapes.py index 562999f..e15ce36 100644 --- a/dust_extinction/shapes.py +++ b/dust_extinction/shapes.py @@ -121,8 +121,9 @@ def _curve_F99_method( spline_x = np.concatenate([x_splineval_optir, x_splineval_uv]) spline_y = np.concatenate([y_splineval_optir, y_splineval_uv]) - spline_rep = interpolate.splrep(spline_x, spline_y) - axav[indxs_opir] = interpolate.splev(x[indxs_opir], spline_rep, der=0) + axav[indxs_opir] = interpolate.CubicSpline(spline_x, spline_y, bc_type='natural')(x[indxs_opir]) + #spline_rep = interpolate.splrep(spline_x, spline_y) + #axav[indxs_opir] = interpolate.splev(x[indxs_opir], spline_rep, der=0) # return A(x)/A(V) return axav diff --git a/dust_extinction/tests/test_corvals.py b/dust_extinction/tests/test_corvals.py index 0c29e4b..e11e0e4 100644 --- a/dust_extinction/tests/test_corvals.py +++ b/dust_extinction/tests/test_corvals.py @@ -57,7 +57,7 @@ "Rv": 3.1, "x_values": [0.377, 0.820, 1.667, 1.828, 2.141, 2.433, 3.704, 3.846], "y_values": np.array([0.185, 0.772, 2.688, 3.055, 3.805, 4.315, 6.456, 6.781]) / 3.1, - "atol": 1e-3, + "atol": 4e-3, # from Fitzpatrick (1999) Table 3 # keep optical from Fitzpatrick (1999), # replce NIR with Fitzpatrick (2004) function for Rv=3.1: From 376796ab83c8881498e4fef7919a4fc73e4905de Mon Sep 17 00:00:00 2001 From: Karl Gordon Date: Fri, 15 Nov 2024 10:49:16 -0500 Subject: [PATCH 2/2] fix codestyle --- dust_extinction/shapes.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/dust_extinction/shapes.py b/dust_extinction/shapes.py index e15ce36..35229ce 100644 --- a/dust_extinction/shapes.py +++ b/dust_extinction/shapes.py @@ -122,8 +122,6 @@ def _curve_F99_method( spline_x = np.concatenate([x_splineval_optir, x_splineval_uv]) spline_y = np.concatenate([y_splineval_optir, y_splineval_uv]) axav[indxs_opir] = interpolate.CubicSpline(spline_x, spline_y, bc_type='natural')(x[indxs_opir]) - #spline_rep = interpolate.splrep(spline_x, spline_y) - #axav[indxs_opir] = interpolate.splev(x[indxs_opir], spline_rep, der=0) # return A(x)/A(V) return axav