Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show multiple sensitivities in TimeSeriesSensitivities module #301

Merged
merged 22 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
de7fba7
Show multiple sensitivities in TimeSeriesSensitivities module
HansKallekleiv Sep 12, 2023
5f29463
Rename module and template
HansKallekleiv Sep 12, 2023
702d74f
Show/hide historical
HansKallekleiv Sep 13, 2023
789e920
Hide legend in tornado chart
HansKallekleiv Sep 13, 2023
6efd8a8
Set last timeStamp as initially selected
HansKallekleiv Sep 14, 2023
7731850
Use double negation in enabled
HansKallekleiv Sep 14, 2023
8ef9585
Remove unused query
HansKallekleiv Sep 14, 2023
a47b707
use selectednodes
HansKallekleiv Sep 14, 2023
cfa41f6
make it clearer what is currently selected data
HansKallekleiv Sep 14, 2023
29ccf49
Add title
HansKallekleiv Sep 14, 2023
8ddeed6
Only trigger history query if enabled
HansKallekleiv Sep 14, 2023
7133776
Only use sensitivity name in func
HansKallekleiv Sep 14, 2023
a808ce5
remove unused improt
HansKallekleiv Sep 15, 2023
e025de4
from review
HansKallekleiv Sep 21, 2023
fc624d7
Merge remote-tracking branch 'equinor/main' into timeseries-sens-show…
jorgenherje Sep 25, 2023
786aec3
Fix for VectorSelector usage
jorgenherje Sep 26, 2023
3b7314f
Set test env to prod
HansKallekleiv Sep 26, 2023
33f5197
Fix sensitivity change between ensembles
HansKallekleiv Sep 26, 2023
3eb9ee0
fixes
HansKallekleiv Sep 26, 2023
3d40bca
Allow selectedSensitivities array to be empty
jorgenherje Sep 27, 2023
41e7758
Merge remote-tracking branch 'equinor/main' into timeseries-sens-show…
jorgenherje Sep 27, 2023
adaef24
Adjsuted to new VectorSelector path
jorgenherje Sep 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions frontend/src/modules/Sensitivity/queryHooks.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { view } from "./view";
const defaultState: State = {
vectorSpec: null,
resamplingFrequency: Frequency_api.MONTHLY,
selectedSensitivity: null,
selectedSensitivities: null,
showStatistics: true,
showRealizations: false,
realizationsToInclude: null,
showHistorical: true,
};

const module = ModuleRegistry.initModule<State>("SimulationTimeSeriesSensitivity", defaultState);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { Frequency_api, VectorDescription_api, VectorStatisticSensitivityData_api } from "@api";
import {
Frequency_api,
VectorDescription_api,
VectorHistoricalData_api,
VectorStatisticSensitivityData_api,
} from "@api";
import { VectorRealizationData_api } from "@api";
import { apiService } from "@framework/ApiService";
import { UseQueryResult, useQuery } from "@tanstack/react-query";

const STALE_TIME = 60 * 1000;
const CACHE_TIME = 60 * 1000;

export function useVectorsQuery(
export function useVectorListQuery(
caseUuid: string | undefined,
ensembleName: string | undefined
): UseQueryResult<Array<VectorDescription_api>> {
Expand All @@ -15,7 +20,7 @@ export function useVectorsQuery(
queryFn: () => apiService.timeseries.getVectorList(caseUuid ?? "", ensembleName ?? ""),
staleTime: STALE_TIME,
cacheTime: CACHE_TIME,
enabled: caseUuid && ensembleName ? true : false,
enabled: !!(caseUuid && ensembleName),
});
}

Expand Down Expand Up @@ -46,7 +51,7 @@ export function useVectorDataQuery(
),
staleTime: STALE_TIME,
cacheTime: CACHE_TIME,
enabled: caseUuid && ensembleName && vectorName && allOrNonEmptyRealArr ? true : false,
enabled: !!(caseUuid && ensembleName && vectorName && allOrNonEmptyRealArr),
});
}

Expand All @@ -69,6 +74,28 @@ export function useStatisticalVectorSensitivityDataQuery(
),
staleTime: STALE_TIME,
cacheTime: CACHE_TIME,
enabled: allowEnable && caseUuid && ensembleName && vectorName && resampleFrequency ? true : false,
enabled: !!(allowEnable && caseUuid && ensembleName && vectorName && resampleFrequency),
});
}

export function useHistoricalVectorDataQuery(
caseUuid: string | undefined,
ensembleName: string | undefined,
vectorName: string | undefined,
resampleFrequency: Frequency_api | null,
allowEnable: boolean
): UseQueryResult<VectorHistoricalData_api> {
return useQuery({
queryKey: ["getHistoricalVectorData", caseUuid, ensembleName, vectorName, resampleFrequency],
queryFn: () =>
apiService.timeseries.getHistoricalVectorData(
caseUuid ?? "",
ensembleName ?? "",
vectorName ?? "",
resampleFrequency ?? Frequency_api.MONTHLY
),
staleTime: STALE_TIME,
cacheTime: CACHE_TIME,
enabled: !!(allowEnable && caseUuid && ensembleName && vectorName && resampleFrequency),
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { State } from "./state";

ModuleRegistry.registerModule<State>({
moduleName: "SimulationTimeSeriesSensitivity",
defaultTitle: "Simulation time series sensitivity",
defaultTitle: "Simulation time series per sensitivity",
syncableSettingKeys: [SyncSettingKey.ENSEMBLE, SyncSettingKey.TIME_SERIES],
broadcastChannelsDef,
});
Loading