Skip to content
Snippets Groups Projects
Commit 416a4d6f authored by Tucker Gary Siegel's avatar Tucker Gary Siegel
Browse files

update

parent edb4a28c
No related branches found
No related tags found
4 merge requests!24update swagger,!23update swagger documentation,!22test public swagger,!21fix out of bounds
This commit is part of merge request !23. Comments created here will be created in the context of that merge request.
......@@ -249,7 +249,6 @@ func forecast(ctx context.Context, gddReq models.GddRequest, plantdate time.Time
Bins: bins,
}
}
return out
}
......@@ -363,7 +362,6 @@ func CalculateStages(ctx context.Context, request models.StageRequest) map[strin
Product: "CORN",
}
stageMatches := models.BuildStageMatches(request.Mode, request.Value)
// removing for now
// comparisonThread := dispatch.New[map[string]time.Time]()
// go comparisonGoRoutine(gddReq, request.PlantDate, stageMatches, request.Comparison, comparisonThread)
......@@ -381,7 +379,9 @@ func CalculateStages(ctx context.Context, request models.StageRequest) map[strin
// }
compResults := comparisonNormals(ctx, gddReq, request.PlantDate, stageMatches)
for k, v := range compResults {
out[k].ComparisonMean = v
if _, exists := out[k]; exists {
out[k].ComparisonMean = v
}
}
return out
......
......@@ -30,8 +30,11 @@ func GetGddValues(ctx context.Context, request models.GddRequest) models.GddResp
// if request.PlantingDate.Year() >= time.Now().Year() {
pdInt := request.PlantingDate.YearDay() - 1
gdds.MaxTemps = gdds.MaxTemps[pdInt:]
gdds.MinTemps = gdds.MinTemps[pdInt:]
// fmt.Println(pdInt)
if pdInt < len(gdds.MaxTemps) {
gdds.MinTemps = gdds.MinTemps[pdInt:]
gdds.MaxTemps = gdds.MaxTemps[pdInt:]
}
returnGdds := models.GddResponse{
Product: product.Name,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment