Skip to content

Commit

Permalink
fix ranking for india (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
n-h-diaz authored Nov 3, 2021
1 parent 3af9291 commit 13f1c4a
Show file tree
Hide file tree
Showing 4 changed files with 18,703 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/server/ranking.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ var StatsRanking = map[RankKey]int{
{"NASA_NEXGDDP_StatVarSeriesAggr", "*", "P1M"}: 0, // IPCC

{"NASA_WetBulbComputation_Aggregation", "NASA_Mean_HadGEM2-AO", "*"}: 0, // Wet bulb year aggregation
{"NASA_WetBulbComputation", "NASA_Mean_HadGEM2-AO", "*"}: 1, // Wet bulb
{"NASA_WetBulbComputation_Aggregation", "*", "*"}: 1, // Wet bulb year aggregation
{"NASA_WetBulbComputation", "NASA_Mean_HadGEM2-AO", "*"}: 2, // Wet bulb
}

// BaseRank is the base ranking score for sources. If a source is prefered, it
Expand Down
2 changes: 2 additions & 0 deletions internal/server/ranking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ func TestSeriesByRank(t *testing.T) {
[]*pb.SourceSeries{
{ImportName: "NASA_WetBulbComputation", MeasurementMethod: "NASA_Mean_CCSM4", ObservationPeriod: "P1Y"},
{ImportName: "NASA_WetBulbComputation", MeasurementMethod: "NASA_Mean_HadGEM2-AO", ObservationPeriod: "P1Y"},
{ImportName: "NASA_WetBulbComputation_Aggregation", MeasurementMethod: "NASA_Mean_ACCESS1-0", ObservationPeriod: "P78Y"},
{ImportName: "NASA_WetBulbComputation_Aggregation", MeasurementMethod: "NASA_Mean_HadGEM2-AO", ObservationPeriod: "P78Y"},
},
[]*pb.SourceSeries{
{ImportName: "NASA_WetBulbComputation_Aggregation", MeasurementMethod: "NASA_Mean_HadGEM2-AO", ObservationPeriod: "P78Y"},
{ImportName: "NASA_WetBulbComputation_Aggregation", MeasurementMethod: "NASA_Mean_ACCESS1-0", ObservationPeriod: "P78Y"},
{ImportName: "NASA_WetBulbComputation", MeasurementMethod: "NASA_Mean_HadGEM2-AO", ObservationPeriod: "P1Y"},
{ImportName: "NASA_WetBulbComputation", MeasurementMethod: "NASA_Mean_CCSM4", ObservationPeriod: "P1Y"},
},
Expand Down
7 changes: 7 additions & 0 deletions test/integration/get_stat_set_within_place_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ func TestGetStatSetWithinPlace(t *testing.T) {
[]string{"Count_Person"},
"world_pop.json",
},
{
"country/USA",
"County",
"",
[]string{"NumberOfMonths_WetBulbTemperature_35COrMore_RCP45_MinRelativeHumidity"},
"wet_bulb.json",
},
} {
resp, err := client.GetStatSetWithinPlace(ctx, &pb.GetStatSetWithinPlaceRequest{
ParentPlace: c.parentPlace,
Expand Down
Loading

0 comments on commit 13f1c4a

Please sign in to comment.