ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
120 stars 77 forks source link

Use Astropy instead of PyFITS and PyWCS #6

Closed astrofrog closed 11 years ago

astrofrog commented 11 years ago

Since Ginga is now listed as an affiliated package for Astropy (http://affiliated.astropy.org/), I think the pyfits/pywcs dependencies should be changed to Astropy.

cc @eteq

eteq commented 11 years ago

That's definitely a good idea - hopefully it will also open other opportunities to make integration with Astropy easier.

ejeschke commented 11 years ago

This is a good suggestion. Look for it in the next few commits.

eteq commented 11 years ago

FYI, @ejeschke , if you don't know about the feature, if you added Closes #6 in a commit message, it will automatically close this issue and make a not that you fixed it in that commit.

cdeil commented 11 years ago

I'm trying to get #10 to work and ran into this issue (i.e. ImportError for pyfits because I only have astropy installed). @ejeschke Can you make the change to astropy? If you don't have time, let me know and I can do it.

ejeschke commented 11 years ago

@cdeil, the change to use AstroPy is coming soon. I plan to try to import from AstroPy first, then "fall back" to individual imports from pyfits and pywcs if AstroPy is not installed.

ejeschke commented 11 years ago

Trying to build AstroPy 0.2.1 I get these errors:

$ python setup.py build Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz Extracting in /tmp/tmpTTp0jH Now working in /tmp/tmpTTp0jH/distribute-0.6.28 Building a Distribute egg in /home/eric/src/astropy-0.2.1 /home/eric/src/astropy-0.2.1/distribute-0.6.28-py2.7.egg /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' warnings.warn(msg) /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe' warnings.warn(msg) /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_2to3' warnings.warn(msg) /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points' warnings.warn(msg) running build running build_py Traceback (most recent call last): File "setup.py", line 128, in entry_points=entry_points File "/usr/lib/python2.7/distutils/core.py", line 152, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command cmd_obj.ensure_finalized() File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized self.finalize_options() File "build/bdist.linux-x86_64/egg/setuptools/command/build_py.py", line 77, in finalize_options AttributeError: Distribution instance has no attribute 'exclude_package_data'

ejeschke commented 11 years ago

python3 build is ok

cdeil commented 11 years ago

I've also seen this error on Ubuntu. Running sudo apt-get install python-pip first resolved the issue for me. @astrofrog @eteq Should we file an issue with astropy for this? I could try to add a travis build to the build matrix that shows this problem.

ejeschke commented 11 years ago

@cdeil, could you check out the latest commit? It works with AstroPy under python3. I don't have a working AstroPy under python2 to test, so I'd like to hear the result before I close this issue.

ejeschke commented 11 years ago

ok, just saw your message about installing pip. Works a charm and I have verified that astropy changes work for me under python 2 and 3 on Ubuntu 12.

cdeil commented 11 years ago

Works for me. Thanks!

ejeschke commented 11 years ago

ok, closing this issue.