Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
leximpact-socio-fiscal-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leximpact
Simulateur socio-fiscal
leximpact-socio-fiscal-ui
Commits
f06cfb65
Commit
f06cfb65
authored
9 months ago
by
Toufic Batache
Committed by
Emmanuel Raviart
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Replace sendTestCasesSimulation() map with for loop
parent
8b5225cc
No related branches found
No related tags found
1 merge request
!273
Passage à Svelte 5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/shared.svelte.ts
+23
-33
23 additions, 33 deletions
src/lib/shared.svelte.ts
with
23 additions
and
33 deletions
src/lib/shared.svelte.ts
+
23
−
33
View file @
f06cfb65
...
@@ -751,16 +751,13 @@ async function sendTestCasesSimulation(
...
@@ -751,16 +751,13 @@ async function sendTestCasesSimulation(
// Split evaluation.value vector for each situation.
// Split evaluation.value vector for each situation.
{
{
let
testCasesPopulationIndex
=
0
let
testCasesPopulationIndex
=
0
valuesByCalculationNameByVariableNameArray
=
for
(
const
[
valuesByCalculationNameByVariableNameArray
.
map
(
(
valuesByCalculationNameByVariableName
,
situationIndex
,
situationIndex
,
):
ValuesByCalculationNameByVariableName
=>
{
valuesByCalculationNameByVariableName
,
]
of
valuesByCalculationNameByVariableNameArray
.
entries
())
{
const
situation
=
shared
.
testCases
[
situationIndex
]
const
situation
=
shared
.
testCases
[
situationIndex
]
const
entitySituation
=
const
entitySituation
=
situation
[
entity
.
key_plural
as
string
]
??
{}
situation
[
entity
.
key_plural
as
string
]
??
{}
const
values
:
VariableValues
=
[]
let
values
=
[]
for
(
for
(
let
index
=
testCasesPopulationIndex
,
vectorIndex
=
0
;
let
index
=
testCasesPopulationIndex
,
vectorIndex
=
0
;
vectorIndex
<
shared
.
vectorLength
;
vectorIndex
<
shared
.
vectorLength
;
...
@@ -773,17 +770,10 @@ async function sendTestCasesSimulation(
...
@@ -773,17 +770,10 @@ async function sendTestCasesSimulation(
}
}
}
}
testCasesPopulationIndex
+=
Object
.
keys
(
entitySituation
).
length
testCasesPopulationIndex
+=
Object
.
keys
(
entitySituation
).
length
const
valuesByCalculationName
=
;(
valuesByCalculationNameByVariableName
[
variableName
]
??=
{})[
valuesByCalculationNameByVariableName
[
variableName
]
??
{}
calculationName
return
{
]
=
values
...
valuesByCalculationNameByVariableName
,
[
variableName
]:
{
...
valuesByCalculationName
,
[
calculationName
]:
values
,
},
}
}
},
)
}
}
}
else
{
}
else
{
// Variable has been computed for a single test case.
// Variable has been computed for a single test case.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment