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

in does not work as expected with HDUList #3060

Closed
astrofrog opened this issue Oct 27, 2014 · 4 comments
Closed

in does not work as expected with HDUList #3060

astrofrog opened this issue Oct 27, 2014 · 4 comments

Comments

@astrofrog
Copy link
Member

In the following example:

In [1]: from astropy.io import fits

In [2]: hdulist = fits.HDUList()

In [3]: hdulist.append(fits.ImageHDU(name='a'))

In [4]: hdulist['a']
Out[4]: <astropy.io.fits.hdu.image.PrimaryHDU at 0x102b64e80>

In [5]: 'a' in hdulist
Out[5]: False

I would expect 'a' in hdulist to return True

cc @embray

@embray
Copy link
Member

embray commented Oct 27, 2014

I guess that should work (and should for any of the ways of indexing an HDU, i.e. (name, extver) or (name, extver, extlvl) tuples as well.

@kgullikson88
Copy link
Contributor

I just implemented this in a fork of astropy. I'm not really familiar with github; how do I make a pull request and attach it to this issue?

@astrofrog
Copy link
Member Author

@kgullikson88 - thanks for working on this! You need to push your changes to a branch in your fork, and on github you can go to your fork, change branch, and click on the green button on the left of the branch list to create a pull request. Don't worry about attaching it to this issue, you can just refer to this issue.

@embray
Copy link
Member

embray commented Nov 24, 2014

Fixed--thanks @kgullikson88 !

@embray embray closed this as completed Nov 24, 2014
@embray embray added this to the v0.4.3 milestone Nov 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants