Skip to content

Commit

Permalink
Version 9.1
Browse files Browse the repository at this point in the history
Hotfix/v9.1
  • Loading branch information
msevestre authored Jul 22, 2020
2 parents eceaa47 + 8ef2681 commit b305b16
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 127 deletions.
2 changes: 1 addition & 1 deletion appveyor-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ init:
- cmd: if DEFINED APPVEYOR_PULL_REQUEST_NUMBER (Set build_number=1) ELSE (Set build_number=%APPVEYOR_BUILD_NUMBER%)

environment:
app_version: "9.0"
app_version: "9.1"
APPVEYOR_BLOCK_DOTNETCORE_TESTS_AUTORUN: true

version: "$(app_version).{build}"
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ init:
- cmd: if DEFINED APPVEYOR_PULL_REQUEST_NUMBER (Set build_number=1) ELSE (Set build_number=%APPVEYOR_BUILD_NUMBER%)

environment:
app_version: "9.0"
app_version: "9.1"
APPVEYOR_BLOCK_DOTNETCORE_TESTS_AUTORUN: true

version: "$(app_version).{build}"
Expand All @@ -25,6 +25,7 @@ skip_branch_with_pr: true
branches:
only:
- develop
- hotfix/v9.1

pull_requests:
do_not_increment_build_number: true
Expand Down
20 changes: 12 additions & 8 deletions src/PKSim.Core/CoreConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,22 @@ public static class Alias
public static readonly string TABLE = "Table";
public static readonly string XARG = "XArg";
public static readonly string OFFSET = "Offset";
public static readonly string COMPETIVE_INHIBITION_KI = "KcI";
public static readonly string UNCOMPETIVE_INHIBITION_KI = "KuI";
public static readonly string NON_COMPETIVE_INHIBITION_KI = "KnI";
public static readonly string COMPETITIVE_INHIBITION_KI = "KcI";
public static readonly string UNCOMPETITIVE_INHIBITION_KI = "KuI";
public static readonly string NON_COMPETITIVE_INHIBITION_KI = "KnI";
public static readonly string MIXED_COMPETITIVE_INHIBITION_KI = "KmcI";
public static readonly string MIXED_UNCOMPETITIVE_INHIBITION_KI = "KmuI";
public static readonly string IRREVERSIBLE_INHIBITION_KI = "KcTDI";
public static readonly string COMPETIVE_INHIBITION_I = "Ic";
public static readonly string UNCOMPETIVE_INHIBITION_I = "Iu";
public static readonly string NON_COMPETIVE_INHIBITION_I = "In";
public static readonly string MIXED_COMPETIVE_INHIBITION_I = "Im";
public static readonly string COMPETITIVE_INHIBITION_I = "Ic";
public static readonly string UNCOMPETITIVE_INHIBITION_I = "Iu";
public static readonly string NON_COMPETITIVE_INHIBITION_I = "In";
public static readonly string MIXED_INHIBITION_I = "Im";
public static readonly string IRREVERSIBLE_INHIBITION_I = "IcTD";
public static readonly string K_WATER = "K_water";
public static readonly string COMPETITIVE_INHIBITION_K_WATER = "K_water_c";
public static readonly string UNCOMPETITIVE_INHIBITION_K_WATER = "K_water_u";
public static readonly string NON_COMPETITIVE_INHIBITION_K_WATER = "K_water_n";
public static readonly string MIXED_INHIBITION_K_WATER = "K_water_m";
public static readonly string IRREVERSIBLE_INHIBITION_K_WATER = "K_water_cTD";
}

