Skip to content

Commit

Permalink
Add prefer_literal=True to @Overloads in the Perley Polyhedron gridder
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Jan 30, 2024
1 parent 21edff5 commit 8155867
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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":

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8155867

Please sign in to comment.