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

AttributeError: 'UnicodeType' object has no attribute 'literal_value' #109

Closed
bngcebetsha opened this issue Jun 24, 2024 · 7 comments
Closed

Comments

@bngcebetsha
Copy link

I was running:

 pfb init --ms ../1556467257_sdp_l0.f0.2nd_avg.1k_8s.ms -ipi -1 -cpi 128 -o output --data-column 'CORRECTED_DATA-MODEL_DATA' --weight-column WEIGHT_SPECTRUM -nw 1 --bda-decorr 0.98 -ldir pfb-logs

This ran for almost 2 minutes and then threw this exception:

  File "/home/bngcebetsha/cal_quartical/pfb/pfb-env/lib/python3.10/site-packages/numba/core/types/functions.py", line 308, in get_call_type
    sig = temp.apply(nolitargs, nolitkws)
  File "/home/bngcebetsha/cal_quartical/pfb/pfb-env/lib/python3.10/site-packages/numba/core/typing/templates.py", line 350, in apply
    sig = generic(args, kws)
  File "/home/bngcebetsha/cal_quartical/pfb/pfb-env/lib/python3.10/site-packages/numba/core/typing/templates.py", line 613, in generic
    disp, new_args = self._get_impl(args, kws)
  File "/home/bngcebetsha/cal_quartical/pfb/pfb-env/lib/python3.10/site-packages/numba/core/typing/templates.py", line 712, in _get_impl
    impl, args = self._build_impl(cache_key, args, kws)
  File "/home/bngcebetsha/cal_quartical/pfb/pfb-env/lib/python3.10/site-packages/numba/core/typing/templates.py", line 785, in _build_impl
    ovf_result = self._overload_func(*args, **kws)
  File "/home/bngcebetsha/cal_quartical/pfb/pfb-env/lib/python3.10/site-packages/pfb/utils/weighting.py", line 271, in nb_weight_data_impl
    vis_func, wgt_func = stokes_funcs(data, jones, product, pol, nc)
  File "/home/bngcebetsha/cal_quartical/pfb/pfb-env/lib/python3.10/site-packages/pfb/utils/stokes.py", line 41, in stokes_funcs
    if pol.literal_value == 'linear':
AttributeError: 'UnicodeType' object has no attribute 'literal_value'
@landmanbester
Copy link
Collaborator

Post the output of pip freeze here please

@bngcebetsha
Copy link
Author

bngcebetsha commented Jun 24, 2024

when I print out the value of pol I get: unicode_type.
Output of pip freeze attached
pip_freeze.txt

@landmanbester
Copy link
Collaborator

Ah, I can reproduce. Triggered in numba==0.60. I'll try get a fix in asap. You can downgrade numba to 0.59.1 for a workaround

@bngcebetsha
Copy link
Author

Looks like this issue can be closed too

@landmanbester
Copy link
Collaborator

Please leave it open. Something subtle has changed when using overload with literals. I'm using literally (liberally) but still running into issues with numba==0.60.0. I've pinned numba for the time being, will take a closer look tomorrow

@landmanbester
Copy link
Collaborator

Adding prefer_literal=True to the overload function fixes the problem thanks @sjperkins. I've unpinned numba and will close this once I've merged the latest dev branch

@landmanbester
Copy link
Collaborator

fixed in #111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants