From 65c5ea9b7d01c295c434db890827349ca247be82 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Mon, 12 Oct 2026 13:15:35 +0200 Subject: [PATCH] Portal landing page for go-scikit The go-* landing kit (go-fleettools/landingkit v0.3.1 as a Hugo module), coloured from the logo's gradient. One page: the stack drawn from the list of member organisations, one card per organisation with its site, docs, source and playground where it has one, nine measured claims each linked to the document that measures it, and a first notebook. The notebook in the hero is example/first.md and its output is example/output.txt; CI runs it again with the versions example/go.mod pins and fails if the output differs. NumPy 2.5.4 / SciPy 1.18.1 print the same three quartiles for norm.rvs(10, 2, size=1000, default_rng(42)). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 76 +++++++++++++++++ .github/workflows/hugo.yml | 96 ++++++++++++++++++++++ .github/workflows/links.yml | 43 ++++++++++ .gitignore | 4 + README.md | 31 ++++++- content/_index.md | 0 example/deps.go | 12 +++ example/first.md | 20 +++++ example/go.mod | 26 ++++++ example/go.sum | 32 ++++++++ example/output.txt | 4 + go.mod | 5 ++ go.sum | 2 + hugo.toml | 160 ++++++++++++++++++++++++++++++++++++ kit.go | 9 ++ layouts/index.html | 141 +++++++++++++++++++++++++++++++ renovate.json | 4 + static/favicon.svg | 13 +++ static/img/logo.svg | 13 +++ 19 files changed, 690 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/hugo.yml create mode 100644 .github/workflows/links.yml create mode 100644 .gitignore create mode 100644 content/_index.md create mode 100644 example/deps.go create mode 100644 example/first.md create mode 100644 example/go.mod create mode 100644 example/go.sum create mode 100644 example/output.txt create mode 100644 go.mod create mode 100644 go.sum create mode 100644 hugo.toml create mode 100644 kit.go create mode 100644 layouts/index.html create mode 100644 renovate.json create mode 100644 static/favicon.svg create mode 100644 static/img/logo.svg diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..873af96 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: ci + +on: + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: the site builds + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + # Hugo resolves the landingkit module (hugo.toml [module]) with the go + # command, at the version go.mod pins. + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: false + - uses: peaceiris/actions-hugo@v3 + with: + hugo-version: "0.167.0" + extended: true + - run: hugo --minify + # A portal that builds and leaves an organisation out is a portal nobody + # notices is incomplete. The list is written here, not read from + # hugo.toml: a check that takes its list from the file it checks passes + # whatever the file says. + - name: every member organisation and repository is on it + run: | + rc=0 + for org in go-ndarray go-fft go-numerics go-statistics go-dataframe go-plot go-notebook; do + for url in "https://$org.github.io/" "https://$org.github.io/docs/"; do + grep -qF "$url" public/index.html \ + || { echo "::error::$url is not on the page"; rc=1; } + done + done + for repo in go-scikit.github.io brand .github; do + grep -qF "go-scikit/$repo" public/index.html \ + || { echo "::error::go-scikit/$repo is not on the page"; rc=1; } + done + [ $rc -eq 0 ] && echo "the page names every member organisation, its site and docs, and every repository here" + exit $rc + + # The hero shows example/first.md and, under it, example/output.txt: what + # running it printed. This runs the notebook again, with the notebook + # command and the library versions example/go.mod pins, and fails if the + # output differs. Timings ("ran in 41µs") and the "kept" marker of a cached + # cell are removed first: they are the only parts that change from run to + # run. + notebook: + name: the notebook prints what the page says + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 + with: + go-version-file: example/go.mod + cache-dependency-path: example/go.sum + - name: Run the notebook + working-directory: example + env: + GOWORK: "off" + run: | + set -o pipefail + go tool notebook run first.md > out.raw + sed -E 's/, (ran in [^)]*|kept)\)/)/' out.raw > output.txt + - name: The committed output is the one printed + run: | + if ! git diff --exit-code -- example/output.txt; then + echo "::error::example/output.txt differs from what first.md prints: run it again (see README) and commit the output" + exit 1 + fi diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml new file mode 100644 index 0000000..0a9c69d --- /dev/null +++ b/.github/workflows/hugo.yml @@ -0,0 +1,96 @@ +# Build + deploy the Hugo site to GitHub Pages on every push to main. +# Adapted from the official Hugo template at +# https://gohugo.io/host-and-deploy/host-on-github-pages/. + +name: Deploy Hugo site to Pages + +on: + push: + branches: [main] + # Build on every pull request too, so a change to the layout, the content or + # the Hugo version has to prove the site still builds before it lands. + # Without this the workflow ran only on main, which meant a dependency bump + # arrived with no signal at all -- its checks read "no checks", which is not + # the same thing as green and must not be merged as if it were. + pull_request: + workflow_dispatch: + +# Allow only one concurrent deployment, skipping runs queued between +# the run in-progress and latest queued. Don't cancel in-progress +# runs — we want them to finish before a new build replaces them. +concurrency: + group: "pages" + cancel-in-progress: false + +# The build needs nothing beyond the source and the Pages configuration it +# reads to compute the base URL. Publishing rights are granted to the deploy +# job alone, below, so a pull request build cannot replace what is served. +permissions: + contents: read + pages: read + +env: + # Pin Hugo so site builds don't break when a new release ships + # incompatible template changes. Bump deliberately, not by + # surprise. + HUGO_VERSION: 0.135.0 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install Hugo CLI + run: | + wget -O hugo.deb "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb" + sudo dpkg -i hugo.deb + + - name: Checkout + uses: actions/checkout@v7 + with: + submodules: recursive + + - name: Setup Pages + id: pages + uses: actions/configure-pages@v6 + + # Hugo resolves the landingkit module (hugo.toml [module]) with the go + # command, at the version go.mod pins. + - name: Setup Go + uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: false + + - name: Build + env: + HUGO_ENVIRONMENT: production + HUGO_ENV: production + run: | + hugo \ + --gc \ + --minify \ + --baseURL "${{ steps.pages.outputs.base_url }}/" + + - name: Upload artifact + uses: actions/upload-pages-artifact@v5 + with: + path: ./public + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write + # Only main publishes. A pull request stops after build above: it has built + # the site, which is the whole point of the gate, and it has no business + # replacing what is served. + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml new file mode 100644 index 0000000..b03e1b8 --- /dev/null +++ b/.github/workflows/links.yml @@ -0,0 +1,43 @@ +name: links + +# The landing had a link to https://github.com/go-fileshare/authnd, which is a +# 404: authnd lives in go-authn. A dead link on a landing page breaks nothing +# that complains, so every link of the BUILT site is checked (the layouts hold +# template expressions, not URLs). +# +# The checker is `landingkit links`, run at the version the landing's go.mod +# pins: `go run` without a version inside a module that requires +# github.com/go-fleettools/landingkit uses that requirement, so Renovate's bump +# of the partials bumps the checker with them. It probes github.com blob links +# on raw.githubusercontent.com, because github.com answers a program's request +# for a blob page with 503 most of the time (see the landingkit README). + +on: + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + links: + name: every link and image resolves + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + submodules: recursive + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: false + - uses: peaceiris/actions-hugo@v3 + with: + hugo-version: "0.167.0" + extended: true + - run: hugo --minify --destination ./public + - name: Check + env: + GOWORK: "off" + run: go run github.com/go-fleettools/landingkit/cmd/landingkit links public diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..256c50e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +public/ +resources/ +.hugo_build.lock +.DS_Store diff --git a/README.md b/README.md index b6f949e..728a42e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,31 @@ # go-scikit.github.io -The go-scikit portal: the pure-Go scientific stack, one page + +The go-scikit portal (Hugo), served at : the +stack, one card per member organisation with its site and documentation, the +measured claims with links to their evidence, and a first notebook. + +The design is the go-* family landing kit, imported as the Hugo module +[go-fleettools/landingkit](https://github.com/go-fleettools/landingkit) +(pinned in `go.mod`; `kit.go` keeps `go mod tidy` from dropping it). The only +thing set here is `[params.brand]` in `hugo.toml`, written by +`landingkit brand static/img/logo.svg` from the logo's gradient. The member +organisations, the claims and the repositories are lists in `hugo.toml`; the +page is `layouts/index.html`. + +The notebook is real: the hero shows `example/first.md` and, under it, +`example/output.txt`, both read at build time. `example/go.mod` pins the +libraries it imports and the `notebook` command (as a `tool`), and the `ci` +workflow runs it again and fails if the output differs. + +```sh +cd example && go tool notebook run first.md | sed -E 's/, (ran in [^)]*|kept)\)/)/' > output.txt +hugo server +``` + +| Workflow | What | +| --- | --- | +| `hugo.yml` | builds on pull requests; builds and deploys to Pages on `main` | +| `ci.yml` | the site builds and names every member organisation and repository; the notebook prints what the page says | +| `links.yml` | every link and image of the built site resolves (`landingkit links`) | + +BSD-3-Clause. diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..e69de29 diff --git a/example/deps.go b/example/deps.go new file mode 100644 index 0000000..42608cf --- /dev/null +++ b/example/deps.go @@ -0,0 +1,12 @@ +//go:build tools + +// This file never builds. first.md is a notebook, not Go, so `go mod tidy` -- +// which Renovate runs after every bump -- finds nothing here that uses the +// libraries the notebook imports and deletes their requirements. Importing +// them here keeps them, at the versions go.mod pins. +package example + +import ( + _ "github.com/go-ndarray/ndarray/random" + _ "github.com/go-statistics/stats" +) diff --git a/example/first.md b/example/first.md new file mode 100644 index 0000000..b471046 --- /dev/null +++ b/example/first.md @@ -0,0 +1,20 @@ +# A first notebook + +```go +import ( + "github.com/go-ndarray/ndarray/random" + "github.com/go-statistics/stats" +) +``` + +A thousand draws from seed 42: the +numbers NumPy's `default_rng(42)` gives. + +```go +rng := random.DefaultRNG(42) +x, _ := stats.Normal{Loc: 10, Scale: 2}.Rvs(rng, 1000) +``` + +```go +stats.Percentiles(x, []float64{25, 50, 75}, nil) +``` diff --git a/example/go.mod b/example/go.mod new file mode 100644 index 0000000..e0ed44e --- /dev/null +++ b/example/go.mod @@ -0,0 +1,26 @@ +module github.com/go-scikit/go-scikit.github.io/example + +go 1.27.2 + +require ( + github.com/go-ndarray/ndarray v0.12.0 + github.com/go-statistics/stats v0.1.0 +) + +require ( + github.com/go-notebook/notebook v0.2.0 // indirect + github.com/go-numerics/optimize v0.1.0 // indirect + github.com/go-numerics/special v0.1.0 // indirect + github.com/go-opentype/opentype v0.13.0 // indirect + github.com/go-regexp/engine v0.1.3 // indirect + github.com/go-rouge/rouge v0.4.0 // indirect + github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2 // indirect + github.com/go-tex/math v0.50.0 // indirect + github.com/yuin/goldmark v1.8.6 // indirect + golang.org/x/mod v0.41.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.49.0 // indirect + golang.org/x/tools v0.51.0 // indirect +) + +tool github.com/go-notebook/notebook/cmd/notebook diff --git a/example/go.sum b/example/go.sum new file mode 100644 index 0000000..35742f4 --- /dev/null +++ b/example/go.sum @@ -0,0 +1,32 @@ +github.com/go-ndarray/ndarray v0.12.0 h1:4xfl9ZQo1m0UXopo06KypELg1wUYgQb5kdKaJPZAZus= +github.com/go-ndarray/ndarray v0.12.0/go.mod h1:ZcgNCBVLXt1FxeZjQWI5Z+k0SSWAT0/wR8slfat/gRA= +github.com/go-notebook/notebook v0.2.0 h1:W3z9TbBCyqsHaRcEpa2csMw5UDe8JsgOu6Hwd/R1T6M= +github.com/go-notebook/notebook v0.2.0/go.mod h1:cqXgByviyVH6wBixaCPPnHfJkPP1c3jh2JAAfaz2Zf8= +github.com/go-numerics/optimize v0.1.0 h1:SOA+QxTuIjeZSAsd5Dyj433lItnOKWyprCbHQoLxg/c= +github.com/go-numerics/optimize v0.1.0/go.mod h1:ieZ+/EsbBw/EfHl4W8JryPyCBB8n5a8xKk6lu/xh7zk= +github.com/go-numerics/special v0.1.0 h1:HcsebTwcNuAhFBP8RuOirO9XVmWJSrxARiOVkyeCfUk= +github.com/go-numerics/special v0.1.0/go.mod h1:T0QKLvh32lH5Bq9wiTEvtlaFd1vaOKRGrOPgvTeYfdM= +github.com/go-opentype/opentype v0.13.0 h1:q9K7IGDfwMP/ik51ZkwiYf6jbaqPfocvAIuojetd0UQ= +github.com/go-opentype/opentype v0.13.0/go.mod h1:AOixevJf7XQaH7+WG+OMIOZEbYPXfMqklVk26Y6YTUU= +github.com/go-regexp/engine v0.1.3 h1:0U5DrrBEYjNX/f0yFESpQDWmJOtXmmZqluNAUBXjfxY= +github.com/go-regexp/engine v0.1.3/go.mod h1:8rju5lq5OkskQh9+m+FjBP6965giMPUdIOdrvFrbqn4= +github.com/go-rouge/rouge v0.4.0 h1:f/5EVTEwiEnBOeyAtkV8r5KopdIRAsRoA7Kzi/cyh2Y= +github.com/go-rouge/rouge v0.4.0/go.mod h1:V4Xlyl1EDqEfrzloW9y6X0xpv/WvCvTiOWNIcByw2Y8= +github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2 h1:pNvJf0zgzg0rTEq1fToFa5fnzK13nIble80caTmdG3g= +github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2/go.mod h1:I3i2r1AXulgMBt/KiWBcxjnoNsB09ZFKkj2Vb5Mhzuw= +github.com/go-statistics/stats v0.1.0 h1:m8/5lxOZEcbWp51T6evG3Yx0ZzMlOO2wIEZa8uBGryA= +github.com/go-statistics/stats v0.1.0/go.mod h1:hyKv4yhaJ7aDpNbR1MLNjiiBPeP5iZb8Q075y+q+FEw= +github.com/go-tex/math v0.50.0 h1:YHJ3LYzS45zBoPKGBkZW4+LUQkOeHP30YWLsfXGZCpo= +github.com/go-tex/math v0.50.0/go.mod h1:cPm5juijQkhFj1MCByLF8tOfZ+UswAGUPBh+Wy6+vbw= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/yuin/goldmark v1.8.6 h1:d0VcaP1sx9GkFVkoW+KtggpGi2KZ965i14b0+bDQST4= +github.com/yuin/goldmark v1.8.6/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= +golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= +golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI= +golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA= diff --git a/example/output.txt b/example/output.txt new file mode 100644 index 0000000..dfeb45a --- /dev/null +++ b/example/output.txt @@ -0,0 +1,4 @@ +── cell 0 (line 4) +── cell 1 (line 14) +── cell 2 (line 19) + [8.607374170843807 10.012355742798341 11.179773490450081] diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..761441a --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/go-scikit/go-scikit.github.io + +go 1.27.2 + +require github.com/go-fleettools/landingkit v0.3.1 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..82cc8e5 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/go-fleettools/landingkit v0.3.1 h1:vW/xVaXYKF+XXgFFQAqBKhSWV6hpCkvsAZ3t1MdWPnc= +github.com/go-fleettools/landingkit v0.3.1/go.mod h1:NUBMh7cVFUfD/hX6Xv5ef2O/r4F6rPtPGGVd3T+9qc0= diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..e8afb75 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,160 @@ +baseURL = 'https://go-scikit.github.io/' +locale = 'en-us' +title = 'go-scikit' +# No theme -- the layout is the go-* family template: one self-contained +# layouts/index.html over the shared design. + +disableKinds = ['taxonomy', 'term', 'rss', 'sitemap', '404'] + +[markup.goldmark.renderer] + unsafe = true + +# The design -- layouts/partials/styles.html, theme-toggle.html, +# fork-ribbon.html and icons/{github,book}.html -- comes from the shared Hugo +# module github.com/go-fleettools/landingkit, not from copies here: the copies +# drifted. Its version is pinned in go.mod (Renovate bumps it), and kit.go +# keeps `go mod tidy` from deleting that requirement. A file of the same name +# under layouts/partials/ would silently override the module's. +[module] + [[module.imports]] + path = "github.com/go-fleettools/landingkit" + +[params] + description = "go-scikit: the scientific stack for Go, in pure Go (CGO=0). N-dimensional arrays and NumPy's random numbers, FFTs, optimisation, integration and special functions, probability and statistics, labelled tables, figures and compiled, reactive notebooks, each measured against its Python reference." + +# One entry per member organisation. The cards in #orgs, the strip under the +# hero, the stack diagram in #stack and the ci check that the page names +# every organisation all come from this list. `layer` places it in the stack: +# 0 the arrays, 1 the libraries that compute on them, 2 the notebook. +# Every statement is from the organisation's own profile, README or landing. +[[params.orgs]] + name = "go-ndarray" + layer = 0 + short = "arrays, numpy.linalg, numpy.random" + lib = "ndarray" + blurb = "N-dimensional arrays in 13 dtypes with NumPy 2 promotion, broadcasting, strided views and reductions, multicore and SIMD. Package linalg is numpy.linalg, fft is numpy.fft, and random is numpy.random with NumPy's numbers for the same seed." + playground = "https://go-ndarray.github.io/playground/" +[[params.orgs]] + name = "go-fft" + layer = 0 + short = "numpy.fft, scipy.fft" + lib = "fft" + blurb = "The numpy.fft / scipy.fft equivalent: complex and real transforms of any length, N-D, the DCT and DST, single precision, windows, with no dependency on FFTW. AVX2 and AVX-512 kernels on amd64, NEON on arm64, bit-identical to the Go code." + playground = "https://go-fft.github.io/playground/" +[[params.orgs]] + name = "go-numerics" + layer = 1 + short = "optimize, integrate, special" + lib = "optimize" + blurb = "Numerical methods ported statement by statement from their reference algorithms: minimisation, roots, least squares and linear programming (optimize); QUADPACK quadrature and ODE solvers (integrate); gamma, beta, error, Bessel and zeta functions measured against mpmath (special)." +[[params.orgs]] + name = "go-statistics" + layer = 1 + short = "distributions, statistics, tests" + lib = "stats" + blurb = "32 univariate and 3 multivariate distributions with every method of SciPy's frozen distributions, descriptive statistics with NumPy's 13 quantile methods, and the statistical tests, from t-tests to Shapiro–Wilk and Anderson–Darling." +[[params.orgs]] + name = "go-dataframe" + layer = 1 + short = "labelled tables" + lib = "dataframe" + blurb = "Series, DataFrame and Index whose numeric columns are go-ndarray arrays: CSV, Arrow and Parquet, group-by, joins, reshaping and time series, giving pandas' answers." +[[params.orgs]] + name = "go-plot" + layer = 1 + short = "figures, SVG and PNG" + lib = "plot" + blurb = "matplotlib's object model and defaults, figures to SVG and PNG, real TeX in the labels; ticks, colormaps and layout tested equal to matplotlib where they can be equal." +[[params.orgs]] + name = "go-notebook" + layer = 2 + short = "compiled, reactive notebooks" + lib = "notebook" + blurb = "A notebook is a Markdown file whose go blocks are cells. The kernel compiles it into a real Go program, orders the cells by what they use, and runs only what changed, keeping values across runs." + +# The cards of #measured and their count come from this list. Each statement +# is from the document its link names. +[[params.claims]] + name = "Accuracy against mpmath" + what = "go-statistics measures every distribution function in ULPs against mpmath, with SciPy on the same points: at or below SciPy's error in 1473 of 1479 regions, the six exceptions under 4.5 ulp." + href = "https://github.com/go-statistics/stats/blob/main/docs/accuracy.md" + link = "go-statistics accuracy" +[[params.claims]] + name = "Special functions in ULPs" + what = "go-numerics' special functions, about 250 000 points in 419 regions over 62 functions: at or below SciPy's error in 418 regions." + href = "https://github.com/go-numerics/special/blob/main/docs/accuracy.md" + link = "go-numerics accuracy" +[[params.claims]] + name = "NumPy's numbers, same seed" + what = "go-ndarray's random is numpy.random: PCG64, MT19937, Philox, SFC64 and 40 samplers, bit-exact against NumPy 2.5.3 on x86-64, the few ULP-level exceptions listed." + href = "https://github.com/go-ndarray/ndarray/blob/main/docs/random.md" + link = "go-ndarray random" +[[params.claims]] + name = "SciPy's draws, to the bit" + what = "On that generator, go-statistics' draws of 17 distributions, Dirichlet and multinomial are bit-identical to SciPy's; the others are listed with how much they differ." + href = "https://github.com/go-statistics/stats/blob/main/docs/rvs-table.md" + link = "go-statistics draws" +[[params.claims]] + name = "The reference's path" + what = "116 of 124 fixture integrals take SciPy's exact QUADPACK subdivision path, and 110 of 120 solve_ivp runs its exact steps." + href = "https://github.com/go-numerics/integrate" + link = "go-numerics integrate" +[[params.claims]] + name = "Faster than FFTW, and slower where it is" + what = "At v0.27.0 go-fft is faster than FFTW on all 24 rows on Neoverse-N1 and at or above numpy.fft and scipy.fft on all 24 rows on every host measured; the tables include the rows FFTW wins." + href = "https://github.com/go-fft/fft/blob/main/BENCHMARKS.md" + link = "go-fft benchmarks" +[[params.claims]] + name = "Against NumPy and OpenBLAS" + what = "go-ndarray is faster on whole-array reductions and the *Into forms of elementwise operations, and slower on MatMul against 16-thread OpenBLAS from 512²." + href = "https://github.com/go-ndarray/ndarray/blob/main/docs/perf.md" + link = "go-ndarray performance" +[[params.claims]] + name = "pandas' answers, polars' speed" + what = "go-dataframe replays 173 cases recorded from pandas 3.0; polars is faster on most of the operations measured, and the numbers say by how much." + href = "https://github.com/go-dataframe/dataframe/blob/main/docs/perf.md" + link = "go-dataframe performance" +[[params.claims]] + name = "matplotlib's ticks" + what = "go-plot's tick locations, labels and offset text on 408 axes of real figures: every location bit for bit, every label character for character." + href = "https://github.com/go-plot/plot/blob/main/docs/design.md" + link = "go-plot design" + +# Every field below is rendered by layouts/index.html (#repos). A field +# nothing renders does not stay true. +[[params.repos]] + name = "go-scikit.github.io" + kind = "site" + href = "https://github.com/go-scikit/go-scikit.github.io" + blurb = "This page (Hugo, on the go-fleettools landing kit). The notebook in the hero is run again by CI, which fails if its output changes." +[[params.repos]] + name = "brand" + kind = "assets" + href = "https://github.com/go-scikit/brand" + blurb = "Logos and icons in SVG / PNG / JPG / ICO / ICNS; the mark is the stack, written by a Go program from the list of member organisations." +[[params.repos]] + name = ".github" + kind = "profile" + href = "https://github.com/go-scikit/.github" + blurb = "The organisation profile and the shared Renovate preset." + +[params.brand] +# Generated by go-fleettools/landingkit from static/img/logo.svg: the colours are +# READ from the logo's gradient, never chosen. Do not add other keys: +# neutrals (backgrounds, surfaces, greys) belong to the shared sheet. +# Contrast: base on white 10.55:1, bright on the dark background 7.58:1. + base = "#2f3e63" + deep = "#1d263c" + bright = "#8fa3c8" + shadow = "rgba(47,62,99,.7)" + glow = "rgba(47,62,99,.6)" + wash = "rgba(47,62,99,.10)" + washDeep = "rgba(29,38,60,.06)" + chipBg = "#f2f4f8" + chipBorder = "#dde3ee" + chipFg = "#1d263c" + chipBgDark = "rgba(143,163,200,.14)" + chipBorderDark = "rgba(143,163,200,.32)" + chipFgDark = "#c1cce1" + statsEnd = "#e4e9f2" + bandText = "#edf0f6" diff --git a/kit.go b/kit.go new file mode 100644 index 0000000..72ac4fb --- /dev/null +++ b/kit.go @@ -0,0 +1,9 @@ +//go:build tools + +// This file never builds. A Hugo site has no Go code, so `go mod tidy` -- +// which Renovate runs after every bump -- would find nothing that uses +// github.com/go-fleettools/landingkit and delete its requirement from go.mod. +// Importing it here keeps it. See the landingkit README. +package site + +import _ "github.com/go-fleettools/landingkit" diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..328fae6 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,141 @@ + + + + + +{{ .Site.Title }} — the scientific stack for Go + + +{{ partial "styles.html" . }} + + + + {{ partial "fork-ribbon.html" "https://github.com/go-scikit" }} + + {{/* example/first.md and example/output.txt, read at build time: the + notebook in the terminal is the file CI runs, and the output under it + is what that run printed (timings removed). The ci workflow runs the + notebook again and fails if the output differs. */}} + {{- $nb := readFile "example/first.md" -}} + {{- $out := readFile "example/output.txt" -}} + {{- $orgs := .Site.Params.orgs -}} + {{/* min-width:0 on both grid items: a grid item is as wide as its + min-content by default, and the terminal's unwrapped
 made the
