Skip to content

Commit

Permalink
Merge branch 'rafaqz:main' into stack
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanjohnharris authored Nov 15, 2024
2 parents 2c7b8b9 + 910efa3 commit cf57f86
Show file tree
Hide file tree
Showing 105 changed files with 5,371 additions and 5,118 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,10 @@ jobs:
uses: actions/checkout@v4
with: # Fetches the last commit only
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm # or pnpm / yarn
cache-dependency-path: 'docs/package-lock.json' # this should be a package-lock.json file
- name: Setup Julia
uses: julia-actions/setup-julia@v1
- name: Pull Julia cache
uses: julia-actions/cache@v1
- name: Instantiate NPM
run: cd docs/; npm i; cd ..
- name: Generate logo
run: julia --project=docs -e "using Pkg; Pkg.instantiate()"; julia --project=docs/ --color=yes docs/logo.jl
- uses: julia-actions/julia-docdeploy@v1
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@ jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow_failure }}
strategy:
fail-fast: true
matrix:
version:
- '1.10'
- '1'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
allow_failure: [false]
include:
- version: 'nightly'
os: ubuntu-latest
arch: x64
allow_failure: true
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ docs/.vitepress/cache
docs/src/.vitepress/dist
docs/src/.vitepress/cache
node_modules
docs/package-lock.json
*.png
*.svg
*.svg
*.ico
30 changes: 25 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DimensionalData"
uuid = "0703355e-b756-11e9-17c0-8b28908087d0"
authors = ["Rafael Schouten <[email protected]>"]
version = "0.25.8"
version = "0.29.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -24,17 +24,27 @@ TableTraits = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[weakdeps]
AlgebraOfGraphics = "cbdf2221-f076-402e-a563-3d30da359d67"
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
DiskArrays = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[extensions]
DimensionalDataAlgebraOfGraphicsExt = "AlgebraOfGraphics"
DimensionalDataCategoricalArraysExt = "CategoricalArrays"
DimensionalDataDiskArraysExt = "DiskArrays"
DimensionalDataMakie = "Makie"
DimensionalDataStatsBase = "StatsBase"

[compat]
Adapt = "2, 3.0, 4"
AlgebraOfGraphics = "0.8"
Aqua = "0.8"
ArrayInterface = "7"
BenchmarkTools = "1"
CairoMakie = "0.10, 0.11"
CairoMakie = "0.10, 0.11, 0.12"
CategoricalArrays = "0.10"
ColorTypes = "0.11"
Combinatorics = "1"
ConstructionBase = "1"
Expand All @@ -43,16 +53,19 @@ DataAPI = "1.16"
DataFrames = "1"
Dates = "1"
Distributions = "0.25"
DiskArrays = "0.3, 0.4"
Documenter = "1"
Extents = "0.1"
GPUArrays = "10"
ImageFiltering = "0.7"
ImageTransformations = "0.10"
Interfaces = "0.3"
IntervalSets = "0.5, 0.6, 0.7"
InvertedIndices = "1"
IteratorInterfaceExtensions = "1"
JLArrays = "0.1"
LinearAlgebra = "1"
Makie = "0.19, 0.20"
Makie = "0.20, 0.21"
OffsetArrays = "1"
Plots = "1"
PrecompileTools = "1"
Expand All @@ -61,34 +74,41 @@ RecipesBase = "0.7, 0.8, 1"
SafeTestsets = "0.1"
SparseArrays = "1"
Statistics = "1"
StatsBase = "0.34"
StatsPlots = "0.15"
TableTraits = "1"
Tables = "1"
Test = "1"
Unitful = "1"
julia = "1.6"
julia = "1.9"

