Skip to content

Commit 07af671

Browse files
authored
Merge pull request spacetelescope#496 from spacetelescope/v0.22
Release 0.22.0 [master]
2 parents bd89fe6 + 0ee0e0c commit 07af671

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2301
-220
lines changed

CHANGES.rst

+29
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
0.22.0 (2019-08-26)
2+
===================
3+
4+
New Features
5+
------------
6+
7+
Project & API Documentation
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
10+
- Added slides from July 2019 TIPS presentation to ``presentations/`` directory
11+
12+
13+
``jwql`` Repository
14+
~~~~~~~~~~~~~~~~~~~
15+
16+
- Updated dark monitor to support all five JWST instruments, instead of only NIRCam
17+
- Changed the ``jwql-3.5`` and ``jwql-3.6`` conda environments to be more simple and to work on Linux distributions
18+
- Added library code for creating instrument monitoring ``bokeh`` plots with new ``bokeh`` templating software
19+
20+
21+
Bug Fixes
22+
---------
23+
24+
Project & API Documentation
25+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
26+
27+
- Fixed various bugs that were causing the ``sphinx`` API documentation to crash on ReadTheDocs
28+
29+
130
0.21.0 (2019-07-23)
231
===================
332

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ include setup.py
77
recursive-include notebooks *
88
recursive-include style_guide *
99
recursive-include typing_demo *
10+
recursive-include jwql/database/monitor_table_definitions *.txt
1011

1112
exclude *.pyc

codecov.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
codecov:
22
notify:
3-
require_ci_to_pass: yes
3+
require_ci_to_pass: no
44

55
coverage:
66
precision: 2
@@ -27,6 +27,7 @@ comment:
2727

2828
ignore:
2929
- "jwql/database/"
30+
- "jwql/tests/"
3031
- "jwql/instrument_monitors/miri_monitors/data_trending/plots/"
3132
- "jwql/instrument_monitors/nirspec_monitors/data_trending/plots/"
3233
- "*__init__.py*"

docs/source/tests.rst

+15-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,26 @@ test_calculations.py
1414
:members:
1515
:undoc-members:
1616

17+
test_context_processors.py
18+
--------------------------
19+
.. automodule:: jwql.tests.test_context_processors
20+
:members:
21+
:undoc-members:
22+
1723
test_dark_monitor.py
1824
--------------------
1925
.. automodule:: jwql.tests.test_dark_monitor
2026
:members:
2127
:undoc-members:
2228

23-
test_edb_interface.py
24-
---------------------
29+
test_data_containers.py
30+
-----------------------
31+
.. automodule:: jwql.tests.test_data_containers
32+
:members:
33+
:undoc-members:
34+
35+
test_edb.py
36+
-----------
2537
.. automodule:: jwql.tests.test_edb
2638
:members:
2739
:undoc-members:
@@ -33,7 +45,7 @@ test_instrument_properties.py
3345
:undoc-members:
3446

3547
test_loading_times.py
36-
--------------------
48+
---------------------
3749
.. automodule:: jwql.tests.test_loading_times
3850
:members:
3951
:undoc-members:

environment_python_3_5.yml

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
channels:
2-
- http://ssb.stsci.edu/astroconda-dev
32
- defaults
3+
- http://ssb.stsci.edu/astroconda-dev
44
dependencies:
5-
- asdf=2.3.0
6-
- astropy>=3.1.2
75
- astroquery=0.3.9
8-
- bokeh=0.13.0
9-
- crds>=7.2.7
10-
- django=2.1.1
6+
- bokeh=1.3.2
7+
- django=2.2.1
8+
- flake8=3.7.7
119
- inflection=0.3.1
12-
- ipython=6.5.0
10+
- ipython=7.7.0
1311
- jinja2=2.10
14-
- jsonschema>=2.6.0
12+
- jsonschema=2.6.0
1513
- jwst=0.13.0
16-
- matplotlib=3.0.0
17-
- numpy=1.15.2
18-
- numpydoc=0.8.0
19-
- pandas=0.23.4
14+
- matplotlib=3.1.0
15+
- numpy=1.16.4
16+
- numpydoc=0.9.0
17+
- pandas=0.24.2
18+
- pip=19.1.1
2019
- postgresql=9.6.6
2120
- psycopg2=2.7.5
22-
- python=3.5.6
23-
- python-dateutil=2.7.3
24-
- pytest=3.8.1
25-
- pytest-cov=2.6.0
26-
- pytest-html=1.19.0
27-
- sphinx=2.0.1
28-
- sphinx_rtd_theme=0.1.9
29-
- sqlalchemy=1.2.11
21+
- python=3.6.4
22+
- pytest=5.0.1
23+
- pytest-cov=2.7.1
24+
- scipy=1.3.0
25+
- setuptools=41.0.1
26+
- sphinx=2.1.0
27+
- sqlalchemy=1.3.5
3028
- stsci_rtd_theme=0.0.2
31-
- twine=1.11.0
29+
- twine=1.13.0
3230
- pip:
33-
- authlib==0.10
31+
- asdf==2.3.3
32+
- astropy==3.2.1
33+
- authlib==0.11
3434
- codecov==2.0.15
3535
- jwedb>=0.0.3
36-
- pysiaf==0.2.5
37-
- sphinx-automodapi==0.10
36+
- pysiaf==0.3.1
37+
- pysqlite3==0.2.2

