Beispiel #1
0
        protected override void Context()
        {
            _pivotAnalysis = new PopulationPivotAnalysis();
            _pivotAnalysis.Add(_genderField);
            _pivotAnalysis.Add(_raceField);
            _pivotAnalysis.Add(_bmiField);
            _pivotAnalysis.Add(_cmaxField);
            var grouping = new FixedLimitsGroupingDefinition(_bmiField.Name);

            grouping.SetLimits(new[] { 25d }.OrderBy(x => x));
            grouping.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _bmiClass = new PopulationAnalysisGroupingField(grouping)
            {
                Name = "BMI class"
            };
            _pivotAnalysis.Add(_bmiClass);
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _pivotResultCreator  = A.Fake <IPivotResultCreator>();
            var userSettings = A.Fake <ICoreUserSettings>();

            userSettings.NumberOfIndividualsPerBin = 1;
            userSettings.NumberOfBins = 2;
            _binIntervalsCreator      = new BinIntervalsCreator(userSettings);
            sut = new RangeChartDataCreator(_dimensionRepository, _pivotResultCreator, _binIntervalsCreator);
        }
        protected override void Context()
        {
            _pivotAnalysis = new PopulationBoxWhiskerAnalysis();
            _aggregate     = AggregationFunctions.BoxWhisker90Aggregation;
            _pivotAnalysis.Add(_genderField);
            _pivotAnalysis.Add(_raceField);
            _pivotAnalysis.Add(_bmiField);
            _pivotAnalysis.Add(_cmaxField);
            var grouping = new FixedLimitsGroupingDefinition(_bmiField.Name);

            grouping.SetLimits(new[] { 25d }.OrderBy(x => x));
            grouping.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _bmiClass = new PopulationAnalysisGroupingField(grouping)
            {
                Name = "BMI class"
            };
            _pivotAnalysis.Add(_bmiClass);
            _pivotAnalysis.SetPosition(_genderField, PivotArea.RowArea, 0);
            _pivotAnalysis.SetPosition(_raceField, PivotArea.RowArea, 1);
            _pivotAnalysis.SetPosition(_bmiClass, PivotArea.ColumnArea, 0);
            _pivotAnalysis.SetPosition(_cmaxField, PivotArea.DataArea, 0);
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _pivotResultCreator  = A.Fake <IPivotResultCreator>();
            sut = new BoxWhiskerChartDataCreator(_dimensionRepository, _pivotResultCreator);
        }
Beispiel #3
0
        protected override void Context()
        {
            sut = new PopulationAnalysisFlatTableCreator();
            _populationDataCollector = A.Fake <PopulationSimulationComparison>();
            _populationAnalysis      = new PopulationPivotAnalysis();

            _ageField = new PopulationAnalysisParameterField {
                ParameterPath = "Path", Name = "Age"
            };
            _populationAnalysis.Add(_ageField);

            //add derived field age class
            var groupingDefinition = new FixedLimitsGroupingDefinition("Age");

            groupingDefinition.SetLimits(new[] { 14d }.OrderBy(x => x));
            groupingDefinition.AddItems(new[]
            {
                new GroupingItem {
                    Label = "Children", Color = Color.Blue
                },
                new GroupingItem {
                    Label = "Adults", Color = Color.Red
                }
            });
            _ageClassField = new PopulationAnalysisGroupingField(groupingDefinition)
            {
                Name = "AgeClass"
            };
            _populationAnalysis.Add(_ageClassField);

            _ageValues = new List <double> {
                8d, 14d, 21d
            };
            _ageClassValues = new[] { "Children", "Adults", "Adults" };
        }
Beispiel #4
0
 protected override void Context()
 {
     base.Context();
     _cloneManager = A.Fake <ICloneManager>();
     _sourceFixedLimitDefinition = new FixedLimitsGroupingDefinition("Field");
     _sourceFixedLimitDefinition.SetLimits(new [] { 1.5, 2.5 }.OrderBy(x => x));
     _sourceFixedLimitDefinition.Dimension   = DomainHelperForSpecs.TimeDimensionForSpecs();
     _sourceFixedLimitDefinition.DisplayUnit = _sourceFixedLimitDefinition.Dimension.Unit("h");
 }
