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

hasattr(obj, beam) causes exception #719

Closed
keflavich opened this issue May 28, 2021 · 2 comments
Closed

hasattr(obj, beam) causes exception #719

keflavich opened this issue May 28, 2021 · 2 comments

Comments

@keflavich
Copy link
Contributor

Regression introduced by #700, I believe:

ipdb> hasattr(obj,'beam')
*** spectral_cube.utils.NoBeamError: No beam is defined for this SpectralCube or the beam information could not be parsed from the header. A `~radio_beam.Beam` object can be added using `cube.with_beam`.

This is because you can't access a .beam attribute without raising an exception if it's not defined. But, the object will always have the .beam attribute.

@keflavich
Copy link
Contributor Author

I have a fix in progress

@e-koch
Copy link
Contributor

e-koch commented May 29, 2021

Fixed in #720

@e-koch e-koch closed this as completed May 29, 2021
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