rodluger / pysyzygy

A fast and general planet transit (syzygy) code written in C and in Python
MIT License
7 stars 5 forks source link

Descriptive error when transit uncompiled, better PEP 8 compliance #1

Closed bmorris3 closed 9 years ago

bmorris3 commented 9 years ago

The first update simply gives users a better error message if they run pysyzygy before transit.f is compiled, like this:

% python -c 'import pysyzygy'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "pysyzygy/__init__.py", line 5, in <module>
    from .main import *
  File "pysyzygy/main.py", line 24, in <module>
    raise ImportError('Failed to import the transit module. Did you compile the '
ImportError: Failed to import the transit module. Did you compile the transit.f file? 
To do so, cd to pysyzygy/pysyzygy and run:

    >>> f2py -c transit.f -m transit

The second update is bigger and scarier and reformats all of the code in main.py to look like the Python gods demand it should. This feat of piety was accomplished with PyCharm's Reformatting Source Code command, and I'm trusting that it did a good job (of course, I've tested that the code still runs).

rodluger commented 9 years ago

Merged your first commit (transit.f compilation error), but keeping the formatting as it is for now, since PyCharm screwed up my comment alignment. I know the 2 spaces may not be orthodox, so I'll address that eventually. Thanks!