Skip to content

Commit

Permalink
fix: buyukurganci-2022 was not actually the default viscosity model
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 27, 2024
1 parent c54952e commit 1fb3737
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion shapeout2/pipeline/dataslot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
}

Expand Down
5 changes: 5 additions & 0 deletions tests/test_gui_bulk_emodulus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
25 changes: 25 additions & 0 deletions tests/test_gui_emodulus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

0 comments on commit 1fb3737

Please sign in to comment.