Skip to content

Commit 261c68e

Browse files
committed
aep: Log error message for missing input shape
1 parent 0e457f0 commit 261c68e

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

emissions/aep/inventory.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"encoding/gob"
2323
"fmt"
2424
"io"
25+
"log"
2526
"os"
2627
"strconv"
2728
"strings"
@@ -397,7 +398,9 @@ func (e *EmissionsReader) ReadFiles(files []*InventoryFile, f RecFilter) ([]Reco
397398
for _, r := range records {
398399
if ar, ok := r.(sourceDataLocationer); ok {
399400
if err := e.sourceDataLocator.Locate(ar.getSourceDataLocation()); err != nil {
400-
return nil, nil, err
401+
log.Println(err)
402+
continue // Drop records we can't find a location for.
403+
// return nil, nil, err
401404
}
402405
}
403406
recordList[i] = r

emissions/aep/sourcedata.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,11 @@ func (sdl *sourceDataLocator) Locate(sd *SourceDataLocation) error {
146146
return err
147147
}
148148
}
149-
sd.location = sdl.inputShapes[srgSpec][sd.FIPS]
150-
return nil
149+
if l, ok := sdl.inputShapes[srgSpec][sd.FIPS]; ok {
150+
sd.location = l
151+
return nil
152+
}
153+
return fmt.Errorf("aep: missing input shape for spatial surrogate %s%s FIPS %s", srgSpec.region(), srgSpec.code(), sd.FIPS)
151154
}
152155

153156
// Location returns the polygon representing the location of emissions.

0 commit comments

Comments
 (0)