Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hover2pi committed Feb 10, 2022
2 parents fb0189b + a82d494 commit 9e46e65
Show file tree
Hide file tree
Showing 16 changed files with 221 additions and 217 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ This file tracks all major changes in each `exoctk` release.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.3] - 2022-02-01

### Fixed

- Date format in hover tool of contam visibility plots
- Logging issue with production server.

### Changed

- Removed support for "uniform" (constant) limb-darkening law.
- Removed lmfit from requirements.

## [1.2.2] - 2021-07-09

### Added
Expand Down
24 changes: 12 additions & 12 deletions env/environment-3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ channels:
- http://ssb.stsci.edu/astroconda
dependencies:
- astropy<4.1
- bokeh=2.3.3
- bokeh=2.4.2
- boto3
- cython=0.29.24
- docopt=0.6.2
- docutils=0.16
- docutils=0.17.1
- flake8=3.9.0
- flask=1.1.2
- gunicorn=20.1.0
- h5py=3.2.1
- ipython=7.26.0
- h5py=3.6.0
- ipython=7.29.0
- jupyter=1.0.0
- matplotlib=3.1.3
- numpy=1.19.2
Expand All @@ -25,26 +25,26 @@ dependencies:
- python=3.7.1
- pyyaml
- scipy=1.6.2
- scp=0.13.6
- sphinx=4.0.2
- sqlalchemy=1.4.22
- scp=0.14.1
- sphinx=4.2.0
- sqlalchemy=1.4.27
- twine=3.4.1
- wtforms=2.3.3
- pip:
- asteval==0.9.25
- awscli
- bandit==1.7.0
- bandit==1.7.1
- batman-package==2.4.8
- bibtexparser==1.2.0
- corner==2.2.1
- ddtrace==0.52.1
- flask_wtf==0.14.3
- ddtrace==0.57.0
- flask_wtf==1.0.0
- lmfit==1.0.1
- platon==4.0
- pysiaf==0.10.0
- pysynphot==1.0.0
- pysynphot==2.0.0
- PyYAML>=5.4
- sphinx_astropy==1.5
- sphinx_astropy==1.6.0
- svo-filters==0.4.1
- werkzeug>=2.0
- git+https://github.com/spacetelescope/jwst_gtvt.git@cd6bc76f66f478eafbcc71834d3e735c73e03ed5
Expand Down
22 changes: 11 additions & 11 deletions env/environment-3.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ dependencies:
- boto3
- cython=0.29.24
- docopt=0.6.2
- docutils=0.16
- docutils=0.17.1
- flake8=3.9.0
- flask=1.1.2
- gunicorn=20.1.0
- h5py=3.2.1
- ipython=7.26.0
- h5py=3.6.0
- ipython=7.29.0
- jupyter=1.0.0
- matplotlib=3.3.4
- numpy=1.19.2
Expand All @@ -25,25 +25,25 @@ dependencies:
- python=3.8.5
- pyyaml
- scipy=1.6.2
- scp=0.13.6
- sphinx=4.0.2
- sqlalchemy=1.4.22
- scp=0.14.1
- sphinx=4.2.0
- sqlalchemy=1.4.27
- twine=3.2.0
- wtforms=2.3.3
- pip:
- asteval==0.9.25
- awscli
- bandit==1.7.0
- bandit==1.7.1
- batman-package==2.4.8
- bibtexparser==1.2.0
- corner==2.2.1
- ddtrace==0.52.1
- flask_wtf==0.14.3
- ddtrace==0.57.0
- flask_wtf==1.0.0
- lmfit==1.0.2
- platon==4.0
- pysiaf==0.10.0
- pysynphot==1.0.0
- sphinx_astropy==1.5
- pysynphot==2.0.0
- sphinx_astropy==1.6.0
- svo-filters==0.4.1
- werkzeug>=2.0
- git+https://github.com/spacetelescope/jwst_gtvt.git@cd6bc76f66f478eafbcc71834d3e735c73e03ed5
Expand Down
25 changes: 12 additions & 13 deletions env/environment-3.9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies:
- docopt=0.6.2
- flake8=3.9.0
- flask=1.1.2
- h5py=2.10.0
- ipython=7.26.0
- h5py=3.6.0
- ipython=7.29.0
- jupyter=1.0.0
- matplotlib=3.3.4
- numpy=1.19.2
Expand All @@ -23,27 +23,26 @@ dependencies:
- python=3.9.1
- pyyaml
- scipy=1.6.2
- scp=0.13.6
- sphinx=4.0.2
- sqlalchemy=1.4.22
- scp=0.14.1
- sphinx=4.2.0
- sqlalchemy=1.4.27
- twine=3.2.0
- wtforms=2.3.3
- pip:
- asteval==0.9.25
- awscli
- bandit==1.7.0
- bandit==1.7.1
- batman-package==2.4.8
- bibtexparser==1.2.0
- corner==2.2.1
- ddtrace==0.52.1
- docutils==0.15.2
- flask_wtf==0.14.3
- ddtrace==0.57.0
- docutils==0.17.1
- flask_wtf==1.0.0
- gunicorn==20.0.4
- lmfit==1.0.2
- platon==4.0
- platon==5.3
- pysiaf==0.10.0
- pysynphot==1.0.0
- sphinx_astropy==1.5
- pysynphot==2.0.0
- sphinx_astropy==1.6.0
- svo-filters==0.4.1
- werkzeug>=2.0
- git+https://github.com/spacetelescope/jwst_gtvt.git@cd6bc76f66f478eafbcc71834d3e735c73e03ed5
Expand Down
13 changes: 5 additions & 8 deletions exoctk/contam_visibility/visibilityPA.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,6 @@ def using_gtvt(
panom=paNom,
pamax=paMax,
date=gd))
TOOLTIPS = [('Date', '@date{%F}'),
('Maximum Aperture PA', '@pamax'),
('Nominal Aperture PA', '@panom'),
('Minimum Aperture PA', '@pamin')]

