Skip to content

Commit

Permalink
Merge pull request #256 from AQLT/develop
Browse files Browse the repository at this point in the history
benchmarking output for jdr
  • Loading branch information
palatej authored Nov 6, 2024
2 parents 2ed5a3c + b60e1ab commit 8457377
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2017 National Bank of Belgium
*
* Licensed under the EUPL, Version 1.2 or – as soon they will be approved
* by the European Commission - subsequent versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* https://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package ec.tstoolkit.jdr.sa;

import jd2.information.InformationMapping;
import ec.tstoolkit.timeseries.simplets.TsData;
import ec.satoolkit.benchmarking.SaBenchmarkingResults;

/**
*
* @author Alain Quartier la Tente
*/
@lombok.experimental.UtilityClass
public class SaBenchmarkingResultsInfo {

final InformationMapping<SaBenchmarkingResults> MAPPING = new InformationMapping<>(SaBenchmarkingResults.class);

public InformationMapping<SaBenchmarkingResults> getMapping() {
return MAPPING;
}

static {
MAPPING.set("original", TsData.class, source -> source.getOriginalSeries());
MAPPING.set("target", TsData.class, source -> source.getTarget());
MAPPING.set("result", TsData.class, source -> source.getBenchmarkedSeries());
}

}
8 changes: 6 additions & 2 deletions jdr/src/main/java/ec/tstoolkit/jdr/sa/TramoSeatsResults.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
import ec.satoolkit.GenericSaProcessingFactory;
import ec.satoolkit.ISeriesDecomposition;
import ec.satoolkit.algorithm.implementation.TramoSeatsProcessingFactory;
import ec.satoolkit.algorithm.implementation.X13ProcessingFactory;
import ec.satoolkit.seats.SeatsResults;
import ec.satoolkit.x11.X11Results;
import ec.satoolkit.benchmarking.SaBenchmarkingResults;
import ec.tstoolkit.algorithm.CompositeResults;
import ec.tstoolkit.jdr.mapping.PreprocessingInfo;
import ec.tstoolkit.jdr.seats.SeatsInfo;
Expand All @@ -31,6 +30,7 @@ public class TramoSeatsResults implements IProcResults {
SaDiagnostics diagnostics;
CoherenceDiagnostics coherence;
ResidualsDiagnostics residuals;
SaBenchmarkingResults benchmarking;

SaDiagnostics diagnostics() {
synchronized (results) {
Expand Down Expand Up @@ -78,6 +78,9 @@ SeatsResults seats() {
return results == null ? null : results.get(TramoSeatsProcessingFactory.DECOMPOSITION, SeatsResults.class);
}

SaBenchmarkingResults benchmarking() {
return results == null ? null : results.get(TramoSeatsProcessingFactory.BENCHMARKING, SaBenchmarkingResults.class);
}
static final InformationMapping<TramoSeatsResults> MAPPING = new InformationMapping<>(TramoSeatsResults.class);

static {
Expand All @@ -87,6 +90,7 @@ SeatsResults seats() {
MAPPING.delegate("diagnostics", SaDiagnostics.getMapping(), source -> source.diagnostics());
MAPPING.delegate("coherence", CoherenceDiagnostics.getMapping(), source -> source.coherence());
MAPPING.delegate("residuals", ResidualsDiagnostics.getMapping(), source -> source.residuals());
MAPPING.delegate("benchmarking", SaBenchmarkingResultsInfo.getMapping(), source -> source.benchmarking());
}

public InformationMapping<TramoSeatsResults> getMapping() {
Expand Down
7 changes: 7 additions & 0 deletions jdr/src/main/java/ec/tstoolkit/jdr/sa/X13Results.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import ec.satoolkit.algorithm.implementation.X13ProcessingFactory;
import ec.satoolkit.x11.Mstatistics;
import ec.satoolkit.x11.X11Results;
import ec.satoolkit.benchmarking.SaBenchmarkingResults;
import ec.tstoolkit.algorithm.CompositeResults;
import ec.tstoolkit.jdr.mapping.PreprocessingInfo;
import ec.tstoolkit.jdr.x11.X11DecompositionInfo;
Expand All @@ -30,6 +31,7 @@ public class X13Results implements IProcResults {
SaDiagnostics diagnostics;
CoherenceDiagnostics coherence;
ResidualsDiagnostics residuals;
SaBenchmarkingResults benchmarking;

SaDiagnostics diagnostics() {
if (diagnostics == null && results != null) {
Expand Down Expand Up @@ -78,6 +80,10 @@ X11Results x11() {
Mstatistics mstats() {
return results == null ? null : results.get(X13ProcessingFactory.MSTATISTICS, Mstatistics.class);
}

SaBenchmarkingResults benchmarking() {
return results == null ? null : results.get(X13ProcessingFactory.BENCHMARKING, SaBenchmarkingResults.class);
}
static final InformationMapping<X13Results> MAPPING = new InformationMapping<>(X13Results.class);

static {
Expand All @@ -88,6 +94,7 @@ Mstatistics mstats() {
MAPPING.delegate("diagnostics", SaDiagnostics.getMapping(), source -> source.diagnostics());
MAPPING.delegate("coherence", CoherenceDiagnostics.getMapping(), source -> source.coherence());
MAPPING.delegate("residuals", ResidualsDiagnostics.getMapping(), source -> source.residuals());
MAPPING.delegate("benchmarking", SaBenchmarkingResultsInfo.getMapping(), source -> source.benchmarking());
}

public InformationMapping<X13Results> getMapping() {
Expand Down

0 comments on commit 8457377

Please sign in to comment.