Problems with Gonum offical page

30 views
Skip to first unread message

Kamil Ziemian

unread,
Mar 30, 2023, 12:33:03 PM3/30/23
to gonum-dev
Hello,

I try to learn how to use Gonum, mainly for writing few programs in my past time. Now I try to read information on https://www.gonum.org/.

In my case when I try to open slides for „Talk -> Introduction to Go and Concurrency talk” I get error Error accessing api.github.com.
403: (https://api.github.com/repos/gonum/talks).

Best regards,
Kamil Ziemian

Dan Kortschak

unread,
Mar 30, 2023, 4:29:05 PM3/30/23
to gonu...@googlegroups.com
The service that we use for that is very old and possibly a little
brittle. It was not working for me yesterday, but I tried again today
and it is working now. If it does not for you in the future you can
view the slide locally using the present tool.

https://pkg.go.dev/golang.org/x/tools/cmd/present

Having said that, I'm not sure how much information there is in talks
that will help with learning how to use Gonum. The talks were more
community engagement talks.

Dan

Sebastien Binet

unread,
Mar 31, 2023, 3:37:16 AM3/31/23
to Dan Kortschak, gonu...@googlegroups.com
hi,

On Thu Mar 30, 2023 at 22:28 CET, 'Dan Kortschak' via gonum-dev wrote:
> On Thu, 2023-03-30 at 09:33 -0700, Kamil Ziemian wrote:
> > Hello,
> >
> > I try to learn how to use Gonum, mainly for writing few programs in
> > my past time. Now I try to read information on
> > https://www.gonum.org/.
> >
> > In my case when I try to open slides for „Talk -> Introduction to Go
> > and Concurrency talk” I get error Error accessing api.github.com.
> > 403: (https://api.github.com/repos/gonum/talks).
> >
> > Best regards,
> > Kamil Ziemian
>
> The service that we use for that is very old and possibly a little
> brittle. It was not working for me yesterday, but I tried again today
> and it is working now. If it does not for you in the future you can
> view the slide locally using the present tool.
>
> https://pkg.go.dev/golang.org/x/tools/cmd/present

"recently" the talks.godoc.org web server (that serves .slide files via
'present') has been indeed very flaky.
I believe it's because they are now using the public github API which is
rate limited (so one quickly reaches the limit).

I have migrated all my talks to my own present server.

For Gonum, we could perhaps consider either doing the same (but we'd
need to have access to the server to run 'present') or convert all the
.slide talks into .pdf talks (and serve them from the web).
If the latter, we'd probably loose some of the nice interactivity that
comes with 'present' though (running Go code).

> Having said that, I'm not sure how much information there is in talks
> that will help with learning how to use Gonum. The talks were more
> community engagement talks.

agreed.

-s

Kamil Ziemian

unread,
Apr 2, 2023, 2:02:56 PM4/2/23
to gonum-dev
Hello,

Thank you for you response. I have another, probably silly question.

I created go module by calling in empty directory
`go mod init example.com/TestGoNum'
The I run
`go get gonum.org/v1/gonum@latest'
and
`go get -u gonum.org/v1/gonum@latest'

After that when I run
`go test gonum.org/v1/gonume'
I get
"?   gonum.org/v1/gonum [no test files]"

When I run in the same directory
`go get gonum.org/v1/plot@latest'
and then
`got test gonum.org/v1/plot'
I get
"# gonum.org/v1/plot
/home/kamil/go/pkg/mod/gonum.org/v1/pl...@v0.12.0/cmpimg/cmpimg.go:19:2: missing go.sum entry for module providing package rsc.io/pdf (imported by gonum.org/v1/plot/cmpimg); to add: ..."

I run
`go get gonum.org/v1/plot/cmp...@v0.12.0'
and after that
`got test gonum.org/v1/plot'
result in series of failures.
"--- FAIL: TestAxisPadding (0.00s)
    --- FAIL: TestAxisPadding/padding-0 (0.00s)
        axis_test.go:169: error: open testdata/axis_padding_00.png: permission denied ..."

Can I ask you for a little help? I feel lost in what is going on with these packages.

Best regards,
Kamil Ziemian

Kamil Ziemian

unread,
Apr 2, 2023, 2:24:24 PM4/2/23
to gonum-dev
I want to add, that despite `gonum.org/v1/plot' tests failed, the first example from the page https://github.com/gonum/plot/wiki/Example-plots compile and provide excepted PNG file.

Best regards,
Kamil Ziemian

Dan Kortschak

unread,
Apr 2, 2023, 4:52:05 PM4/2/23
to gonu...@googlegroups.com
On Sun, 2023-04-02 at 11:02 -0700, Kamil Ziemian wrote:
> Hello,
>
> Thank you for you response. I have another, probably silly question.
>
> I created go module by calling in empty directory
> `go mod init example.com/TestGoNum'
> The I run
> `go get gonum.org/v1/gonum@latest'
> and
> `go get -u gonum.org/v1/gonum@latest'
>
> After that when I run
> `go test gonum.org/v1/gonume'
> I get
> "?   gonum.org/v1/gonum [no test files]"
>

gonum.org/v1/gonum has no tests, the packages under that directory do,
so to test the entire suite, do `go test gonum.org/v1/gonum/...` (note
the elipsis in the path).

> When I run in the same directory
> `go get gonum.org/v1/plot@latest'
> and then
> `got test gonum.org/v1/plot'
> I get
> "# gonum.org/v1/plot
> /home/kamil/go/pkg/mod/gonum.org/v1/pl...@v0.12.0/cmpimg/cmpimg.go:19:
> 2: missing go.sum entry for module providing package rsc.io/pdf
> (imported by gonum.org/v1/plot/cmpimg); to add: ..."
>
> I run
> `go get gonum.org/v1/plot/cmp...@v0.12.0'
> and after that
> `got test gonum.org/v1/plot'
> result in series of failures.
> "--- FAIL: TestAxisPadding (0.00s)
>     --- FAIL: TestAxisPadding/padding-0 (0.00s)
>         axis_test.go:169: error: open testdata/axis_padding_00.png:
> permission denied ..."
>

It looks to me like you are running into problems with understanding
how modules work (this is a Go-wide thing, see https://go.dev/ref/mod)

The error you are seeing is coming from here
https://github.com/gonum/plot/blob/c76e89136f1c72e340b8d6c46d229a6e0ab1092b/axis_test.go#L167
due to a filesystem permission. Given what you've written, I suspect
that you are attempting to work in the mod/ directories which are read-
only. I've just replicated this and it seems like a sharp edge on how
modules interact with testing that writes to the filesystem.

In order to be able to run tests, clone the repos that you want to run
tests with to wherever you are keeping your Go source code (for sanity
I would recommend this be at $(go env GOPATH)/src/, so you'd find Gonum
plot at $(go env GOPATH)/src/gonum.org/v1/plot. Then when you run tests
you are in a rw file system. Run the tests from within cloned module.

> Can I ask you for a little help? I feel lost in what is going on with
> these packages.

Can I ask what level of experience you have with Go? It feels like you
are bumping up against aspects of the language rather than aspects of
Gonum. If this is the case, I'd strongly recommend you try the Go Tour,
https://go.dev/tour/

Dan

Kamil Ziemian

unread,
Apr 2, 2023, 5:03:32 PM4/2/23
to gonum-dev
"Can I ask what level of experience you have with Go?"
Yes of course. I think I'm intermediate when it come to Go language, but things that you can (?) call Go toolchain are my weak spot. It is not surprise that I have a problem with modules.

Good information is that I now can create some plots by writing Go program, which removes a big stumbling block that I had, when trying to solve my problems with Go and its libraries. As such, I shouldn't take your time in upcoming future.

Thank you very much for all help.

Best regards,
Kamil
Reply all
Reply to author
Forward
0 new messages