public static class ActiveTransport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
namespace PKSim.Core.Services
{
/// <summary>
/// Represents the updater for competive inhibition processes only (not mixed inhibition)
/// Represents the updater for competitive inhibition processes only (not mixed inhibition)
/// </summary>
public class CompetitiveInhibitionsKineticUpdaterSpecification : InteractionKineticUpdaterSpecificationBase
{
public CompetitiveInhibitionsKineticUpdaterSpecification(IObjectPathFactory objectPathFactory, IDimensionRepository dimensionRepository, IInteractionTask interactionTask) :
base(objectPathFactory, dimensionRepository, interactionTask,InteractionType.CompetitiveInhibition,
kiNumeratorAlias: CoreConstants.Alias.COMPETIVE_INHIBITION_KI,
kiNumeratorAlias: CoreConstants.Alias.COMPETITIVE_INHIBITION_KI,
kiNumeratorParameter: CoreConstants.Parameters.KI,
kiDenominatorAlias: CoreConstants.Alias.COMPETIVE_INHIBITION_KI,
kiDenominatorAlias: CoreConstants.Alias.COMPETITIVE_INHIBITION_KI,
kiDenominatorParameter: CoreConstants.Parameters.KI,
inhibitorAlias: CoreConstants.Alias.COMPETIVE_INHIBITION_I)
inhibitorAlias: CoreConstants.Alias.COMPETITIVE_INHIBITION_I,
kWaterAlias: CoreConstants.Alias.COMPETITIVE_INHIBITION_K_WATER)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ public abstract class InteractionKineticUpdaterSpecificationBase : IInteractionK
private readonly string _kiDenominatorParameter;
private readonly string _kiNumeratorAlias;
private readonly string _kiDenominatorAlias;
private readonly string _kWaterAlias;
private readonly string _inhibitorAlias;

protected InteractionKineticUpdaterSpecificationBase(IObjectPathFactory objectPathFactory, IDimensionRepository dimensionRepository, IInteractionTask interactionTask, InteractionType interactionType,
string kiNumeratorParameter, string kiDenominatorParameter, string kiNumeratorAlias, string kiDenominatorAlias, string inhibitorAlias)
string kiNumeratorParameter, string kiDenominatorParameter, string kiNumeratorAlias, string kiDenominatorAlias, string inhibitorAlias, string kWaterAlias)
{
_objectPathFactory = objectPathFactory;
_dimensionRepository = dimensionRepository;
Expand All @@ -38,6 +39,7 @@ protected InteractionKineticUpdaterSpecificationBase(IObjectPathFactory objectPa
_kiNumeratorAlias = kiNumeratorAlias;
_kiDenominatorAlias = kiDenominatorAlias;
_inhibitorAlias = inhibitorAlias;
_kWaterAlias = kWaterAlias;
}

public bool UpdateRequiredFor(string moleculeName, string compoundName, Simulation simulation)
Expand Down Expand Up @@ -97,12 +99,12 @@ private string inhibitionTermsFor(string moleculeName, string compoundName, Simu
return string.Empty;

var kiAliasBase = kiAliasFrom(kineticModification);
var inibitionTerms = new List<string>();
var inhibitionTerms = new List<string>();

doOverAllInteractions(moleculeName, compoundName, simulation, kiAliasBase,
(interactionProcess, inhibitorAlias, kiAlias, kwaterAlias) => inibitionTerms.Add($"{kwaterAlias}*{inhibitorAlias}/{kiAlias}"));
(interactionProcess, inhibitorAlias, kiAlias, kwaterAlias) => inhibitionTerms.Add($"{kwaterAlias}*{inhibitorAlias}/{kiAlias}"));

return inibitionTerms.ToString(" + ");
return inhibitionTerms.ToString(" + ");
}

