From 8155867113bf3635494285f59d8587fe794b7756 Mon Sep 17 00:00:00 2001 From: Simon Perkins Date: Tue, 30 Jan 2024 16:30:02 +0200 Subject: [PATCH] Add prefer_literal=True to @overloads in the Perley Polyhedron gridder --- .../policies/baseline_transform_policies.py | 2 +- .../perleypolyhedron/policies/convolution_policies.py | 2 +- .../perleypolyhedron/policies/phase_transform_policies.py | 2 +- .../perleypolyhedron/policies/stokes_conversion_policies.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/africanus/gridding/perleypolyhedron/policies/baseline_transform_policies.py b/africanus/gridding/perleypolyhedron/policies/baseline_transform_policies.py index 0ea9d1642..57f17c8be 100644 --- a/africanus/gridding/perleypolyhedron/policies/baseline_transform_policies.py +++ b/africanus/gridding/perleypolyhedron/policies/baseline_transform_policies.py @@ -83,7 +83,7 @@ def policy(uvw, ra0, dec0, ra, dec, policy_type): pass -@overload(policy, inline="always") +@overload(policy, inline="always", prefer_literal=True) def policy_impl(uvw, ra0, dec0, ra, dec, policy_type): if policy_type.literal_value == "None": return uvw_norotate diff --git a/africanus/gridding/perleypolyhedron/policies/convolution_policies.py b/africanus/gridding/perleypolyhedron/policies/convolution_policies.py index 2093be11c..4a1152640 100644 --- a/africanus/gridding/perleypolyhedron/policies/convolution_policies.py +++ b/africanus/gridding/perleypolyhedron/policies/convolution_policies.py @@ -349,7 +349,7 @@ def policy( pass -@overload(policy, inline="always") +@overload(policy, inline="always", prefer_literal=True) def policy_impl( scaled_u, scaled_v, diff --git a/africanus/gridding/perleypolyhedron/policies/phase_transform_policies.py b/africanus/gridding/perleypolyhedron/policies/phase_transform_policies.py index b42e490d1..1b6ab6175 100644 --- a/africanus/gridding/perleypolyhedron/policies/phase_transform_policies.py +++ b/africanus/gridding/perleypolyhedron/policies/phase_transform_policies.py @@ -38,7 +38,7 @@ def policy(vis, uvw, lambdas, ra0, dec0, ra, dec, policy_type, phasesign=1.0): pass -@overload(policy, inline="always") +@overload(policy, inline="always", prefer_literal=True) def policy_impl(vis, uvw, lambdas, ra0, dec0, ra, dec, policy_type, phasesign=1.0): if policy_type.literal_value == "None" or policy_type.literal_value is None: return phase_norotate diff --git a/africanus/gridding/perleypolyhedron/policies/stokes_conversion_policies.py b/africanus/gridding/perleypolyhedron/policies/stokes_conversion_policies.py index 873fd744d..c1e9d94c9 100644 --- a/africanus/gridding/perleypolyhedron/policies/stokes_conversion_policies.py +++ b/africanus/gridding/perleypolyhedron/policies/stokes_conversion_policies.py @@ -5,7 +5,7 @@ def stokes2corr(vis_in, vis_out, policy_type): pass -@overload(stokes2corr, inline="always") +@overload(stokes2corr, inline="always", prefer_literal=True) def stokes2corrimpl(vis_in, vis_out, policy_type): if policy_type.literal_value == "XXYY_FROM_I": @@ -143,7 +143,7 @@ def corr2stokes(vis_in, policy_type): pass -@overload(corr2stokes, inline="always") +@overload(corr2stokes, inline="always", prefer_literal=True) def corr2stokesimpl(vis_in, policy_type): if policy_type.literal_value == "I_FROM_XXYY": return lambda vis_in, policy_type: (vis_in[0] + vis_in[1]) * 0.5 @@ -183,7 +183,7 @@ def ncorr_out(policy_type): pass -@overload(ncorr_out, inline="always") +@overload(ncorr_out, inline="always", prefer_literal=True) def ncorr_outimpl(policy_type): if policy_type.literal_value == "XXYY_FROM_I": return lambda policy_type: 2