diff --git a/CHANGELOG b/CHANGELOG index 02ddcb9..c20467b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ 2.19.1 + - fix: "buyukurganci-2022" was not actually the default viscosity model - ref: remove distutils dependency - docs: add developer's section 2.19.0 diff --git a/shapeout2/pipeline/dataslot.py b/shapeout2/pipeline/dataslot.py index cd9b144..7ddcaff 100644 --- a/shapeout2/pipeline/dataslot.py +++ b/shapeout2/pipeline/dataslot.py @@ -66,7 +66,7 @@ def __init__(self, path, identifier=None, name=None): "emodulus scenario": "manual", "emodulus temperature": np.nan, "emodulus viscosity": np.nan, - "emodulus viscosity model": "herold-2017", + "emodulus viscosity model": "buyukurganci-2022", } } diff --git a/tests/test_gui_bulk_emodulus.py b/tests/test_gui_bulk_emodulus.py index d6c5c3a..fbe037d 100644 --- a/tests/test_gui_bulk_emodulus.py +++ b/tests/test_gui_bulk_emodulus.py @@ -60,6 +60,11 @@ def test_manual_basic(qtbot): # create bulk action dialog manually dlg = bulk.BulkActionEmodulus(mw, pipeline=mw.pipeline) + + # sanity check: default viscosity model should be "buyukurganci-2022" + ivdm = dlg.comboBox_visc_model.findData("buyukurganci-2022") + assert dlg.comboBox_visc_model.currentIndex() == ivdm + dlg.comboBox_temp.setCurrentIndex(dlg.comboBox_temp.findData("manual")) dlg.doubleSpinBox_temp.setValue(29.5) dlg.on_ok() diff --git a/tests/test_gui_emodulus.py b/tests/test_gui_emodulus.py index f44a210..76a3ba1 100644 --- a/tests/test_gui_emodulus.py +++ b/tests/test_gui_emodulus.py @@ -128,10 +128,15 @@ def test_simple(qtbot): mw.add_dataslot(paths=[path]) wsl = mw.widget_ana_view.widget_slot + idvm = wsl.comboBox_visc_model.findData("herold-2017") + assert idvm >= 0 + wsl.comboBox_visc_model.setCurrentIndex(idvm) + wsl.write_slot() # default values assert wsl.comboBox_medium.currentData() == "CellCarrier" assert wsl.comboBox_temp.currentData() == "feature" + assert wsl.comboBox_visc_model.currentData() == "herold-2017" # scenario A (this is already set by default) ds1 = mw.pipeline.slots[0].get_dataset() @@ -326,3 +331,23 @@ def test_changeable_lut_selection(qtbot): path1.unlink() except BaseException: pass + + +def test_viscosity_defaults_to_buyukurganci_2022(qtbot): + mw = ShapeOut2() + qtbot.addWidget(mw) + + # add fake measurement + path1 = make_dataset(medium="CellCarrier", temp=22.5, temp_range=[22, 23]) + + mw.add_dataslot(paths=[path1]) + wsl = mw.widget_ana_view.widget_slot + ds = mw.pipeline.slots[0].get_dataset() + + assert ds.config["setup"]["medium"] == "CellCarrier", "sanity check" + assert wsl.comboBox_medium.currentData() == "CellCarrier" + + # the buyukurganci-2022 viscosity model should be the default + idvm_loc = wsl.comboBox_visc_model.findData("buyukurganci-2022") + idvm_actual = wsl.comboBox_visc_model.currentIndex() + assert idvm_loc == idvm_actual