Skip to content

Commit

Permalink
Fixed bug with setup that didn't actually install stips
Browse files Browse the repository at this point in the history
  • Loading branch information
york-stsci committed Sep 15, 2021
1 parent 8478e2d commit d4b004a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
13 changes: 9 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,25 @@ github_project = https://github.com/spacetelescope/STScI-STIPS
python_requires = ">=3.8"

[options]
packages = stips
setup_requires =
numpy
install_requires =
astropy
numpy
scipy
photutils
synphot
stsynphot
esutil
webbpsf==0.9.0
esutil@git+https://github.com/esheldon/esutil.git
webbpsf>=0.9.0
pandeia.engine==1.6
montage-wrapper
pyyaml
jwst_backgrounds
zip_safe = False
use_2to3 = False
include_package_data = True

[options.package_data]
* = *.c
Expand All @@ -44,8 +49,8 @@ build-dir = docs/_build
all_files = 1

[upload_docs]
upload-dir = docs/_build/html
show-response = 1
upload_dir = docs/_build/html
show_response = 1

[tool:pytest]
minversion = 3.0
Expand Down
9 changes: 8 additions & 1 deletion stips/astro_image/astro_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,13 @@ def addSersics(self, ids, xs, ys, fluxes, ns, res, phis, ratios, *args, **kwargs
if sersic_model == "astropy":
sersic_fn = self.astropySersic
elif sersic_model == "galsim":
sersic_fn = self.galsimSersic
try:
import galsim
sersic_fn = self.galsimSersic
except ModuleNotFoundError:
self._log("error", "Unable to import galsim. Falling back to astropy.")
sersic_fn = self.astropySersic
self.overrides['sersic_model'] = 'astropy'
else:
msg = "Tried to set unknown Sersic modeller {}. Falling back to astropy."
self._log("warning", msg.format(sersic_model))
Expand Down Expand Up @@ -1054,6 +1060,7 @@ def make_psf(self):
self._log("info", "PSF File is {}".format(psf_file))
if os.path.exists(psf_file):
self.psf = PSFGrid.create_from_fits(psf_file)
have_psf = True

if not have_psf:
fov_pixels = SelectParameter('psf_fov_pixels', self.overrides)
Expand Down
5 changes: 4 additions & 1 deletion stips/instruments/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ def __init__(self, **kwargs):
stream_handler.setFormatter(logging.Formatter(format))
self.logger.addHandler(stream_handler)

self.overrides = makeOverrideDict(kwargs)
if 'overrides' in kwargs:
self.overrides = makeOverrideDict(kwargs['overrides'])
else:
self.overrides = makeOverrideDict(kwargs)
self.out_path = SelectParameter('out_path', kwargs)
self.prefix = kwargs.get('prefix', '')
self.cat_type = SelectParameter('cat_type', kwargs)
Expand Down

0 comments on commit d4b004a

Please sign in to comment.