Skip to content

Commit 7a4cf26

Browse files
Merge branch 'rafaqz:main' into stack
2 parents bdf151f + 9846bfe commit 7a4cf26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1836
-1473
lines changed

.github/workflows/Documenter.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,14 @@ jobs:
4747
uses: julia-actions/setup-julia@v1
4848
- name: Pull Julia cache
4949
uses: julia-actions/cache@v1
50-
- name: Install custom documentation dependencies
51-
run: julia --project=docs -e 'using Pkg; pkg"add https://github.com/LuxDL/DocumenterVitepress.jl.git"; pkg"dev ."; Pkg.instantiate(); Pkg.precompile(); Pkg.status()'
5250
- name: Instantiate NPM
5351
run: cd docs/; npm i; cd ..
5452
- name: Generate logo
55-
run: julia --project=docs/ --color=yes docs/logo.jl
56-
- name: Build and deploy
53+
run: julia --project=docs -e "using Pkg; Pkg.instantiate()"; julia --project=docs/ --color=yes docs/logo.jl
54+
- uses: julia-actions/julia-docdeploy@v1
5755
env:
5856
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
5957
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
6058
GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988
6159
JULIA_DEBUG: "Documenter"
6260
DATADEPS_ALWAYS_ACCEPT: true
63-
run: |
64-
julia --project=docs/ --color=yes docs/make.jl # this should ideally AUTO-DEPLOY!

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ docs/.vitepress/dist
2222
docs/.vitepress/cache
2323
docs/src/.vitepress/dist
2424
docs/src/.vitepress/cache
25-
node_modules
25+
node_modules
26+
*.png
27+
*.svg

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ColorTypes = "0.11"
3939
Combinatorics = "1"
4040
ConstructionBase = "1"
4141
CoordinateTransformations = "0.6"
42-
DataAPI = "1"
42+
DataAPI = "1.16"
4343
DataFrames = "1"
4444
Dates = "1"
4545
Distributions = "0.25"

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# DimensionalData
22