private void updateReferences(IUsingFormula usingFormula, string moleculeName, string compoundName, Simulation simulation,
Expand All @@ -120,7 +122,7 @@ private void updateReferences(IUsingFormula usingFormula, string moleculeName, s
var inhibitor = interactionProcess.ParentCompound;

if (formula.FormulaUsablePathBy(inhibitorAlias) == null)
formula.AddObjectPath(inhiborConcentrationPath(inhibitor, inhibitorAlias, processParameterContainer));
formula.AddObjectPath(inhibitorConcentrationPath(inhibitor, inhibitorAlias, processParameterContainer));

if (formula.FormulaUsablePathBy(kwaterAlias) == null)
formula.AddObjectPath(kwaterPath(inhibitor, kwaterAlias, processParameterContainer));
Expand All @@ -136,9 +138,9 @@ private void doOverAllInteractions(string moleculeName, string compoundName, Sim
AllInteractionProcessesFor(moleculeName, compoundName, simulation).Each((interactionProcess, i) =>
{
var inhibitorIndex = i + 1;
var inhibitorAlias = string.Format("{0}{1}", _inhibitorAlias, inhibitorIndex);
var kiAlias = string.Format("{0}{1}", kiAliasBase, inhibitorIndex);
var kwaterAlias = string.Format("{0}{1}", CoreConstants.Alias.K_WATER, inhibitorIndex);
var inhibitorAlias = $"{_inhibitorAlias}{inhibitorIndex}";
var kiAlias = $"{kiAliasBase}{inhibitorIndex}";
var kwaterAlias = $"{_kWaterAlias}{inhibitorIndex}";
action(interactionProcess, inhibitorAlias, kiAlias, kwaterAlias);
});
}
Expand All @@ -155,20 +157,20 @@ private IFormulaUsablePath kiPath(string kiParameter, Compound inhibitor, Intera
.WithDimension(_dimensionRepository.MolarConcentration);
}

private IFormulaUsablePath inhiborConcentrationPath(Compound inhibitor, string inhibitorAlias, IContainer processParameterContainer)
private IFormulaUsablePath inhibitorConcentrationPath(Compound inhibitor, string inhibitorAlias, IContainer processParameterContainer)
{
return localInibitorParameterPath(inhibitor, Constants.Parameters.CONCENTRATION, inhibitorAlias, processParameterContainer, _dimensionRepository.MolarConcentration);
return localInhibitorParameterPath(inhibitor, Constants.Parameters.CONCENTRATION, inhibitorAlias, processParameterContainer, _dimensionRepository.MolarConcentration);
}

private IFormulaUsablePath kwaterPath(Compound inhibitor, string kwaterAlias, IContainer processParameterContainer)
{
return localInibitorParameterPath(inhibitor, CoreConstants.Parameters.K_WATER, kwaterAlias, processParameterContainer, _dimensionRepository.NoDimension);
return localInhibitorParameterPath(inhibitor, CoreConstants.Parameters.K_WATER, kwaterAlias, processParameterContainer, _dimensionRepository.NoDimension);
}

private IFormulaUsablePath localInibitorParameterPath(Compound inhibitor, string parameterName, string parametrAlias, IContainer processParameterContainer, IDimension dimension)
private IFormulaUsablePath localInhibitorParameterPath(Compound inhibitor, string parameterName, string parameterAlias, IContainer processParameterContainer, IDimension dimension)
{
var objectPath = _objectPathFactory.CreateFormulaUsablePathFrom(inhibitor.Name, parameterName)
.WithAlias(parametrAlias)
.WithAlias(parameterAlias)
.WithDimension(dimension);

return processParameterContainer.IsAnImplementationOf<IReactionBuilder>()
Expand All @@ -183,26 +185,26 @@ private static InteractionKineticModifications modificationsFrom(InteractionType

private string kiAliasFrom(InteractionKineticModifications kineticModification)
{
return kiInfoFrom(kineticModification).Item1;
return kiInfoFrom(kineticModification).kiAlias;
}

private string kiParameterFrom(InteractionKineticModifications kineticModification)
{
return kiInfoFrom(kineticModification).Item2;
return kiInfoFrom(kineticModification).kiParameter;
}

private Tuple<string, string> kiInfoFrom(InteractionKineticModifications kineticModification)
private (string kiAlias, string kiParameter) kiInfoFrom(InteractionKineticModifications kineticModification)
{
switch (kineticModification)
{
case InteractionKineticModifications.KmDenominator:
case InteractionKineticModifications.KcatDenominator:
return new Tuple<string, string>(_kiDenominatorAlias, _kiDenominatorParameter);
return (_kiDenominatorAlias, _kiDenominatorParameter);
case InteractionKineticModifications.KmNumerator:
case InteractionKineticModifications.CLSpecDenominator:
return new Tuple<string, string>(_kiNumeratorAlias, _kiNumeratorParameter);
return (_kiNumeratorAlias, _kiNumeratorParameter);
default:
throw new ArgumentOutOfRangeException("kineticModification");
throw new ArgumentOutOfRangeException(nameof(kineticModification));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/PKSim.Core/Services/InteractionTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface IInteractionTask
/// named <paramref name="moleculeName" />
/// having the type <paramref name="interactionType" />. If <paramref name="compoundName" /> is specified, all
/// <see cref="InteractionProcess" /> induced by a compound
/// named <paramref name="compoundName" /> will be filtered out (defacto removing autoihibiting processes)
/// named <paramref name="compoundName" /> will be filtered out (defacto removing auto-inhibiting processes)
/// </summary>
IReadOnlyList<InteractionProcess> AllInteractionProcessesFor(string moleculeName, InteractionType interactionType, Simulation simulation, string compoundName = null);
}
Expand Down Expand Up @@ -70,7 +70,7 @@ public virtual bool IsMetabolite(Compound compound, Simulation simulation)
public virtual IEnumerable<IContainer> AllInteractionContainers(Simulation simulation)
{
var model = simulation.Model;
if (model == null || model.Root == null)
if (model?.Root == null)
yield break;

foreach (var interactionSelection in simulation.InteractionProperties.AllEnabledInteractions())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace PKSim.Core.Services
{
/// <summary>
/// Represents the updater for irreversibleinhibition processes only
/// Represents the updater for irreversible inhibition processes only
/// </summary>
public class IrreversibleInhibitionKineticUpdaterSpecification : InteractionKineticUpdaterSpecificationBase
{
Expand All @@ -15,7 +15,8 @@ public IrreversibleInhibitionKineticUpdaterSpecification(IObjectPathFactory obje
kiNumeratorParameter: CoreConstants.Parameters.KI,
kiDenominatorAlias: CoreConstants.Alias.IRREVERSIBLE_INHIBITION_KI,
kiDenominatorParameter: CoreConstants.Parameters.KI,
inhibitorAlias: CoreConstants.Alias.IRREVERSIBLE_INHIBITION_I)
inhibitorAlias: CoreConstants.Alias.IRREVERSIBLE_INHIBITION_I,
kWaterAlias:CoreConstants.Alias.IRREVERSIBLE_INHIBITION_K_WATER)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public MixedInhibitionKineticUpdaterSpecification(IObjectPathFactory objectPathF
kiNumeratorParameter: CoreConstants.Parameters.KI_C,
kiDenominatorAlias: CoreConstants.Alias.MIXED_UNCOMPETITIVE_INHIBITION_KI,
kiDenominatorParameter: CoreConstants.Parameters.KI_U,
inhibitorAlias: CoreConstants.Alias.MIXED_COMPETIVE_INHIBITION_I)
inhibitorAlias: CoreConstants.Alias.MIXED_INHIBITION_I,
kWaterAlias: CoreConstants.Alias.MIXED_INHIBITION_K_WATER)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ public class NonCompetitiveInhibitionKineticUpdaterSpecification : InteractionKi
{
public NonCompetitiveInhibitionKineticUpdaterSpecification(IObjectPathFactory objectPathFactory, IDimensionRepository dimensionRepository, IInteractionTask interactionTask) :
base(objectPathFactory, dimensionRepository, interactionTask, InteractionType.NonCompetitiveInhibition,
kiNumeratorAlias: CoreConstants.Alias.NON_COMPETIVE_INHIBITION_KI,
kiNumeratorAlias: CoreConstants.Alias.NON_COMPETITIVE_INHIBITION_KI,
kiNumeratorParameter: CoreConstants.Parameters.KI,
kiDenominatorAlias: CoreConstants.Alias.NON_COMPETIVE_INHIBITION_KI,
kiDenominatorAlias: CoreConstants.Alias.NON_COMPETITIVE_INHIBITION_KI,
kiDenominatorParameter: CoreConstants.Parameters.KI,
inhibitorAlias: CoreConstants.Alias.NON_COMPETIVE_INHIBITION_I)
inhibitorAlias: CoreConstants.Alias.NON_COMPETITIVE_INHIBITION_I,
kWaterAlias:CoreConstants.Alias.NON_COMPETITIVE_INHIBITION_K_WATER)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ public class UncompetitiveInhibitionKineticUpdaterSpecification : InteractionKin
{
public UncompetitiveInhibitionKineticUpdaterSpecification(IObjectPathFactory objectPathFactory, IDimensionRepository dimensionRepository, IInteractionTask interactionTask) :
base(objectPathFactory, dimensionRepository, interactionTask, InteractionType.UncompetitiveInhibition,
kiNumeratorAlias: CoreConstants.Alias.UNCOMPETIVE_INHIBITION_KI,
kiNumeratorAlias: CoreConstants.Alias.UNCOMPETITIVE_INHIBITION_KI,
kiNumeratorParameter: CoreConstants.Parameters.KI,
kiDenominatorAlias: CoreConstants.Alias.UNCOMPETIVE_INHIBITION_KI,
kiDenominatorAlias: CoreConstants.Alias.UNCOMPETITIVE_INHIBITION_KI,
kiDenominatorParameter: CoreConstants.Parameters.KI,
inhibitorAlias: CoreConstants.Alias.UNCOMPETIVE_INHIBITION_I)
inhibitorAlias: CoreConstants.Alias.UNCOMPETITIVE_INHIBITION_I,
kWaterAlias:CoreConstants.Alias.UNCOMPETITIVE_INHIBITION_K_WATER)
{
}
}
Expand Down
62 changes: 0 additions & 62 deletions src/PKSim.Presentation/DTO/Simulations/SimulationIntervalDTO.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ protected override bool ColumnIsButton(GridColumn column)
{
return Equals(_colButtons?.XtraColumn, column);
}



protected override bool ColumnIsCheckBox(GridColumn column)
{
return Equals(_colDefault?.XtraColumn, column);
}

public override void InitializeResources()
{
base.InitializeResources();
Expand Down
Loading

0 comments on commit b305b16

Please sign in to comment.