~sbinet/go-hep

Re: go-hep yoda2root ?

Sebastien Binet <binet@cern.ch>
Details
Message ID
<CB65C1AEHHT1.2T47ADZX31HJE@zoidberg>
DKIM signature
missing
Download raw message
Matt,

On Thu May 6, 2021 at 13:27 CET, Matt LeBlanc wrote:
> Hi Sebastien,
>
> Thanks for the prompt reply!
>
> I have run >go get go-hep.org/x/hep/cmd/yoda2root, but I still don't
> understand how to run the script. Trying both > yoda2root and > go
> yoda2root seems to find nothing. But, > go list also doesn't show
> anything
> ...
>
> While the compiled binaries are convenient, I am running on an M1 mac,
> so
> it's not clear whether any of them will run.

yeah, the one that's currently on go-hep.org/dist was probably compiled
before support for M1 went into the Go compiler...

new versions of Go (>= 1.16) modified somewhat the workflow to retrieve
binaries from projects.

here is one that works for 1.16:
$> go version
go version go1.16.3 linux/amd64

$> cd /some/where
$> git clone git://github.com/go-hep/hep
$> cd hep
$> git checkout v0.28.4
$> go build -o ~/bin/yoda2root ./cmd/yoda2root

the workflow advertised on go-hep.org (or its README) assumes the
default location of where 'go get' (and its 'go install' cousin) puts
binaries is within $PATH.

this can be checked via:
$> go env
$> go env GOPATH

'go get' will install executables under $GOPATH/bin.

> I did try to run one on
> lxplus
> with my input, but I see the following ...
>
> login:yoda2root mleblanc$ ./yoda2root-linux_amd64.exe TOP-Model0.yoda
> TOP-Model0.root
> panic: interface conversion: interface {} is nil, not string
>
> goroutine 1 [running]:
> go-hep.org/x/hep/groot/rhist.NewH2DFrom(0xc000049800, 0xc000010848)
> /home/binet/dev/hepsw/go/src/go-hep.org/x/hep/groot/rhist/h2_gen.go:499
> +0xcab
> go-hep.org/x/hep/hbook/rootcnv.FromH2D(...)
> /home/binet/dev/hepsw/go/src/go-hep.org/x/hep/hbook/rootcnv/root.go:62
> main.convert(0xc00011f8c0, 0x7fff73545f82, 0xf, 0x0, 0x0)
> /home/binet/dev/hepsw/go/src/go-hep.org/x/hep/cmd/yoda2root/main.go:111
> +0x2c6
> main.main()
> /home/binet/dev/hepsw/go/src/go-hep.org/x/hep/cmd/yoda2root/main.go:66
> +0x24c
>
> ... does this indicate that there's a problem with my input file, or
> could
> there be some other issue?

this may indicate a not-yet-handled use case (looking at the code, it
might indicate the existence of a yoda::Hist2D with a title that Go-HEP
has trouble with.)

I'd be happy to look into it (just drop the yoda file somewhere I can
access, if that's possible)

cheers,
-s
Reply to thread Export thread (mbox)