3-
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://rafaqz.github.io/DimensionalData.jl/)
3+
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://rafaqz.github.io/DimensionalData.jl/stable)
4+
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://rafaqz.github.io/DimensionalData.jl/dev)
45
[![CI](https://github.com/rafaqz/DimensionalData.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/rafaqz/DimensionalData.jl/actions/workflows/ci.yml)
56
[![Codecov](https://codecov.io/gh/rafaqz/DimensionalData.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/rafaqz/DimensionalData.jl/tree/main)
67
[![Aqua.jl Quality Assurance](https://img.shields.io/badge/Aqua.jl-%F0%9F%8C%A2-aqua.svg)](https://github.com/JuliaTesting/Aqua.jl)
78

8-
DimensionalData.jl provides tools and abstractions for working with datasets
9-
that have named dimensions, and optionally a lookup index. It provides no-cost
10-
abstractions for named indexing, and fast index lookups.
9+
<img src="https://rafaqz.github.io/DimensionalData.jl/dev/logoDD.png" align="right" style="padding-left:10px;" width="180"/>
1110

12-
DimensionalData is a pluggable, generalised version of
13-
[AxisArrays.jl](https://github.com/JuliaArrays/AxisArrays.jl) with a cleaner
14-
syntax, and additional functionality found in NamedDims.jl. It has similar goals
15-
to pythons [xarray](http://xarray.pydata.org/en/stable/), and is primarily
16-
written for use with spatial data in [Rasters.jl](https://github.com/rafaqz/Rasters.jl).
11+
> [!TIP]
12+
> Visit the latest documentation at https://rafaqz.github.io/DimensionalData.jl/dev/
13+
14+
DimensionalData.jl provides tools and abstractions for working with datasets that have named dimensions, and optionally a lookup index. It provides no-cost abstractions for named indexing, and fast index lookups.
15+
16+
DimensionalData is a pluggable, generalised version of [AxisArrays.jl](https://github.com/JuliaArrays/AxisArrays.jl) with a cleaner syntax, and additional functionality found in NamedDims.jl. It has similar goals to pythons [xarray](http://xarray.pydata.org/en/stable/), and is primarily written for use with spatial data in [Rasters.jl](https://github.com/rafaqz/Rasters.jl).
1717

1818
> [!IMPORTANT]
1919
> INSTALLATION
@@ -126,7 +126,7 @@ using DimensionalData.LookupArrays, DimensionalData.Dimensions
126126
```
127127

128128
> [!IMPORTANT]
129-
> Alternate Packages
129+
> Alternative Packages
130130
131131
There are a lot of similar Julia packages in this space. AxisArrays.jl, NamedDims.jl, NamedArrays.jl are registered alternative that each cover some of the functionality provided by DimensionalData.jl. DimensionalData.jl should be able to replicate most of their syntax and functionality.
132132

docs/Project.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
[deps]
22
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
3-
BetterFileWatching = "c9fd44ac-77b5-486c-9482-9798bd063cc6"
43
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
54
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
65
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
6+
CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298"
77
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
88
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
99
DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0"
1010
DiskArrays = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3"
1111
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
1212
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
13-
FileWatching = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
13+
Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
14+
Interfaces = "85a1e053-f937-4924-92a5-1367d23b7b87"
1415
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
16+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1517
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
18+
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1619
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

docs/logo.jl

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
using Colors
22
using CairoMakie
3+
using Random
4+
Random.seed!(13)
35
CairoMakie.activate!()
4-
mkpath(joinpath(@__DIR__, "./src/public/"))
56

67
rpyz = [Rect3f(Vec3f(0, j-0.8,k), Vec3f(0.1, 0.8,0.8))
78
for j in 1:7 for k in 1:7]
89
rmyz = [Rect3f(Vec3f(j-0.8, 0,k), Vec3f(0.8, 0.1,0.8))
910
for j in 1:7 for k in 1:7]
1011

1112
colors = ["#ff875f", "#0087d7", "#5fd7ff", "#ff5f87", "#b2b2b2", "#d75f00", "#00afaf"]
13+
base_points = [Point3f(i,j,0) for i in range(0.5,6.0,7) for j in range(0.5,6.0,7)]
14+
z = 2.0*rand(length(base_points))
1215
fig = Figure(; size=(500,500),
1316
backgroundcolor=:transparent,
1417
fonts = (; regular = "Barlow"))
1518
ax = LScene(fig[1,1]; show_axis=false)
1619

1720
wireframe!.(ax, rpyz; color = colors[3], transparency=true) # shading=NoShading # bug!
18-
poly!.(ax, rmyz; color=colors[1], transparency=true, shading=NoShading)
21+
poly!.(ax, rmyz; color=0.85*colorant"#ff875f", transparency=true, shading=NoShading)
1922

2023
meshscatter!(ax, [Point3f(0.1,0.1,0.8), Point3f(0.1+7,0.1,0.8),
2124
Point3f(0.1,0.1+7,0.8), Point3f(0.1+7,0.1+7,0.8)]; color = colors[4],
@@ -32,7 +35,10 @@ lines!(ax, [ Point3f(0.1+7,0.1,8), Point3f(0.1+7,0.1+7,8),
3235
];
3336
color = colors[2],
3437
linewidth=2, transparency=true)
38+
meshscatter!(ax, base_points; marker=Rect3f(Vec3f(-0.5,-0.5,0), Vec3f(1,1,1)),
39+
markersize = Vec3f.(0.5,0.5, z), color=z, colormap=tuple.(colors, 1), transparency=false)
3540

36-
save(joinpath(@__DIR__, "src", "public", "logoDD.svg"), fig; pt_per_unit=0.75)
37-
save(joinpath(@__DIR__, "src", "public", "logoDD.png"), fig; px_per_unit=2)
38-
fig
41+
mkpath(joinpath(@__DIR__, "src", "assets"))
42+
save(joinpath(@__DIR__, "src", "assets", "logoDD.svg"), fig; pt_per_unit=0.75)
43+
save(joinpath(@__DIR__, "src", "assets", "logoDD.png"), fig; px_per_unit=2)
44+
save(joinpath(@__DIR__, "src", "assets", "favicon.png"), fig; px_per_unit=0.25)

docs/make.jl

+23-40
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,36 @@
1-
using DocumenterVitepress ## add https://github.com/LuxDL/DocumenterVitepress.jl.git
1+
using DocumenterVitepress
22
using Documenter
33
using DimensionalData
4+
using DimensionalData.Dimensions
5+
using DimensionalData.Lookups
6+
7+
# Names are available everywhere so that [`function`](@ref) works.
8+
# ====================
9+
10+
DocMeta.setdocmeta!(DimensionalData, :DocTestSetup, :(using DimensionalData, DimensionalData.Dimensions, DimensionalData.Dimensions.Lookups); recursive=true)
11+
12+
# Build documentation.
13+
# ====================
414

515
makedocs(; sitename="DimensionalData", authors="Rafael Schouten et al.",
6-
# modules=[DimensionalData],
7-
# checkdocs=:all,
8-
format=DocumenterVitepress.MarkdownVitepress(),
16+
modules=[DimensionalData],
17+
checkdocs=:all,
18+
format=DocumenterVitepress.MarkdownVitepress(
19+
repo = "github.com/rafaqz/DimensionalData.jl",
20+
devbranch = "main",
21+
devurl = "dev",
22+
),
923
draft=false,
1024
source="src",
11-
build=joinpath(@__DIR__, "build"),
12-
warnonly = true,
13-
)
14-
15-
16-
# We manually obtain the Documenter deploy configuration,
17-
# so we can use it to set Vitepress's settings.
18-
# TODO: make this better / encapsulate it in `makedocs`
19-
# so the user does not need to know!
20-
deploy_config = Documenter.auto_detect_deploy_system()
21-
deploy_decision = Documenter.deploy_folder(
22-
deploy_config;
23-
repo="github.com/rafaqz/DimensionalData.jl",
24-
devbranch="main",
25-
devurl = "dev",
26-
push_preview=true,
25+
build="build",
26+
# warnonly = true,
2727
)
2828

29-
# VitePress relies on its config file in order to understand where files will exist.
30-
# We need to modify this file to reflect the correct base URL, however, Documenter
31-
# only knows about the base URL at the time of deployment.
32-
33-
# So, after building the Markdown, we need to modify the config file to reflect the
34-
# correct base URL, and then build the VitePress site.
35-
folder = deploy_decision.subfolder
36-
println("Deploying to $folder")
37-
vitepress_config_file = joinpath(@__DIR__, "build", ".vitepress", "config.mts")
38-
config = read(vitepress_config_file, String)
39-
new_config = replace(config, "base: 'REPLACE_ME_WITH_DOCUMENTER_VITEPRESS_BASE_URL_WITH_TRAILING_SLASH'" => "base: '/DimensionalData.jl/$folder'")
40-
write(vitepress_config_file, new_config)
41-
42-
# Build the docs using `npm` - we are assuming it's installed here!
43-
cd(@__DIR__) do
44-
run(`npm run docs:build`)
45-
end
46-
touch(joinpath(@__DIR__, "build", ".vitepress", "dist", ".nojekyll"))
47-
29+
# Deploy built documentation.
30+
# ===========================
4831
deploydocs(;
4932
repo="github.com/rafaqz/DimensionalData.jl",
50-
target="build/.vitepress/dist", # this is where Vitepress stores its output
33+
target="build", # this is where Vitepress stores its output
5134
branch = "gh-pages",
5235
devbranch = "main",
5336
push_preview = true

docs/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"scripts": {
3-
"docs:dev": "vitepress dev build",
4-
"docs:build": "vitepress build build",
5-
"docs:preview": "vitepress preview build"
3+
"docs:dev": "vitepress dev build/.documenter",
4+
"docs:build": "vitepress build build/.documenter",
5+
"docs:preview": "vitepress preview build/.documenter"
66
},
77
"devDependencies": {
88
"markdown-it-mathjax3": "^4.3.2",

docs/src/.vitepress/config.mts

+25-26
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ const version= '0.25.8'
66
const VERSIONS: DefaultTheme.NavItemWithLink[] = [
77
{ text: `v${version} (current)`, link: '/' },
88
{ text: `Release Notes`, link: 'https://github.com/rafaqz/DimensionalData.jl/releases/' },
9-
// { text: `Contributing`, link: 'https://github.com/twoslashes/twoslash/blob/main/CONTRIBUTING.md' },
109
]
1110

1211
// https://vitepress.dev/reference/site-config
1312
export default defineConfig({
14-
base: 'REPLACE_ME_WITH_DOCUMENTER_VITEPRESS_BASE_URL_WITH_TRAILING_SLASH',
15-
title: "DimensionalData",
13+
base: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
14+
title: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
1615
description: "Datasets with named dimensions",
1716
lastUpdated: true,
1817
cleanUrls: true,
1918
ignoreDeadLinks: true,
19+
outDir: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // This is required for MarkdownVitepress to work correctly...
2020

2121
markdown: {
2222
config(md) {
@@ -42,13 +42,12 @@ export default defineConfig({
4242
{ text: 'Dimensions', link: '/dimensions' },
4343
{ text: 'DimArrays', link: '/dimarrays' },
4444
{ text: 'Selectors', link: '/selectors' },
45-
{ text: 'Integrations',
45+
{ text: 'Integrations', link: '/integrations',
4646
items: [
4747
{ text: 'Plots and Makie', link: '/plots' },
4848
{ text: 'Tables and DataFrames', link: '/tables' },
4949
{ text: 'CUDA and GPUs', link: '/cuda' },
5050
{ text: 'DiskArrays', link: '/diskarrays' },
51-
{ text: 'Ecosystem', link: '/integrations' },
5251
{ text: 'Extending DimensionalData', link: '/extending_dd' },
5352
],
5453
},
@@ -60,35 +59,35 @@ export default defineConfig({
6059

6160
sidebar: [
6261
{
63-
text: '',
62+
text: 'Getting Started', link: '/basics',
6463
items: [
65-
{ text: 'Getting Started', link: '/basics' },
6664
{ text: 'Dimensions', link: '/dimensions' },
6765
{ text: 'Selectors', link: '/selectors' },
68-
{ text: 'Dimarrays', link: '/dimarrays' },
66+
{ text: 'DimArrays', link: '/dimarrays' },
6967
{ text: 'DimStacks', link: '/stacks' },
7068
{ text: 'GroupBy', link: '/groupby' },
7169
{ text: 'Getting information', link: '/get_info' },
7270
{ text: 'Object modification', link: '/object_modification' },
73-
{ text: 'Integrations',
74-
items: [
75-
{ text: 'Plots and Makie', link: '/plots' },
76-
{ text: 'Tables and DataFrames', link: '/tables' },
77-
{ text: 'CUDA and GPUs', link: '/cuda' },
78-
{ text: 'DiskArrays', link: '/diskarrays' },
79-
{ text: 'Ecosystem', link: '/integrations' },
80-
{ text: 'Extending DimensionalData', link: '/extending_dd' },
81-
],
82-
},
83-
{ text: 'API Reference', link: '/api/reference',
84-
items: [
85-
{ text: 'Dimensions Reference', link: '/api/dimensions' },
86-
{ text: 'LookupArrays Reference', link: '/api/lookuparrays' },
87-
],
88-
},
89-
]
90-
}
71+
]},
72+
{ text: 'Integrations', link: '/integrations',
73+
items: [
74+
{ text: 'Plots and Makie', link: '/plots' },
75+
{ text: 'Tables and DataFrames', link: '/tables' },
76+
{ text: 'CUDA and GPUs', link: '/cuda' },
77+
{ text: 'DiskArrays', link: '/diskarrays' },
78+
{ text: 'Extending DimensionalData', link: '/extending_dd' },
79+
],
80+
},
81+
{ text: 'API Reference', link: '/api/reference',
82+
items: [
83+
{ text: 'Dimensions Reference', link: '/api/dimensions' },
84+
{ text: 'LookupArrays Reference', link: '/api/lookuparrays' },
85+
],
86+
},
9187
],
88+
editLink: {
89+
pattern: 'https://github.com/rafaqz/DimensionalData.jl/edit/master/docs/src/:path'
90+
},
9291

9392
socialLinks: [
9493
{ icon: 'github', link: 'https://github.com/rafaqz/DimensionalData.jl' },

docs/src/.vitepress/theme/style.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/var
7474

7575
--vp-home-hero-image-background-image: linear-gradient(
7676
-45deg,
77-
#1f1b1c 5%,
78-
#1c1b1b 5%,
79-
#083f5f
77+
#0087d7 35%,
78+
#0087d7 35%,
79+
#ff875f
8080
);
8181
--vp-home-hero-image-filter: blur(40px);
8282
}

0 commit comments

Comments
 (0)