# Time to plot
if output == 'bokeh':
Expand Down Expand Up @@ -334,10 +330,11 @@ def using_gtvt(
fig.circle('date', 'pamax', color=COLOR, size=1, source=SOURCE)

# Adding HoverTool
fig.add_tools(HoverTool(renderers=[nom],
tooltips=TOOLTIPS,
formatters={'date': 'datetime'},
mode='vline'))
fig.add_tools(HoverTool(tooltips=[('Date', '@date{%F}'),
('Maximum Aperture PA', '@pamax'),
('Nominal Aperture PA', '@panom'),
('Minimum Aperture PA', '@pamin')],
formatters={'@date': 'datetime'}))

# Plot formatting
fig.xaxis.axis_label = 'Date'
Expand Down
12 changes: 7 additions & 5 deletions exoctk/exoctk_app/app_exoctk.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@

# Load the database to log all form submissions
if get_env_variables()['exoctklog_dir'] is None:
dbpath = ':memory:'
DBPATH = ':memory:'
else:
dbpath = os.path.realpath(os.path.join(get_env_variables()['exoctklog_dir'], 'exoctk_log.db'))
if not os.path.isfile(dbpath):
log_exoctk.create_db(dbpath)
DBPATH = os.path.realpath(os.path.join(get_env_variables()['exoctklog_dir'], 'exoctk_log.db'))
if not os.path.isfile(DBPATH):
log_exoctk.create_db(DBPATH)
try:
DB = log_exoctk.load_db(dbpath)
DB = log_exoctk.load_db(DBPATH)
except IOError:
DB = None

Expand Down Expand Up @@ -888,6 +888,8 @@ def secret_page():
``flask.render_template`` obj
The rendered template for the admin page.
"""
# Reload the DB when this page loads so the data is current
DB = log_exoctk.load_db(DBPATH)

tables = [i[0] for i in DB.execute("SELECT name FROM sqlite_master WHERE type='table'").fetchall()]

Expand Down
2 changes: 1 addition & 1 deletion exoctk/exoctk_app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<div style="float:right; width:120px;text-align:center;">
<p>
Running<br>
<a href='https://github.com/ExoCTK/exoctk/releases/tag/v1.2.2'>exoctk v1.2.2</a>{{version|safe}}
<a href='https://github.com/ExoCTK/exoctk/releases/tag/v1.2.3'>exoctk v1.2.3</a>{{version|safe}}
</p>
<p style='font-size:0.8em'>
<a href='admin' style='color:#aaaaaa;'>Admin Area</a>
Expand Down
2 changes: 1 addition & 1 deletion exoctk/lightcurve_fitting/fitters.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import copy

import lmfit
# import lmfit
import numpy as np

from .parameters import Parameters
Expand Down
13 changes: 4 additions & 9 deletions exoctk/limb_darkening/limb_darkening_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def ld_profile(name='quadratic', latex=False):
----------
name: str
The name of the limb darkening profile function to use,
including 'uniform', 'linear', 'quadratic', 'square-root',
including 'linear', 'quadratic', 'square-root',
'logarithmic', 'exponential', '3-parameter', and '4-parameter'
latex: bool
Return the function as a LaTeX formatted string
Expand All @@ -56,16 +56,11 @@ def ld_profile(name='quadratic', latex=False):
"""
# Supported profiles a la BATMAN
names = ['uniform', 'linear', 'quadratic', 'square-root', 'logarithmic', 'exponential', '3-parameter', '4-parameter']
names = ['linear', 'quadratic', 'square-root', 'logarithmic', 'exponential', '3-parameter', '4-parameter']

# Check that the profile is supported
if name in names:

# Uniform
if name == 'uniform':
def profile(m, c1):
return c1

# Linear
if name == 'linear':
def profile(m, c1):
Expand Down Expand Up @@ -155,7 +150,7 @@ def __init__(self, model_grid='ACES'):
dtypes = ['|S20', float, float, float, '|S20', '|S20', '|S20', object, object, object, np.float16, np.float16, np.float16, object, object, np.float16, object, object, np.float16, object, object, object, '|S20']
self.results = at.Table(names=columns, dtype=dtypes)

self.ld_color = {'quadratic': 'blue', '4-parameter': 'red', 'exponential': 'green', 'linear': 'orange', 'square-root': 'cyan', '3-parameter': 'magenta', 'logarithmic': 'pink', 'uniform': 'purple'}
self.ld_color = {'quadratic': 'blue', '4-parameter': 'red', 'exponential': 'green', 'linear': 'orange', 'square-root': 'cyan', '3-parameter': 'magenta', 'logarithmic': 'pink'}

self.count = 1

Expand Down Expand Up @@ -214,7 +209,7 @@ def calculate(self, Teff, logg, FeH, profile, mu_min=0.05, ld_min=0.01,
The logarithm of the metallicity
profile: str
The name of the limb darkening profile function to use,
including 'uniform', 'linear', 'quadratic', 'square-root',
including 'linear', 'quadratic', 'square-root',
'logarithmic', 'exponential', and '4-parameter'
mu_min: float
The minimum mu value to consider
Expand Down
2 changes: 1 addition & 1 deletion exoctk/log_exoctk.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def create_db(dbpath, overwrite=True):
cur.execute("CREATE TABLE 'groups_integrations' ('id' INTEGER NOT NULL UNIQUE, 'date' TEXT NOT NULL, 'targname' TEXT, 'kmag' REAL, 'mod' TEXT, 'obs_time' REAL, 'n_group' REAL, 'ins' TEXT, 'filt' TEXT, 'filt_ta' TEXT, 'subarray' TEXT, 'subarray_ta' TEXT, 'sat_mode' TEXT, 'sat_max' REAL, PRIMARY KEY(id));")

# Table for limb_darkening
cur.execute("CREATE TABLE 'limb_darkening' ('id' INTEGER NOT NULL UNIQUE, 'date' TEXT NOT NULL, 'n_bins' INTEGER, 'teff' REAL, 'logg' REAL, 'feh' REAL, 'bandpass' TEXT, 'modeldir' TEXT, 'wave_min' REAL, 'mu_min' REAL, 'wave_max' REAL, 'local_files' TEXT, 'pixels_per_bin' INTEGER, 'uniform' TEXT, 'linear' TEXT, 'quadratic' TEXT, 'squareroot' TEXT, 'logarithmic' TEXT, 'exponential' TEXT, 'three_parameter' TEXT, 'four_parameter' TEXT, PRIMARY KEY(id));")
cur.execute("CREATE TABLE 'limb_darkening' ('id' INTEGER NOT NULL UNIQUE, 'date' TEXT NOT NULL, 'n_bins' INTEGER, 'teff' REAL, 'logg' REAL, 'feh' REAL, 'bandpass' TEXT, 'modeldir' TEXT, 'wave_min' REAL, 'mu_min' REAL, 'wave_max' REAL, 'local_files' TEXT, 'pixels_per_bin' INTEGER, 'linear' TEXT, 'quadratic' TEXT, 'squareroot' TEXT, 'logarithmic' TEXT, 'exponential' TEXT, 'three_parameter' TEXT, 'four_parameter' TEXT, PRIMARY KEY(id));")

# Table for contam_visibility
cur.execute("CREATE TABLE 'contam_visibility' ('id' INTEGER NOT NULL UNIQUE, 'date' TEXT NOT NULL, 'targname' TEXT, 'ra' REAL, 'dec' REAL, 'inst' TEXT, 'companion' TEXT, PRIMARY KEY(id));")
Expand Down
11 changes: 7 additions & 4 deletions exoctk/tests/test_atmospheric_retrievals.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
from platon.constants import R_sun, R_jup, M_jup
import pytest

from ..atmospheric_retrievals.aws_tools import get_config
from ..atmospheric_retrievals.platon_wrapper import _apply_factors
from ..atmospheric_retrievals.platon_wrapper import PlatonWrapper

ON_GITHUB_ACTIONS = os.path.expanduser('~') in ['/home/runner', '/Users/runner']


Expand All @@ -42,6 +38,8 @@ def initialize_platon_wrapper_object():
The ``PlatonWrapper`` object
"""

from ..atmospheric_retrievals.platon_wrapper import PlatonWrapper

# Define the fit parameters
params = {
'Rs': 1.19, # Required
Expand Down Expand Up @@ -79,11 +77,14 @@ def initialize_platon_wrapper_object():
return pw


@pytest.mark.skipif(ON_GITHUB_ACTIONS, reason='Test takes too long on Travis server. Try testing locally.')
def test_apply_factors():
"""Test the ``_apply_factors()`` function in ``platon_wrapper``
module.
"""

from ..atmospheric_retrievals.platon_wrapper import _apply_factors

params = {'Rs': 1.19, 'Mp': 0.73, 'Rp': 1.4}
params = _apply_factors(params)

Expand All @@ -93,9 +94,11 @@ def test_apply_factors():
assert params['Rp'] == 100088800.0


@pytest.mark.skipif(ON_GITHUB_ACTIONS, reason='Test takes too long on Travis server. Try testing locally.')
def test_get_config():
"""Tests the ``get_config`` function in ``aws_tools`` module."""

from ..atmospheric_retrievals.aws_tools import get_config
settings = get_config()

assert isinstance(settings, dict)
Expand Down
Loading

0 comments on commit 9e46e65

Please sign in to comment.