projects
/
lightning.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Accept PDH on command line.
[lightning.git]
/
exportnumpy.go
diff --git
a/exportnumpy.go
b/exportnumpy.go
index c8e9f7cfc59a1743eeec83a56e0228303e6a49ac..39f228a1b0cecc3823128a15183e2b0bdcba62d1 100644
(file)
--- a/
exportnumpy.go
+++ b/
exportnumpy.go
@@
-112,7
+112,7
@@
func (cmd *exportNumpy) RunCommand(prog string, args []string, stdin io.Reader,
retainTileSequences: true,
compactGenomes: map[string][]tileVariantID{},
}
retainTileSequences: true,
compactGenomes: map[string][]tileVariantID{},
}
- err = tilelib.LoadDir(context.Background(), *inputDir
, nil
)
+ err = tilelib.LoadDir(context.Background(), *inputDir)
if err != nil {
return 1
}
if err != nil {
return 1
}
@@
-251,19
+251,23
@@
func (cmd *exportNumpy) RunCommand(prog string, args []string, stdin io.Reader,
return
}
defer f.Close()
return
}
defer f.Close()
- npw, err := gonpy.NewWriter(f)
+ // gonpy closes our writer and ignores errors. Give it a nopCloser so we can close f properly.
+ npw, err := gonpy.NewWriter(nopCloser{f})
if err != nil {
lastErr.Store(err)
return
}
npw.Shape = []int{len(names), len(pdis) * 2}
if err != nil {
lastErr.Store(err)
return
}
npw.Shape = []int{len(names), len(pdis) * 2}
- npw.WriteInt8(data)
- // gonpy closes f and ignores errors, doh.
- // err = f.Close()
- // if err != nil {
- // lastErr.Store(err)
- // return
- // }
+ err = npw.WriteInt8(data)
+ if err != nil {
+ lastErr.Store(err)
+ return
+ }
+ err = f.Close()
+ if err != nil {
+ lastErr.Store(err)
+ return
+ }
}()
}
wg.Wait()
}()
}
wg.Wait()