[extras]
AlgebraOfGraphics = "cbdf2221-f076-402e-a563-3d30da359d67"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DiskArrays = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
ImageFiltering = "6a3955dd-da59-5b1f-98d4-e7296123deb5"
ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795"
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[targets]
test = ["Aqua", "ArrayInterface", "BenchmarkTools", "ColorTypes", "Combinatorics", "CoordinateTransformations", "DataFrames", "Distributions", "Documenter", "ImageFiltering", "ImageTransformations", "CairoMakie", "OffsetArrays", "Plots", "Random", "SafeTestsets", "StatsPlots", "Test", "Unitful"]
test = ["AlgebraOfGraphics", "Aqua", "ArrayInterface", "BenchmarkTools", "CategoricalArrays", "ColorTypes", "Combinatorics", "CoordinateTransformations", "DataFrames", "DiskArrays", "Distributions", "Documenter", "GPUArrays", "ImageFiltering", "ImageTransformations", "JLArrays", "CairoMakie", "OffsetArrays", "Plots", "Random", "SafeTestsets", "StatsBase", "StatsPlots", "Test", "Unitful"]
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,31 @@
[![Codecov](https://codecov.io/gh/rafaqz/DimensionalData.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/rafaqz/DimensionalData.jl/tree/main)
[![Aqua.jl Quality Assurance](https://img.shields.io/badge/Aqua.jl-%F0%9F%8C%A2-aqua.svg)](https://github.com/JuliaTesting/Aqua.jl)

<img src="https://rafaqz.github.io/DimensionalData.jl/dev/logoDD.png" align="right" style="padding-left:10px;" width="180"/>
<img src="https://rafaqz.github.io/DimensionalData.jl/dev/logo.png" align="right" style="padding-left:10px;" width="180"/>

> [!TIP]
> Visit the latest documentation at https://rafaqz.github.io/DimensionalData.jl/dev/
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.

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).
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](https://xarray.dev/), and is primarily written for use with spatial data in [Rasters.jl](https://github.com/rafaqz/Rasters.jl).

> [!IMPORTANT]
> INSTALLATION
## Installation

```shell
julia>]
pkg> add DimensionalData
```

## Quick start

Start using the package:

```julia
using DimensionalData
```

The basic syntax is:
The basic syntax to create a dimensional array (`DimArray`) is:

```julia
A = DimArray(rand(50, 31), (X(), Y(10.0:40.0)));
Expand Down Expand Up @@ -76,7 +77,7 @@ A[Y=1:10, X=1]
19.0 0.605331
```

We can also subset by lookup, using a `Selector`, lets try `At`:
One can also subset by lookup, using a `Selector`, let's try `At`:

```julia
A[Y(At(25))]
Expand Down Expand Up @@ -112,25 +113,24 @@ boxplot(rand(X('a':'d'), Y(2:5:20)))

And the plot will have the right ticks and labels.

[See the docs for more details](https://rafaqz.github.io/DimensionalData.jl/)
[See the docs for more details](https://rafaqz.github.io/DimensionalData.jl/stable/)

> [!NOTE]
> Recent changes have greatly reduced the exported API.
Previously exported methods can me brought into global scope by `using`
the sub-modules they have been moved to - `LookupArrays` and `Dimensions`:
Previously exported methods can be brought into global scope by `using`
the sub-modules they have been moved to - `Lookup` and `Dimensions`:

```julia
using DimensionalData
using DimensionalData.LookupArrays, DimensionalData.Dimensions
using DimensionalData.Lookup, DimensionalData.Dimensions
```

> [!IMPORTANT]
> Alternative Packages
## Alternative packages

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.

[AxisKeys.jl](https://github.com/mcabbott/AxisKeys.jl) and [AbstractIndices.jl](https://github.com/Tokazama/AbstractIndices.jl) are some other interesting developments. For more detail on why there are so many similar options and where things are headed, read this [thread](https://github.com/JuliaCollections/AxisArraysFuture/issues/1).

The main functionality is explained here, but the full list of features is
listed at the [API](https://rafaqz.github.io/DimensionalData.jl/reference) page.
listed at the [API](https://rafaqz.github.io/DimensionalData.jl/stable/api/reference) page.
21 changes: 10 additions & 11 deletions benchmarks/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,16 @@ a = rand(5, 4, 3);
da = DimArray(a, (Y((1u"m", 5u"m")), X(1:4), Ti(1:3)))
dimz = dims(da)

if VERSION > v"1.1-"
suite["eachslice"] = BenchmarkGroup()
suite["eachslice"]["array_intdim"] = @benchmarkable (()->eachslice($a; dims = 2))();
suite["eachslice"]["dimarray_intdim"] = @benchmarkable (()->eachslice($da; dims = 2))();
suite["eachslice"]["dimarray_dim"] = @benchmarkable (()->eachslice($da; dims = Y()))();
suite["eachslice_to_vector"] = BenchmarkGroup()
suite["eachslice_to_vector"]["array_intdim"] = @benchmarkable [slice for slice in eachslice($a; dims = 2)];
suite["eachslice_to_vector"]["dimarray_intdim"] = @benchmarkable [slice for slice in eachslice($da; dims = 2)];
suite["eachslice_to_vector"]["dimarray_dim"] = @benchmarkable [slice for slice in eachslice($da; dims = X())];
# @test [slice for slice in eachslice(da; dims=1)] == [slice for slice in eachslice(da; dims=Y)]
end
suite["eachslice"] = BenchmarkGroup()
suite["eachslice"]["array_intdim"] = @benchmarkable (()->eachslice($a; dims = 2))();
suite["eachslice"]["dimarray_intdim"] = @benchmarkable (()->eachslice($da; dims = 2))();
suite["eachslice"]["dimarray_dim"] = @benchmarkable (()->eachslice($da; dims = Y()))();
suite["eachslice_to_vector"] = BenchmarkGroup()
suite["eachslice_to_vector"]["array_intdim"] = @benchmarkable [slice for slice in eachslice($a; dims = 2)];
suite["eachslice_to_vector"]["dimarray_intdim"] = @benchmarkable [slice for slice in eachslice($da; dims = 2)];
suite["eachslice_to_vector"]["dimarray_dim"] = @benchmarkable [slice for slice in eachslice($da; dims = X())];
# @test [slice for slice in eachslice(da; dims=1)] == [slice for slice in eachslice(da; dims=Y)]



suite["mean"] = BenchmarkGroup()
Expand Down
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
AlgebraOfGraphics = "cbdf2221-f076-402e-a563-3d30da359d67"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Expand All @@ -12,6 +13,8 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterVitepress = "4710194d-e776-4893-9690-8d956a29c365"
Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
Interfaces = "85a1e053-f937-4924-92a5-1367d23b7b87"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Expand Down
7 changes: 4 additions & 3 deletions docs/logo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ meshscatter!(ax, base_points; marker=Rect3f(Vec3f(-0.5,-0.5,0), Vec3f(1,1,1)),
markersize = Vec3f.(0.5,0.5, z), color=z, colormap=tuple.(colors, 1), transparency=false)

mkpath(joinpath(@__DIR__, "src", "assets"))
save(joinpath(@__DIR__, "src", "assets", "logoDD.svg"), fig; pt_per_unit=0.75)
save(joinpath(@__DIR__, "src", "assets", "logoDD.png"), fig; px_per_unit=2)
save(joinpath(@__DIR__, "src", "assets", "favicon.png"), fig; px_per_unit=0.25)
save(joinpath(@__DIR__, "src", "assets", "logo.svg"), fig; pt_per_unit=0.75)
save(joinpath(@__DIR__, "src", "assets", "logo.png"), fig; px_per_unit=2)
save(joinpath(@__DIR__, "src", "assets", "favicon.png"), fig; px_per_unit=0.25)
mv(joinpath(@__DIR__, "src", "assets", "favicon.png"), joinpath(@__DIR__, "src", "assets", "favicon.ico"))
11 changes: 8 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
using DocumenterVitepress
using Documenter
using DimensionalData
using Dates
using DimensionalData.Dimensions
using DimensionalData.Lookups

# Names are available everywhere so that [`function`](@ref) works.
# ====================

DocMeta.setdocmeta!(DimensionalData, :DocTestSetup, :(using DimensionalData, DimensionalData.Dimensions, DimensionalData.Dimensions.Lookups); recursive=true)
doctest_setup = quote
using DimensionalData
using DimensionalData.Dimensions
using DimensionalData.Dimensions.Lookups
end
DocMeta.setdocmeta!(DimensionalData, :DocTestSetup, doctest_setup; recursive=true)

# Build documentation.
# ====================
Expand All @@ -22,8 +28,7 @@ makedocs(; sitename="DimensionalData", authors="Rafael Schouten et al.",
),
draft=false,
source="src",
build="build",
# warnonly = true,
build="build",
)

# Deploy built documentation.
Expand Down
Loading

0 comments on commit cf57f86

Please sign in to comment.