Skip to content

Commit

Permalink
Some small misc changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
1313e committed Dec 3, 2020
1 parent 51fa081 commit 9c66ac1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
7 changes: 2 additions & 5 deletions docs/source/user/scripts/example_link.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-

# Future imports
from __future__ import absolute_import, division, print_function

# Package imports
import numpy as np

Expand Down Expand Up @@ -39,7 +36,7 @@ def call_model(self, emul_i, par_set, data_idx):
# Following is provided:
# 'emul_i': Requested iteration
# 'par_set': Requested sample(s) dict
# 'data_idx': Requested data point(s)
# 'data_idx': Requested data points
pass

# Override get_md_var abstract method
Expand All @@ -48,5 +45,5 @@ def get_md_var(self, emul_i, par_set, data_idx):
# Following is provided:
# 'emul_i': Requested iteration
# 'par_set': Requested sample dict
# 'data_idx': Requested data point(s)
# 'data_idx': Requested data points
pass
18 changes: 10 additions & 8 deletions docs/source/user/scripts/line_link.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-

# Future imports
from __future__ import absolute_import, division, print_function

# Package imports
import numpy as np

Expand All @@ -23,16 +20,21 @@ def __init__(self, *args, **kwargs):
# Define default model parameters (optional)
def get_default_model_parameters(self):
par_dict = {
'A': [-10, 10, 3], # Intercept in [-10, 10] with estimate of 3
'B': [0, 5, 1.5]} # Slope in [0, 5] with estimate of 1.5
# Intercept in [-10, 10], guess of 3
'A': [-10, 10, 3],
# Slope in [0, 5], guess of 1.5
'B': [0, 5, 1.5]}
return(par_dict)

# Define default model data (optional)
def get_default_model_data(self):
data_dict = {
1: [4.5, 0.1], # f(1) = 4.5 +- 0.1
2.5: [6.8, 0.1], # f(2.5) = 6.8 +- 0.1
-2: [0, 0.1]} # f(-2) = 0 +- 0.1
# f(1) = 4.5 +- 0.1
1: [4.5, 0.1],
# f(2.5) = 6.8 +- 0.1
2.5: [6.8, 0.1],
# f(-2) = 0 +- 0.1
-2: [0, 0.1]}
return(data_dict)

# Override call_model abstract method
Expand Down
6 changes: 6 additions & 0 deletions prism/_gui/widgets/preferences/kwargs_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ def set_box_value(self, page_dict):
"""

# Hide the page
self.hide()

# Make empty dict containing all current valid entries
cur_entry_dict = sdict()

Expand Down Expand Up @@ -459,6 +462,9 @@ def set_box_value(self, page_dict):
set_box_value(self.kwargs_grid.itemAtPosition(row, 2).widget(),
field_value)

# Show the page
self.show()

# This function creates an editable entry
@QC.Slot()
@e13.docstring_substitute(qt_slot=qt_slot_doc)
Expand Down

0 comments on commit 9c66ac1

Please sign in to comment.