Skip to content

Commit b8f13cc

Browse files
authored
Merge pull request #3598 from Open-Systems-Pharmacology/develop
Version 12.3.173 (HotFix MW_eff)
2 parents e476348 + 7617934 commit b8f13cc

2 files changed

Lines changed: 6 additions & 20 deletions

File tree

.github/workflows/build-nightly_12.3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
dotnet build /p:Version=${{env.APP_VERSION}}
6666
6767
- name : Test
68-
run: dotnet test -v normal --no-build --logger:"html;LogFileName=../testLog_Windows.html"
68+
run: dotnet test -v normal --no-build --logger:"html;LogFileName=${{ github.workspace }}/testLog_Windows.html"
6969

7070
- name: Sign PKSim.exe with CodeSignTool
7171
uses: Open-Systems-Pharmacology/Workflows/.github/actions/codesigner-SSL@main

src/PKSim.Presentation/DTO/Compounds/EffectiveMolWeightParameterDTO.cs

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,14 @@ private static class AllRules
3030
.Property(item => item.Value)
3131
.WithRule((dto, valueInDisplayUnit) =>
3232
{
33-
var valueInBaseUnit = dto.Parameter.ConvertToBaseUnit(valueInDisplayUnit);
34-
3533
// Nan values are invalid
36-
if (double.IsNaN(valueInBaseUnit))
34+
if (double.IsNaN(valueInDisplayUnit))
3735
return false;
3836

39-
// evaluate without updating the parameter because writing a value will trigger another validation
40-
if (valueInBaseUnit == dto.Parameter.Value)
41-
return effectiveMolWeightIsValid(dto);
42-
43-
// Update the parameter value to evaluate if the effective mol weight will be valid.
44-
// Reset to the old value after
45-
var oldValue = dto.Parameter.Value;
46-
try
47-
{
48-
dto.Parameter.Value = valueInBaseUnit;
49-
return effectiveMolWeightIsValid(dto);
50-
}
51-
finally
52-
{
53-
dto.Parameter.Value = oldValue;
54-
}
37+
// For effective mol weight is a formula-only calculation and is updated through halogens and/or mol weight
38+
// and never directly from user input. The value at time of validation is always current because the triggering
39+
// update has already occurred. Either mol weight was updated, or halogen count
40+
return effectiveMolWeightIsValid(dto);
5541
})
5642
.WithError((dto, value) =>
5743
PKSimConstants.Error.EffectiveMolWeightMustBeGreaterThan(

0 commit comments

Comments
 (0)