+       hero, and so the whole page, wider than a phone. */}}
+  
+
+

Science in Go,
{{/* The sheet's .accent paints with --grad, base to deep: on a dark page + this logo's dark slate stops would vanish. --accent and --accent-deep + are the same two in light and the bright stop in dark. */}}all the way down.

+

go-scikit is the umbrella over {{ len $orgs }} organisations that together cover what a Python notebook reaches for in NumPy, SciPy, pandas and matplotlib: arrays, FFTs, numerical methods, statistics, labelled tables, figures and notebooks. Pure Go, CGO=0, and each library measured against its Python reference, with the documents that say where it is slower or less accurate.

+ +
{{ len $orgs }} organisationsCGO=0 everywhereBSD-3-Clause
+
+
+
first.md
+
{{ $nb }}
+$ notebook run first.md
+{{ $out }}
+
+
+ +
+ {{ len $orgs }} organisations — one stack, each with its own site and documentation +
{{ range $orgs }}{{ .name }}{{ end }}
+
+ + {{/* The diagram is drawn from params.orgs: layer 2 on top, layer 0 at the + bottom, one box per organisation, as the mark draws it. */}} +
+ How the pieces fit +

Arrays at the bottom, notebooks on top.

+

go-ndarray's arrays are what the libraries above take and return, and its generator is where their random numbers come from; its fft package runs on go-fft. go-statistics takes its special functions and optimisers from go-numerics, go-dataframe's numeric columns are go-ndarray arrays and its dfplot draws with go-plot, and a go-notebook cell can use all of them.

