Skip to content

Commit

Permalink
move the version import in try:
Browse files Browse the repository at this point in the history
  • Loading branch information
robelgeda committed Nov 24, 2019
1 parent e71e233 commit 6e86a1b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions poppy/optics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
from . import utils
from . import conf
from . import accel_math

# We must try/except importing the poppy version because RTD will parse the package without
# installing it (without a version file being created by setup.py).
try:
from .version import version
except ImportError:
version = ''

from .poppy_core import OpticalElement, Wavefront, BaseWavefront, PlaneType, _RADIANStoARCSEC
from .accel_math import _exp, _r, _float, _complex
from . import geometry
Expand Down Expand Up @@ -251,6 +243,10 @@ def to_fits(self, outname=None, what='amplitude', wavelength=1e-6 * u.meter, npi
See the sample() function for additional optional parameters.
"""
try:
from .version import version
except ImportError:
version = ''

kwargs['return_scale'] = True

Expand Down

0 comments on commit 6e86a1b

Please sign in to comment.