environment_python_3_6.yml

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
11
channels:
2-
- http://ssb.stsci.edu/astroconda-dev
32
- defaults
3+
- http://ssb.stsci.edu/astroconda-dev
44
dependencies:
5-
- asdf=2.3.1
6-
- astropy>=3.1.2
75
- astroquery=0.3.9
8-
- bokeh=1.2.0
9-
- crds>=7.2.7
6+
- bokeh=1.3.4
107
- django=2.2.1
8+
- flake8=3.7.7
119
- inflection=0.3.1
12-
- ipython=7.6.1
10+
- ipython=7.7.0
1311
- jinja2=2.10
14-
- jsonschema>=3.0.1
15-
- jwst=0.13.1
12+
- jsonschema=2.6.0
13+
- jwst=0.13.0
1614
- matplotlib=3.1.0
1715
- numpy=1.16.4
1816
- numpydoc=0.9.0
1917
- pandas=0.24.2
18+
- pip=19.1.1
2019
- postgresql=9.6.6
2120
- psycopg2=2.7.5
2221
- python=3.6.4
23-
- python-dateutil=2.7.5
2422
- pytest=5.0.1
25-
- pytest-cov=2.6.1
26-
- pytest-html=1.19.0
27-
- sphinx=2.1.0
28-
- sphinx_rtd_theme=0.1.9
29-
- sqlalchemy=1.3.5
30-
- sqlparse=0.3.0
23+
- pytest-cov=2.7.1
24+
- scipy=1.3.0
25+
- setuptools=41.0.1
26+
- sphinx=2.1.2
27+
- sqlalchemy=1.3.7
3128
- stsci_rtd_theme=0.0.2
3229
- twine=1.13.0
3330
- pip:
34-
- authlib==0.10
31+
- asdf==2.3.3
32+
- astropy==3.2.1
33+
- authlib==0.11
3534
- codecov==2.0.15
3635
- jwedb>=0.0.3
37-
- pysiaf==0.3.1
38-
- sphinx-automodapi==0.10
36+
- pysiaf==0.4.0
37+
- pysqlite3==0.2.2