Beispiel #5
0
        protected override void Context()
        {
            _populationDataCollector = A.Fake <IPopulationDataCollector>();
            _populationAnalysis      = A.Fake <PopulationAnalysis>();
            A.CallTo(() => _populationDataCollector.NumberOfItems).Returns(100);
            _numericField = A.Fake <PopulationAnalysisNumericField>();

            A.CallTo(() => _populationAnalysis.FieldByName(_fieldName)).Returns(_numericField);
            _fixedLimitsGroupingDefinition = new FixedLimitsGroupingDefinition(_fieldName);
            _fixedLimitsGroupingDefinition.AddItems(PopulationAnalysisHelperForSpecs.AgeGroups);
            _fixedLimitsGroupingDefinition.SetLimits((new[] { 14D, 18D }).OrderBy(x => x));

            _dt = createData();
            A.CallTo(() => _numericField.GetValues(_populationDataCollector)).Returns(_dt.AllValuesInColumn <double>(_fieldName).ToList());
            sut = new PopulationAnalysisGroupingField(_fixedLimitsGroupingDefinition)
            {
                Name = _sutName
            };
        }
        protected override void Context()
        {
            base.Context();
            _groupingDefinition = new FixedLimitsGroupingDefinition(_field.Name);
            _groupingDefinition.SetLimits(new[] { 1d, 2d }.OrderBy(x => x));
            _groupingDefinition.AddItem(new GroupingItem {
                Label = "Label1"
            });
            _groupingDefinition.AddItem(new GroupingItem {
                Label = "Label2"
            });
            _groupingDefinition.AddItem(new GroupingItem {
                Label = "Label3"
            });

            A.CallTo(() => _dimension.BaseUnitValueToUnitValue(_unit, 1d)).Returns(10);
            A.CallTo(() => _dimension.BaseUnitValueToUnitValue(_unit, 2d)).Returns(20);

            sut.InitializeWith(_field, _populationDataCollector);
        }
Beispiel #7
0
        protected override void Context()
        {
            _pivotAnalysis = new PopulationPivotAnalysis();
            _pivotAnalysis.Add(_genderField);
            _pivotAnalysis.Add(_raceField);
            _pivotAnalysis.Add(_bmiField);
            _pivotAnalysis.Add(_cmaxField);
            var grouping = new FixedLimitsGroupingDefinition(_bmiField.Name);

            grouping.SetLimits(new[] { 25d }.OrderBy(x => x));
            grouping.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _bmiClass = new PopulationAnalysisGroupingField(grouping)
            {
                Name = "BMI class"
            };
            _pivotAnalysis.Add(_bmiClass);
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _pivotResultCreator  = A.Fake <IPivotResultCreator>();
            sut = new ScatterChartDataCreator(_dimensionRepository, _pivotResultCreator);
        }
Beispiel #8
0
        protected override Task Context()
        {
            _dimensionRepository = A.Fake <IDimensionRepository>();
            sut            = new GroupingDefinitionMapper(_dimensionRepository);
            _groupingItem1 = new GroupingItem();
            _groupingItem2 = new GroupingItem();

            _dimension = DomainHelperForSpecs.TimeDimensionForSpecs();
            _unit      = _dimension.Unit("h");

            A.CallTo(() => _dimensionRepository.DimensionByName(_dimension.Name)).Returns(_dimension);
            _valueMappingGrouping = new ValueMappingGroupingDefinition("F1");
            _valueMappingGrouping.AddValueLabel("Item1", _groupingItem1);
            _valueMappingGrouping.AddValueLabel("Item2", _groupingItem2);

            _fixedLimitGrouping = new FixedLimitsGroupingDefinition("F1")
            {
                DisplayUnit = _unit,
                Dimension   = _dimension,
            };

            _fixedLimitGrouping.SetLimits(new[] { 60, 120.0 }.OrderBy(x => x));
            _fixedLimitGrouping.AddItem(_groupingItem1);
            _fixedLimitGrouping.AddItem(_groupingItem2);

            _numberOfBinsGrouping = new NumberOfBinsGroupingDefinition("F1")
            {
                DisplayUnit   = _unit,
                Dimension     = _dimension,
                NumberOfBins  = 4,
                NamingPattern = "TOTO",
                StartColor    = Color.Aqua,
                EndColor      = Color.Red,
                Strategy      = LabelGenerationStrategies.Numeric
            };

            _numberOfBinsGrouping.AddItem(_groupingItem1);
            _numberOfBinsGrouping.AddItem(_groupingItem2);

            return(_completed);
        }
