• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

rafaqz/DimensionalData.jl: Named dimensions and indexing for julia arrays and ot ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

rafaqz/DimensionalData.jl

开源软件地址:

https://github.com/rafaqz/DimensionalData.jl

开源编程语言:

Julia 100.0%

开源软件介绍:

DimensionalData

CI Codecov Aqua.jl Quality Assurance

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 with a cleaner syntax, and additional functionality found in NamedDims.jl. It has similar goals to pythons xarray, and is primarily written for use with spatial data in Rasters.jl.

The basic syntax is:

julia> using DimensionalData

julia> rand(X(10.0:40.0), Y(50))
31×50 DimArray{Float64,2} with dimensions:
  X Sampled 10.0:1.0:40.0 ForwardOrdered Regular Points,
  Y
 0.793097  0.489866  0.4623960.910434  0.850573   0.183605
 0.76277   0.737544  0.290279     0.742267  0.686086   0.530159
 ⋮                             ⋱
 0.281043  0.979182  0.868658     0.642477  0.139536   0.540512
 0.546036  0.83382   0.5300980.351608  0.0385814  0.159299

julia> A[Y=1, X=1:10]
10-element DimArray{Float64,1} with dimensions:
  X Sampled 10.0:1.0:19.0 ForwardOrdered Regular Points
and reference dimensions: Y
 0.245691
 0.902444
 0.7774410.744612
 0.440409
 0.631956

See the docs for more details

Some properties of DimensionalData.jl objects:

  • broadcasting and most Base methods maintain and sync dimension context.
  • comprehensive plot recipes for Plots.jl.
  • a Tables.jl interface with DimTable
  • multi-layered DimStacks that can be indexed together, and have base methods applied to all layers.
  • the Adapt.jl interface for use on GPUs, even as GPU kernel arguments.
  • traits for handling a wide range of spatial data types accurately.

Methods where dims can be used containing indices or Selectors

getindex, setindex! view

Methods where dims, dim types, or Symbols can be used to indicate the array dimension:

  • size, axes, firstindex, lastindex
  • cat, reverse, dropdims
  • reduce, mapreduce
  • sum, prod, maximum, minimum,
  • mean, median, extrema, std, var, cor, cov
  • permutedims, adjoint, transpose, Transpose
  • mapslices, eachslice

Methods where dims can be used to construct DimArrays:

  • fill, ones, zeros, falses, trues, rand

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:

using DimensionalData
using DimensionalData.LookupArrays, DimensionalData.Dimensions

Alternate 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 and 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.

The main functionality is explained here, but the full list of features is listed at the API page.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap