Skip to content

Commit 1fe1db2

Browse files
authored
Merge pull request #2730 from Open-Systems-Pharmacology/develop
Version 12.2
2 parents 7e7d388 + 8a85e1b commit 1fe1db2

85 files changed

Lines changed: 1317 additions & 279 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-and-publish.yml renamed to .github/workflows/build-and-publish_12.2.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Build and Publish
2-
run-name: Version 12.1.${{ github.run_number }} (${{ github.event.head_commit.message }})
1+
name: Build and Publish 12.2
2+
run-name: Version 12.2.${{ github.run_number }} (${{ github.event.head_commit.message }})
33

44
on:
55
push:
@@ -11,7 +11,7 @@ permissions:
1111

1212
env:
1313
MAJOR: 12
14-
MINOR: 1
14+
MINOR: 2
1515
RUN: ${{ github.run_number }}
1616

1717
jobs:
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Build PR
1+
name: Build PR 12.2
22

33
on:
44
pull_request:
55
branches:
66
- develop
77

8+
permissions:
9+
contents: read
10+
packages: read
11+
812
jobs:
913
build-and-test:
1014
runs-on: windows-latest
@@ -20,7 +24,7 @@ jobs:
2024
dotnet restore
2125
2226
- name: Build
23-
run: dotnet build OSPSuite.Core.sln /p:Version=12.1.9999
27+
run: dotnet build OSPSuite.Core.sln /p:Version=12.2.9999
2428

2529
- name : Test
2630
run: dotnet test .\tests\**\bin\Debug\net472\OSPSuite*Tests.dll -v normal --no-build --logger:"html;LogFileName=../testLog_Windows.html"

.github/workflows/codeql.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
workflow_dispatch:
12+
schedule:
13+
- cron: '40 3 * * 1' # Runs at 03:40 every monday
14+
15+
jobs:
16+
analyze:
17+
name: Analyze (${{ matrix.language }})
18+
runs-on: windows-latest
19+
permissions:
20+
# required for all workflows
21+
security-events: write
22+
23+
# required to fetch internal or private CodeQL packs
24+
packages: read
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
include:
30+
- language: actions
31+
build-mode: none
32+
- language: csharp
33+
build-mode: manual
34+
- language: ruby
35+
build-mode: none
36+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
37+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
38+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
39+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
40+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
with:
45+
submodules: 'true'
46+
47+
# Initializes the CodeQL tools for scanning.
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v3
50+
with:
51+
languages: ${{ matrix.language }}
52+
build-mode: ${{ matrix.build-mode }}
53+
54+
- if: matrix.build-mode == 'manual'
55+
run: |
56+
nuget sources add -username Open-Systems-Pharmacology -password ${{ secrets.GITHUB_TOKEN }} -name OSP-GitHub-Packages -source "https://nuget.pkg.github.com/Open-Systems-Pharmacology/index.json"
57+
dotnet restore
58+
dotnet build OSPSuite.Core.sln /p:Version=12.2.9999
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@v3
62+
with:
63+
category: "/language:${{matrix.language}}"
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
name: Code Coverage
1+
name: Code Coverage 12.2
22

33
on:
44
schedule:
55
- cron: '0 1 * * 4'
66

7+
permissions:
8+
contents: read
9+
packages: read
10+
711
jobs:
812
cover:
913
runs-on: windows-latest
@@ -19,7 +23,7 @@ jobs:
1923
dotnet restore
2024
2125
- name: Build
22-
run: dotnet build OSPSuite.Core.sln /p:Version=12.1.999
26+
run: dotnet build OSPSuite.Core.sln /p:Version=12.2.999
2327

2428

2529
- name: Cover and report

OSPSuite.Core.sln

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OSPSuite.Core", "src\OSPSui
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{25A7357D-0812-44F3-AF90-244FD752FAE2}"
99
ProjectSection(SolutionItems) = preProject
10-
.github\workflows\build-and-publish.yml = .github\workflows\build-and-publish.yml
11-
.github\workflows\build-pr.yml = .github\workflows\build-pr.yml
12-
.github\workflows\coverage.yml = .github\workflows\coverage.yml
10+
.github\workflows\build-and-publish_12.2.yml = .github\workflows\build-and-publish_12.2.yml
11+
.github\workflows\build-pr_12.2.yml = .github\workflows\build-pr_12.2.yml
12+
.github\workflows\coverage_12.2.yml = .github\workflows\coverage_12.2.yml
13+
dotcover.xml = dotcover.xml
1314
logo.png = logo.png
1415
rakefile.rb = rakefile.rb
1516
SolutionInfo.cs = SolutionInfo.cs

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Core functionalities of the Open Systems Pharmacology Suite.
44

