Skip to content

Commit

Permalink
Make expand_dimensions definitions non ambiguous (#795)
Browse files Browse the repository at this point in the history
* Make expand_dimensions definitions non ambiguous

* Update README.md formatting

* Fix vertexgrid conversions in DimensionalData

* Fix all issues by using conversion trait only in 2d plots

since that's what we'd do anyway

* Use a more intelligent method to check the axis type

* Get tests going

* Add comments + regular sampling check function

* Drop Makie v0.19 compat, bump patch version

* Drop Makie v0.19 compat, add checks for regular sampling

This also fixes the convert_args for vertexgrid which was using the wrong array for lookup, causing y-flipped contourf for example.

* Regular and categorical sampling are both acceptable

* Apply suggestions from code review

Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>

* Use DD.shiftlocus for intervals to points

* Treat axis and figure keyword arguments differently

They're my special snowflakes ♡ヮ♡

* Handle axis + figure attributes better

* remove axis kwargs from where they shouldn't be

* fix wrong attr passing when axis type is known

* Warn only on irregular lookup

* more information about why this is bad

* Define a fallback for NoConversion traits

* Specific convert for spy to compute intervals

It semi works but the dimensions are still wrong, probably because of Makie converts..

---------

Co-authored-by: Lazaro Alonso <lazarus.alon@gmail.com>
Co-authored-by: Rafael Schouten <rafaelschouten@gmail.com>
  • Loading branch information
3 people authored Sep 14, 2024
1 parent caac174 commit d857504
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 53 deletions.
4 changes: 2 additions & 2 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 <rafaelschouten@gmail.com>"]
version = "0.27.9"
version = "0.27.10"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down Expand Up @@ -57,7 +57,7 @@ InvertedIndices = "1"
IteratorInterfaceExtensions = "1"
JLArrays = "0.1"
LinearAlgebra = "1"
Makie = "0.19, 0.20, 0.21"
Makie = "0.20, 0.21"
OffsetArrays = "1"
Plots = "1"
PrecompileTools = "1"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ DimensionalData.jl provides tools and abstractions for working with datasets tha

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).

> [!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
```

One 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 @@ -125,8 +126,7 @@ using DimensionalData
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.

Expand Down
Loading

0 comments on commit d857504

Please sign in to comment.