Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-haz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-haz
Commits
0aa6a294
Commit
0aa6a294
authored
1 year ago
by
Powers, Peter M.
Browse files
Options
Downloads
Patches
Plain Diff
added carriage return
parent
b9e02c08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!772
Increment lib and test updates
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/gov/usgs/earthquake/nshmp/model/NshmTestUtils.java
+9
-4
9 additions, 4 deletions
...t/java/gov/usgs/earthquake/nshmp/model/NshmTestUtils.java
with
9 additions
and
4 deletions
src/test/java/gov/usgs/earthquake/nshmp/model/NshmTestUtils.java
+
9
−
4
View file @
0aa6a294
...
@@ -10,6 +10,7 @@ import java.nio.file.Files;
...
@@ -10,6 +10,7 @@ import java.nio.file.Files;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
...
@@ -28,6 +29,7 @@ import com.google.gson.JsonObject;
...
@@ -28,6 +29,7 @@ import com.google.gson.JsonObject;
import
com.google.gson.JsonParser
;
import
com.google.gson.JsonParser
;
import
gov.usgs.earthquake.nshmp.NamedLocation
;
import
gov.usgs.earthquake.nshmp.NamedLocation
;
import
gov.usgs.earthquake.nshmp.Text
;
import
gov.usgs.earthquake.nshmp.calc.CalcConfig
;
import
gov.usgs.earthquake.nshmp.calc.CalcConfig
;
import
gov.usgs.earthquake.nshmp.calc.Hazard
;
import
gov.usgs.earthquake.nshmp.calc.Hazard
;
import
gov.usgs.earthquake.nshmp.calc.HazardCalcs
;
import
gov.usgs.earthquake.nshmp.calc.HazardCalcs
;
...
@@ -35,7 +37,6 @@ import gov.usgs.earthquake.nshmp.calc.Site;
...
@@ -35,7 +37,6 @@ import gov.usgs.earthquake.nshmp.calc.Site;
import
gov.usgs.earthquake.nshmp.data.XySequence
;
import
gov.usgs.earthquake.nshmp.data.XySequence
;
import
gov.usgs.earthquake.nshmp.geo.Location
;
import
gov.usgs.earthquake.nshmp.geo.Location
;
import
gov.usgs.earthquake.nshmp.gmm.Imt
;
import
gov.usgs.earthquake.nshmp.gmm.Imt
;
import
io.swagger.v3.core.util.Yaml
;
import
io.swagger.v3.core.util.Yaml
;
/**
/**
...
@@ -101,7 +102,9 @@ class NshmTestUtils {
...
@@ -101,7 +102,9 @@ class NshmTestUtils {
static
void
writeExpecteds
(
NshmModel
nshmModel
,
Optional
<
Path
>
dataPath
)
throws
IOException
{
static
void
writeExpecteds
(
NshmModel
nshmModel
,
Optional
<
Path
>
dataPath
)
throws
IOException
{
for
(
NamedLocation
location
:
nshmModel
.
nshm
.
locations
())
{
for
(
NamedLocation
location
:
nshmModel
.
nshm
.
locations
())
{
Map
<
String
,
XySequence
>
xyMap
=
generateActual
(
nshmModel
,
location
);
Map
<
String
,
XySequence
>
xyMap
=
generateActual
(
nshmModel
,
location
);
String
json
=
GSON
.
toJson
(
xyMap
);
String
json
=
new
StringBuilder
(
GSON
.
toJson
(
xyMap
))
.
append
(
Text
.
NEWLINE
)
.
toString
();
writeExpected
(
nshmModel
.
nshm
,
location
,
json
,
dataPath
);
writeExpected
(
nshmModel
.
nshm
,
location
,
json
,
dataPath
);
}
}
}
}
...
@@ -164,8 +167,10 @@ class NshmTestUtils {
...
@@ -164,8 +167,10 @@ class NshmTestUtils {
Map
<
String
,
XySequence
>
xyMap
=
hazard
.
curves
().
entrySet
().
stream
()
Map
<
String
,
XySequence
>
xyMap
=
hazard
.
curves
().
entrySet
().
stream
()
.
collect
(
Collectors
.
toMap
(
.
collect
(
Collectors
.
toMap
(
e
->
e
.
getKey
().
toString
(),
e
->
e
.
getKey
().
name
(),
Entry:
:
getValue
));
Entry:
:
getValue
,
(
o1
,
o2
)
->
o1
,
LinkedHashMap:
:
new
));
// preserve IMT enum order
return
xyMap
;
return
xyMap
;
}
}
...
...
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