55
## Code Status
6-
[![Build status](https://img.shields.io/github/actions/workflow/status/Open-Systems-Pharmacology/OSPSuite.Core/build-and-publish.yml?logo=nuget&label=Build%20status)](https://github.com/Open-Systems-Pharmacology/OSPSuite.Core/actions/workflows/build-and-publish.yml)
6+
[![Build status](https://img.shields.io/github/actions/workflow/status/Open-Systems-Pharmacology/OSPSuite.Core/build-and-publish_12.2.yml?logo=nuget&label=Build%20status)](https://github.com/Open-Systems-Pharmacology/OSPSuite.Core/actions/workflows/build-and-publish_12.2.yml)
77
[![Coverage status](https://codecov.io/gh/Open-Systems-Pharmacology/OSPSuite.Core/branch/develop/graph/badge.svg)](https://codecov.io/gh/Open-Systems-Pharmacology/OSPSuite.Core)
88

99
## Code of conduct

dotcover.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<CoverageParams>
33
<TargetArguments>
4-
Tests\OSPSuite.Core.Tests\bin\Debug\net472\OSPSuite.Core.Tests.dll
4+
Tests\OSPSuite.Core.Tests\bin\Debug\net8\OSPSuite.Core.Tests.dll
55
Tests\OSPSuite.Core.IntegrationTests\bin\Debug\net472\OSPSuite.Core.IntegrationTests.dll
66
Tests\OSPSuite.Presentation.Tests\bin\Debug\net472\OSPSuite.Presentation.Tests.dll
77
Tests\OSPSuite.Infrastructure.Tests\bin\Debug\net472\OSPSuite.Infrastructure.Tests.dll

rakefile.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
task :create_local_nuget, [:arg1, :arg2, :arg3] do |t, args|
3030
FileUtils.rm_f Dir.glob("./nuget_repo/*.nupkg")
31-
versionId = "12.1.0-" + generate_code(5)
31+
versionId = "12.2.0-" + generate_code(5)
3232
puts("Your version is " + versionId.red)
3333
system("dotnet", "pack", "-p:PackageVersion="+ versionId, "--configuration", "Debug", "--output", "nuget_repo", "--no-build")
3434
if args.to_hash.values.include? "m"
@@ -41,7 +41,7 @@
4141

4242
private
4343
def find_token(file, regex)
44-
file_content = str = IO.read(file)
44+
file_content = str = File.read(file)
4545
matches = file_content.match(regex)
4646

4747
if(matches.nil?)

src/OSPSuite.Assets/UIConstants.cs

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Drawing;
66
using System.Linq;
77
using System.Text;
8+
using OSPSuite.Utility.Collections;
89

910
namespace OSPSuite.Assets
1011
{
@@ -232,7 +233,7 @@ public static class Captions
232233
public static readonly string DeleteSelected = "Delete Selected Records";
233234
public static readonly string ModulesFolder = "Modules";
234235
public static readonly string ApplyChangesToUpdateChart = "Apply changes to update chart";
235-
public static readonly string Apply = "Apply";
236+
public static readonly string ApplyUpdates = "Apply updates";
236237
public static readonly string AutoUpdateChart = "Auto-update chart";
237238

238239
public static string EditTableParameter(string parameter, bool editable) => $"{(editable ? "Edit" : "Show")} table parameter '{parameter}'";
@@ -471,7 +472,7 @@ public static class Importer
471472
public static readonly string SaveConfiguration = "Save Configuration";
472473
public static readonly string ApplyConfiguration = "Load Configuration";
473474
public static readonly string ActionWillEraseLoadedData = "This action will result in dropping all the loaded sheets. Do you want to continue?";
474-
public static readonly string OpenFile = "Select the file you would like to apply configuration on";
475+
public static readonly string SelectFileToImport = "Select the file to import";
475476
public static readonly string GroupByTitle = "Group By";
476477
public static readonly string SelectToAdd = "Select to add";
477478
public static readonly string MappingTitle = "Mapping";
@@ -1203,6 +1204,16 @@ public static class Descriptions
12031204
}
12041205
}
12051206

1207+
public static string SimulationsAreRunning(IReadOnlyList<string> names)
1208+
{
1209+
return $"The following Simulations are currently running: {names.ToString(", ", "'")}, action cannot be performed until they are stopped.";
1210+
}
1211+
1212+
public static string ParameterIdentificationsAreRunning(IReadOnlyList<string> names)
1213+
{
1214+
return $"The following Parameter Identifications are currently running: {ObjectTypes.ParameterIdentification.ToLowerInvariant().PluralizeIf(names)} {names.ToString(", ", "'")}, action cannot be performed until they are stopped.";
1215+
}
1216+
12061217
public static string ReallyDeleteParameterIdentifications(IReadOnlyList<string> names)
12071218
{
12081219
return $"Really delete {ObjectTypes.ParameterIdentification.ToLowerInvariant().PluralizeIf(names)} {names.ToString(", ", "'")}?";
@@ -1240,11 +1251,30 @@ public static class SensitivityAnalysis
12401251
public static readonly string NoResultsAvailable = "No result available. Please start sensitivity analysis";
12411252
public static readonly string ErrorsDuringPreviousRun = "<b>The last run resulted in one or more errors:</b>";
12421253

1243-
public static string SensitivityAnalysisFinished(string duration)
1254+
public static string SensitivityAnalysisFinished(string duration, IReadOnlyList<string> failedPKParameterCalculations)
12441255
{
1256+
if (failedPKParameterCalculations.Any())
1257+
{
1258+
1259+
return $"Sensitivity analysis finished in {duration} but failed to calculate sensitivities for:{Environment.NewLine}{buildNestedList(failedPKParameterCalculations)}";
1260+
}
12451261
return $"Sensitivity analysis finished in {duration}";
12461262
}
12471263

1264+
private static string buildNestedList(IReadOnlyList<string> failedPKParameterCalculations)
1265+
{
1266+
var sb = new StringBuilder();
1267+
sb.AppendLine();
1268+
1269+
failedPKParameterCalculations.Each(x =>
1270+
{
1271+
sb.Append(" - ");
1272+
sb.AppendLine(x);
1273+
});
1274+
1275+
return sb.ToString();
1276+
}
1277+
12481278
public static readonly string SensitivityAnalysisCanceled = "Sensitivity analysis canceled";
12491279
public static readonly string NoSensitivityAnalysisRunning = "No visual feedback available. Please start sensitivity analysis.";
12501280
public static readonly string SensitivityHasNotBeenUpdated = "Sensitivity analysis has not been updated";
@@ -1633,9 +1663,28 @@ public static string CannotFindSimulationResultsForOutput(string fullOutputPath)
16331663
public static readonly string TableFormulaWithOffsetUsesNonTableFormulaObject = "Object used in table formula with offset must be based an a table formula";
16341664
public static readonly string ScaleFactorShouldBeGreaterThanZero = "Scale factor should be greater than 0";
16351665

1666+
public static string TimeFromRepositoryNotStrictlyMonotone(double valueBefore, double valueAfter, string displayUnit, string repositoryName)
1667+
{
1668+
var hint = hintForNotStrictlyMonotone(valueBefore, valueAfter, displayUnit);
1669+
1670+
return $"The time column in data set '{repositoryName}' is not strictly monotonically increasing ({hint}).\nEnsure that time always increases (e.g. 0.5, 1, 2, 4 hours).";
1671+
}
1672+
1673+
private static string hintForNotStrictlyMonotone(double valueBefore, double valueAfter, string displayUnit)
1674+
{
1675+
return Equals(valueAfter, valueBefore) ? $"{valueBefore} {displayUnit} is duplicated" : $"{valueBefore} {displayUnit} is immediately followed by {valueAfter} {displayUnit}";
1676+
}
1677+
1678+
public static string TimeFromSheetNotStrictlyMonotone(double valueBefore, double valueAfter, string displayUnit, string sheetName)
1679+
{
1680+
var hint = hintForNotStrictlyMonotone(valueBefore, valueAfter, displayUnit);
1681+
1682+
return $"The time column in sheet '{sheetName}' is not strictly monotonically increasing ({hint}).\nEnsure that time always increases (e.g. 0.5, 1, 2, 4 hours).";
1683+
}
1684+
16361685
public static string TimeNotStrictlyMonotone(double valueBefore, double valueAfter, string displayUnit)
16371686
{
1638-
var hint = Equals(valueAfter, valueBefore) ? $"{valueBefore} {displayUnit} is duplicated" : $"{valueBefore} {displayUnit} is immediately followed by {valueAfter} {displayUnit}";
1687+
var hint = hintForNotStrictlyMonotone(valueBefore, valueAfter, displayUnit);
16391688

16401689
return $"The time column is not strictly monotonically increasing ({hint}).\nEnsure that time always increases (e.g. 0.5, 1, 2, 4 hours).";
16411690
}
@@ -2154,6 +2203,8 @@ public static string LargeNumberOfOutputPoints(int numberOfPoints) =>
21542203
$"The selected output resolution will generate {numberOfPoints} points and may severely impact the software performance.\nAre you sure you want to run with these setting? If not, consider changing output resolution in simulations settings";
21552204

21562205
public static string NeighborhoodWasNotFoundInModel(string neighborhoodName, string buildingBlockName) => $"The neighborhood '{neighborhoodName}' from building block '{buildingBlockName}' was not added to the simulation";
2206+
2207+
public static string ExpressionMoleculeNotFoundInSimulation(string moleculeName) => $"The molecule '{moleculeName}' is not part of the simulation structure";
21572208
}
21582209

21592210
public static class RibbonCategories
@@ -2253,7 +2304,7 @@ public static string CompareObjects(string objectType)
22532304
return $"Compare {objectType}s";
22542305
}
22552306

2256-
public static readonly string AutoUpdateChart = "Autoupdate chart";
2307+
public static readonly string AutoUpdateChart = "Auto-update chart";
22572308
public static readonly string ApplyUpdates = "Apply updates";
22582309
}
22592310

@@ -2346,6 +2397,16 @@ public static string SetObservedDataParameterCommandDescription(string oldValue,
23462397
return $"{parameterName} set from {oldValue} to {newValue} in {observedDataName}";
23472398
}
23482399

2400+
public static string AddManyObservedDataToProjectDescription(IReadOnlyList<string> names, string projectName)
2401+
{
2402+
return $"Added observed data: \n\n{string.Join("\n", names)}\n\n to project '{projectName}'";
2403+
}
2404+
2405+
public static string RemoveManyObservedDataToProjectDescription(IReadOnlyList<string> names, string projectName)
2406+
{
2407+
return $"Removed observed data: \n\n{string.Join("\n", names)}\n\n from project '{projectName}'";
2408+
}
2409+
23492410
public static string AddObservedDataToProjectDescription(string observedDataName, string projectName)
23502411
{
23512412
return AddEntityToContainer(ObjectTypes.ObservedData, observedDataName, ObjectTypes.Project, projectName);
@@ -2650,4 +2711,4 @@ public static class Colors
26502711
public static Color NegativeCorrelation = Color.FromArgb(96, 187, 70);
26512712
public static Color PositiveCorrelation = Color.FromArgb(0, 174, 239);
26522713
}
2653-
}
2714+
}

src/OSPSuite.Core/Chart/CurveChart.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void RemoveCurve(string curveId)
116116
updateAxesForRemovedCurve(yAxisType);
117117
}
118118

119-
public Curve CreateCurve(DataColumn columnX, DataColumn columnY, string curveName, IDimensionFactory dimensionFactory)
119+
public virtual Curve CreateCurve(DataColumn columnX, DataColumn columnY, string curveName, IDimensionFactory dimensionFactory)
120120
{
121121
var curve = FindCurveWithSameData(columnX, columnY);
122122
if (curve != null)

0 commit comments

Comments
 (0)