jwql/bokeh_templating/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .template import BokehTemplate
+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
Created on Mon May 21 13:45:34 2018
5+
6+
@author: gkanarek
7+
"""
8+
9+
from bokeh.core.properties import Instance, String, Any, Dict
10+
from bokeh.models import ColumnDataSource, LayoutDOM
11+
12+
DEFAULTS = {
13+
'width': '600px',
14+
'height': '600px',
15+
'style': 'surface',
16+
'showPerspective': True,
17+
'showGrid': True,
18+
'keepAspectRatio': True,
19+
'verticalRatio': 1.0,
20+
'legendLabel': 'stuff',
21+
'cameraPosition': {
22+
'horizontal': -0.35,
23+
'vertical': 0.22,
24+
'distance': 1.8,
25+
}
26+
}
27+
28+
JS_CODE = """
29+
# This file contains the JavaScript (CoffeeScript) implementation
30+
# for a Bokeh custom extension. The "surface3d.py" contains the
31+
# python counterpart.
32+
#
33+
# This custom model wraps one part of the third-party vis.js library:
34+
#
35+
# http://visjs.org/index.html
36+
#
37+
# Making it easy to hook up python data analytics tools (NumPy, SciPy,
38+
# Pandas, etc.) to web presentations using the Bokeh server.
39+
40+
# These "require" lines are similar to python "import" statements
41+
import * as p from "core/properties"
42+
import {LayoutDOM, LayoutDOMView} from "models/layouts/layout_dom"
43+
44+
# This defines some default options for the Graph3d feature of vis.js
45+
# See: http://visjs.org/graph3d_examples.html for more details.
46+
OPTIONS =
47+
width: '600px'
48+
height: '600px'
49+
style: 'surface'
50+
showPerspective: true
51+
showGrid: true
52+
keepAspectRatio: true
53+
verticalRatio: 1.0
54+
legendLabel: 'stuff'
55+
cameraPosition:
56+
horizontal: -0.35
57+
vertical: 0.22
58+
distance: 1.8
59+
60+
# To create custom model extensions that will render on to the HTML canvas
61+
# or into the DOM, we must create a View subclass for the model. Currently
62+
# Bokeh models and views are based on BackBone. More information about
63+
# using Backbone can be found here:
64+
#
65+
# http://backbonejs.org/
66+
#
67+
# In this case we will subclass from the existing BokehJS ``LayoutDOMView``,
68+
# corresponding to our
69+
export class Surface3dView extends LayoutDOMView
70+
71+
initialize: (options) ->
72+
super(options)
73+
74+
url = "https://cdnjs.cloudflare.com/ajax/libs/vis/4.16.1/vis.min.js"
75+
76+
script = document.createElement('script')
77+
script.src = url
78+
script.async = false
79+
script.onreadystatechange = script.onload = () => @_init()
80+
document.querySelector("head").appendChild(script)
81+
82+
_init: () ->
83+
# Create a new Graph3s using the vis.js API. This assumes the vis.js has
84+
# already been loaded (e.g. in a custom app template). In the future Bokeh
85+
# models will be able to specify and load external scripts automatically.
86+
#
87+
# Backbone Views create <div> elements by default, accessible as @el. Many
88+
# Bokeh views ignore this default <div>, and instead do things like draw
89+
# to the HTML canvas. In this case though, we use the <div> to attach a
90+
# Graph3d to the DOM.
91+
@_graph = new vis.Graph3d(@el, @get_data(), @model.options)
92+
93+
# Set Backbone listener so that when the Bokeh data source has a change
94+
# event, we can process the new data
95+
@listenTo(@model.data_source, 'change', () =>
96+
@_graph.setData(@get_data())
97+
)
98+
99+
# This is the callback executed when the Bokeh data has an change. Its basic
100+
# function is to adapt the Bokeh data source to the vis.js DataSet format.
101+
get_data: () ->
102+
data = new vis.DataSet()
103+
source = @model.data_source
104+
for i in [0...source.get_length()]
105+
data.add({
106+
x: source.get_column(@model.x)[i]
107+
y: source.get_column(@model.y)[i]
108+
z: source.get_column(@model.z)[i]
109+
})
110+
return data
111+
112+
# We must also create a corresponding JavaScript Backbone model sublcass to
113+
# correspond to the python Bokeh model subclass. In this case, since we want
114+
# an element that can position itself in the DOM according to a Bokeh layout,
115+
# we subclass from ``LayoutDOM``
116+
export class Surface3d extends LayoutDOM
117+
118+
# This is usually boilerplate. In some cases there may not be a view.
119+
default_view: Surface3dView
120+
121+
# The ``type`` class attribute should generally match exactly the name
122+
# of the corresponding Python class.
123+
type: "Surface3d"
124+
125+
# The @define block adds corresponding "properties" to the JS model. These
126+
# should basically line up 1-1 with the Python model class. Most property
127+
# types have counterparts, e.g. ``bokeh.core.properties.String`` will be
128+
# ``p.String`` in the JS implementatin. Where the JS type system is not yet
129+
# as rich, you can use ``p.Any`` as a "wildcard" property type.
130+
@define {
131+
x: [ p.String ]
132+
y: [ p.String ]
133+
z: [ p.String ]
134+
data_source: [ p.Instance ]
135+
options: [ p.Any, OPTIONS ]
136+
}
137+
"""
138+
139+
140+
# This custom extension model will have a DOM view that should layout-able in
141+
# Bokeh layouts, so use ``LayoutDOM`` as the base class. If you wanted to create
142+
# a custom tool, you could inherit from ``Tool``, or from ``Glyph`` if you
143+
# wanted to create a custom glyph, etc.
144+
class Surface3d(LayoutDOM):
145+
146+
# The special class attribute ``__implementation__`` should contain a string
147+
# of JavaScript (or CoffeeScript) code that implements the JavaScript side
148+
# of the custom extension model.
149+
__implementation__ = JS_CODE
150+
151+
# Below are all the "properties" for this model. Bokeh properties are
152+
# class attributes that define the fields (and their types) that can be
153+
# communicated automatically between Python and the browser. Properties
154+
# also support type validation. More information about properties in
155+
# can be found here:
156+
#
157+
# http://bokeh.pydata.org/en/latest/docs/reference/core.html#bokeh-core-properties
158+
159+
# This is a Bokeh ColumnDataSource that can be updated in the Bokeh
160+
# server by Python code
161+
data_source = Instance(ColumnDataSource)
162+
163+
# The vis.js library that we are wrapping expects data for x, y, z, and
164+
# color. The data will actually be stored in the ColumnDataSource, but
165+
# these properties let us specify the *name* of the column that should
166+
# be used for each field.
167+
x = String
168+
y = String
169+
z = String
170+
color = String
171+
172+
options = Dict(String, Any, default=DEFAULTS)

0 commit comments

Comments
 (0)