Skip to content

Update existing modules to astropy - #8

Merged
hamogu merged 4 commits into
python4astronomers:masterfrom
hamogu:toastropy
May 23, 2013
Merged

Update existing modules to astropy#8
hamogu merged 4 commits into
python4astronomers:masterfrom
hamogu:toastropy

Conversation

@hamogu

@hamogu hamogu commented May 15, 2013

Copy link
Copy Markdown
Member

While some of the chapters are timeless and still valid (python, numpy, scipy, matplotlib), some should be rewritten for use with astropy instead of deprecated modules that are now superceeded by astropy (asciitable, pyfits, ...)

@hamogu

hamogu commented May 8, 2013

Copy link
Copy Markdown
Member Author

I have started to go through this (but not pushed to github yet). My goal for now is to do the "minimum possible replacement", i.e. replace import asciitable with from astropy.io import ascii but keep the rest of the text as it is.
If anyone plans updates beyond that, we can do that in a separate pull request.

I have one problem and I would like to hear your opinion before I spend too much time implementing changes.
Most of what atpy does is now in astropy and I suggest that we drop atpy from the tutorial.
However, some things on http://python4astronomers.github.io/files/atpy.html are not possible with astropy.tables yet - so far, there is no registered reader for '.fits.gz'.

The stuff that deals purely with tables is already in @astrofrog 's chapter
http://python4astronomers.github.io/astropy/tables.html

So, I suggest to remove http://python4astronomers.github.io/files/atpy.html .

@taldcroft
@astrofrog

What do you think?

@taldcroft

Copy link
Copy Markdown
Member

I agree we should drop ATpy as the primary package being used to read files. But it is certainly worth keeping a paragraph that describes ATpy, gives a link, and talks about additional functionality like the SQL interface.

Will a .fits.gz extension get recognized as FITS in the current 0.3 dev version? If not we should put an astropy issue.

We should also think about whether it makes sense to migrate some of the ATpy SQL interface to astropy.

@hamogu

hamogu commented May 14, 2013

Copy link
Copy Markdown
Member Author

Maybe we go the other way, keep the atpy chapter for now, but add a big note on the top, noting that astronomy tables are probably better done in astropy.Table for now, but some functionality has not been migrated yet?

@astrofrog What do you think?

@astrofrog

Copy link
Copy Markdown
Member

@taldcroft - I think .fits.gz should work in 0.3 dev, but you might want to double check.

Regarding the SQL stuff, I've been thinking that whatever is in ATpy that we decide not to migrate to Astropy core could end up in an affiliated package, so that there is no duplication, then ATpy itself can be deprecated.

@astrofrog

Copy link
Copy Markdown
Member

@hamogu - well, it's true that the lack of support for FITS tables with Table.read in Astropy 0.2 is kind of a pain... Maybe we can wait until 0.3 to update this?

@hamogu

hamogu commented May 16, 2013

Copy link
Copy Markdown
Member Author

A rendered version of the suggested changes can be seen at
http://hea-www.harvard.edu/~guenther/python4astronomers/html/

Comment thread source/files/asciifiles.rst Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pip install --upgrade ...

@taldcroft

Copy link
Copy Markdown
Member

On a related note you should search / replace ipython -pylab with ipython --pylab.

Comment thread source/files/asciifiles.rst Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best to use the "official" package version of all the readers, i.e. astropy.io.ascii.AASTex instead of astropy.io.ascii.latex.AASTex. Users aren't supposed to know where the AASTex class really comes from.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed that in python4astronomers, but since we link to the auto-doc generated documentation, you will see the place where this object really comes from and not the "lazy user way" to import it., once you click the link, e.g. in http://docs.astropy.org/en/v0.2.1/_generated/astropy.io.ascii.cds.Cds.html#astropy.io.ascii.cds.Cds
the docs say

 class astropy.io.ascii.cds.Cds(readme=None)
 Bases: astropy.io.ascii.core.BaseReader

(In fact, that's where I copied the links).

@taldcroft

Copy link
Copy Markdown
Member

BTW, in answer to previous discussion, I would be in favor of gradually migrating python4astronomers to astropy based on the currently released functionality. So these changes are good, pending the minor comments I had.

@hamogu

hamogu commented May 19, 2013

Copy link
Copy Markdown
Member Author

If there are no more comments, then I will merge this mid-week and also push to the live website.

@hamogu
hamogu merged commit c229271 into python4astronomers:master May 23, 2013
@hamogu
hamogu deleted the toastropy branch May 23, 2013 13:03
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

Successfully merging this pull request may close these issues.

3 participants