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: 'str' object has no attribute 'sources' #116

Open
Kincaidr opened this issue Apr 24, 2022 · 4 comments
Open

AttributeError: 'str' object has no attribute 'sources' #116

Kincaidr opened this issue Apr 24, 2022 · 4 comments

Comments

@Kincaidr
Copy link

Hi,

I'm trying to simulate a simple sky pattern into an empty MS using the turbo sim script and I get:


ImportError: cannot import name _docutil
Error loading support for format 'PyBDSMGaul', see above. Format will not be available.
Loading tree_def.lsm.html: Tigger sky model
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/Timba/TDL/Compile.py", line 225, in run_forest_definition
    define_func(ns,**args);
  File "/usr/lib/python2.7/dist-packages/Cattery/Siamese/turbo-sim.py", line 196, in _define_forest
    output = meqmaker.make_predict_tree(ns,uvdata=model_spigots);
  File "/usr/lib/python2.7/dist-packages/Cattery/Meow/TensorMeqMaker.py", line 163, in make_predict_tree
    all_sources = sources if sources is not None else self.get_source_list(ns);
  File "/usr/lib/python2.7/dist-packages/Cattery/Meow/MeqMaker.py", line 539, in get_source_list
    self._source_list += mod.source_list(ns);
  File "/usr/lib/python2.7/dist-packages/Tigger/SiameseInterface.py", line 139, in source_list
    sources = sorted(self.lsm.sources, lambda a, b: cmp(b.brightness(), a.brightness()))
AttributeError: 'str' object has no attribute 'sources'

The Tigger LSM skymodel looks like this:

image

It however does work when I use the example-sim.py for the simulation.

@o-smirnov
Copy link
Contributor

Odd, the code is here, and I can't see how self.lsm can ever be a string: https://github.com/ratt-ru/tigger-lsm/blob/master/Tigger/SiameseInterface.py#L147

Could you please add a print(self.lsm) statement just before to see what's up?

Also, I notice you're using python2.7 -- not sure it's even supported anymore, would you try a python3 virtualenv instead?

@bennahugo
Copy link
Contributor

I have released a backport version of tigger-lsm for python 2.7 a while back. You should try upgrading to that. Unfortunately the 2.7 series is sunset.

If that does not work please follow the updated build instructions in https://github.com/ratt-ru/meqtrees/wiki/BuildFromSource
If you have python3-qt4 installed (only available on Ubuntu 18.04) it should work, otherwise you will need to install the headless pipeliner.

@bennahugo
Copy link
Contributor

tigger-lsm 1.7.0 is the last 2.7 release referred to above

@Kincaidr
Copy link
Author

Odd, the code is here, and I can't see how self.lsm can ever be a string: https://github.com/ratt-ru/tigger-lsm/blob/master/Tigger/SiameseInterface.py#L147

Could you please add a print(self.lsm) statement just before to see what's up?

Also, I notice you're using python2.7 -- not sure it's even supported anymore, would you try a python3 virtualenv instead?

I am actually running through the meqbrowser on the like server and so cannot edit that script. I have however tried on crosby and it works, both are using python 2.7 so I don't think its that.

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

3 participants