+
+ {{ range $layer := slice 2 1 0 }} +
+ {{ range where $orgs "layer" $layer }} + + {{ .name }} logo + {{ .name }}
{{ .short }}
+
+ {{ end }} +
+ {{ end }} +
+
+ +
+ The organisations +

{{ len $orgs }} organisations, one site each.

+

Each organisation has its own landing, documentation and release cycle. The libraries are in the organisations; this page only points at them.

+
+ {{ range $orgs }} +
+ {{ .name }} logo +

{{ .name }}

+

{{ .blurb | safeHTML }}

+

Site →   Docs →   Source →{{ with .playground }}   Playground →{{ end }}

+
+ {{ end }} +
+
+ +
+ What is measured +

{{ len .Site.Params.claims }} claims, each with its evidence.

+

Every figure below is from the library's own documentation, which says how it was measured and against which version of the reference. The references are mpmath, NumPy, SciPy, pandas, matplotlib and FFTW; where a library loses to them, the same documents say so.

+
+ {{ range .Site.Params.claims }} +

{{ .name }}

{{ .what | safeHTML }}

{{ .link }} →

+ {{ end }} +
+
+ +
+ Get started +

A first notebook, in four commands.

+

A notebook is a Markdown file; its go blocks are the cells. Put the notebook from the top of this page in first.md, in a module that requires the libraries it imports, and run it. It prints the quartiles of a thousand normal draws from seed 42: the draws SciPy's norm.rvs(10, 2, size=1000, random_state=np.random.default_rng(42)) makes.

