Skip to content

Commit

Permalink
Improvements to parameter distribution container (#23)
Browse files Browse the repository at this point in the history
* New parameter distribution dashboard

* Added density plot

* Added boolean toggle from dash daq for density plot

* Removed title argument and updated doc string

* Updated example to use list of ensembles

* Minor fix to example

* Increased bottom margin of scatterplot to make room for x-title

* Removed hoverinfo on density trace

* Use single quotation marks

* Remove correlation matrix tick marks

* Remove axis and ticklabel on marginal histograms

* Removed empty line. Added comment

* Some minor description changes

* Linting

* Highlighting currently selected cell in correlation matrix

* Preventing ui state reset on correlation matrix click event

* Updated test

* Debugging test using travis

* Fixed test
  • Loading branch information
Hans Kallekleiv authored Jun 4, 2019
1 parent b5897a0 commit be85817
Show file tree
Hide file tree
Showing 4 changed files with 289 additions and 80 deletions.
4 changes: 3 additions & 1 deletion examples/basic_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ pages:
content:
- Some text...
- container: ParameterDistribution
ensemble: iter-0
ensembles:
- iter-0
- iter-1
- ...some other text
- title: Morris Plot
content:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
install_requires=[
'scipy>=1.2.1',
'dash-daq>=0.1.5',
'webviz-config>=0.0.4',
'webviz-plotly>=0.0.1',
'webviz-subsurface-components>=0.0.3'
Expand Down
9 changes: 4 additions & 5 deletions tests/test_parameter_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ def test_parameter_dist(dash_threaded):
cache.init_app(app.server)
driver = dash_threaded.driver
container_settings = {'scratch_ensembles': {'iter-0': ''}}
ensemble = 'iter-0'
ensembles = ['iter-0']

with mock.patch(get_parameters) as mock_parameters:
mock_parameters.return_value = pd.read_csv('tests/data/parameters.csv')

p = _parameter_distribution.\
ParameterDistribution(app, container_settings, ensemble)
ParameterDistribution(app, container_settings, ensembles)

app.layout = p.layout
dash_threaded(app)

my_component = wait_for_element_by_css_selector(
driver,
f'#{p.dropdown_vector_id}'
f'#{p.ens_matrix_id}'
)

if 'REAL' != my_component.text:
if not my_component.text.startswith('iter-0'):
raise AssertionError()
Loading

0 comments on commit be85817

Please sign in to comment.