Beispiel #9
0
 private void mapFixedLimitsGroupingToModel(SnapshotGroupingDefinition snapshot, FixedLimitsGroupingDefinition groupingDefinition)
 {
     mapIntervalGroupingToModel(snapshot, groupingDefinition);
     groupingDefinition.SetLimits(groupingDefinition.ConvertToBaseValues(snapshot.Limits).OrderBy(x => x));
 }
Beispiel #10
0
 public void UpdateGroupingDefinition()
 {
     _groupingDefinition.Items.Clear();
     _groupingDefinition.SetLimits(calculateLimits().OrderBy(x => x));
     _groupingDefinition.AddItems(_fixedLimitDTOs.Select(x => x.ToGroupingItem()));
 }
        public override void GlobalContext()
        {
            base.GlobalContext();
            _populationAnalysis = new PopulationPivotAnalysis();

            _pkParameterField              = new PopulationAnalysisPKParameterField().WithName("PKParam");
            _pkParameterField.PKParameter  = "AUC";
            _pkParameterField.QuantityPath = "A|B|C";
            _pkParameterField.QuantityType = QuantityType.Drug;
            _pkParameterField.Dimension    = _dimensionRepository.MassConcentration;

            _parameterField = new PopulationAnalysisParameterField().WithName("Param");
            _parameterField.ParameterPath = "A|B|C|D";
            _parameterField.Dimension     = _dimensionRepository.Auc;

            _outputField = new PopulationAnalysisOutputField().WithName("Output");
            _outputField.QuantityPath = "A|B|C";
            _outputField.Dimension    = _dimensionRepository.Auc;
            _outputField.Color        = Color.Aquamarine;

            _genderField = new PopulationAnalysisCovariateField {
                Covariate = "Gender"
            }.WithName("Gender");
            var numberOfBinsGroupingDefinition = new NumberOfBinsGroupingDefinition(_parameterField.Name)
            {
                NumberOfBins = 2
            };

            numberOfBinsGroupingDefinition.NamingPattern = "AA";
            numberOfBinsGroupingDefinition.StartColor    = Color.AliceBlue;
            numberOfBinsGroupingDefinition.EndColor      = Color.RoyalBlue;
            numberOfBinsGroupingDefinition.Strategy      = LabelGenerationStrategies.Roman;
            numberOfBinsGroupingDefinition.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _numberOfBinsDerivedField = new PopulationAnalysisGroupingField(numberOfBinsGroupingDefinition).WithName("NumberOfBins");

            var fixedLimitsGroupingDefinition = new FixedLimitsGroupingDefinition(_pkParameterField.Name);

            fixedLimitsGroupingDefinition.AddItems(PopulationAnalysisHelperForSpecs.AgeGroups);

            _fixedLimitsGroupingDefinitionField = new PopulationAnalysisGroupingField(fixedLimitsGroupingDefinition)
                                                  .WithName("FixedLimits");

            fixedLimitsGroupingDefinition.SetLimits(new[] { 1d, 2d }.OrderBy(x => x));

            _derivedFieldWithFixedExpression = new PopulationAnalysisExpressionField("A+B")
                                               .WithName("FixedExpression");


            var valueMappingGroupingDefinition = new ValueMappingGroupingDefinition(_genderField.Name);

            valueMappingGroupingDefinition.AddValueLabel("Male", PopulationAnalysisHelperForSpecs.GroupingItemMale);
            valueMappingGroupingDefinition.AddValueLabel("Female", PopulationAnalysisHelperForSpecs.GroupingItemFemale);
            var valueMappingGroupingDefinitionField = new PopulationAnalysisGroupingField(valueMappingGroupingDefinition).WithName("ValueMapping");

            _populationAnalysis.Add(_pkParameterField);
            _populationAnalysis.Add(_parameterField);
            _populationAnalysis.Add(_genderField);
            _populationAnalysis.Add(_numberOfBinsDerivedField);
            _populationAnalysis.Add(_fixedLimitsGroupingDefinitionField);
            _populationAnalysis.Add(_derivedFieldWithFixedExpression);
            _populationAnalysis.Add(valueMappingGroupingDefinitionField);
            _populationAnalysis.Add(_outputField);
        }