+
+
shell
+
$ go install github.com/go-notebook/notebook/cmd/notebook@latest
+$ go mod init example.com/first
+$ go get github.com/go-statistics/stats github.com/go-ndarray/ndarray
+$ notebook run first.md
+{{ $out }}
+# notebook html first.md    writes first.html
+# notebook serve first.md   the same, live in the browser, editable
+
+

Run it again and every cell is kept: a cell whose code and inputs did not change is not run again, across runs. The go-notebook documentation gives the cell rules; to try the arrays and the transforms without installing anything, the go-ndarray and go-fft playgrounds run them compiled to WebAssembly in the browser.

+
+ +
+ Repositories +

What is here.

+
+ {{ range .Site.Params.repos }} +
+

{{ .name }}

{{ .kind }}
+

{{ .blurb | safeHTML }}

+
+ {{ end }} +
+
+ +
+
+

One stack, {{ len $orgs }} organisations.

+

Each library is a go get away and none needs cgo. Start from the organisation that matches the question: the arrays, a transform, a solver, a distribution, a table or a figure, then reach the others from a notebook.

+ {{ partial "icons/github.html" . }}go-scikit on GitHub → +
+
+ + + + diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..123150f --- /dev/null +++ b/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["github>go-scikit/.github"] +} diff --git a/static/favicon.svg b/static/favicon.svg new file mode 100644 index 0000000..bdbe7dc --- /dev/null +++ b/static/favicon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/static/img/logo.svg b/static/img/logo.svg new file mode 100644 index 0000000..bdbe7dc --- /dev/null +++ b/static/img/logo.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + +