JuliaArrays / JuliaArrays/AxisArrays.jl

Question: How to change axis?

Open
#100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
207
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Hi,
I am wondering if there is a way to change axes.
For example,

using Unitful
using AxisArrays
const μm = u"μm"
const s = u"s"

tmp = AxisArray(rand(1000,1000,2,2), (:x, :y, :z, :t), (0.577μm, 0.577μm, 5μm, 2s))

I would like to change 0.577μm of :x to some other values. Is there easy with to change it (without generating a new array)?
I tried several things. All didn't work.

# All below do not work.
tmp[Axis{:x}] = 1:1000 
tmp = AxisArray(tmp, (:x), (1))
tmp = AxisArray(tmp, (:x, :y, :z, :t), (1, 0.577μm, 5μm, 2s)) # This generates additional axis.

Best,

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified in the issue. Start by reproducing the Julia example with AxisArrays and inspect the documented axis-construction and indexing behavior; the work is done only when the supported way to change the :x axis without generating a new array is established or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.