SciML / SciML/ComponentArrays.jl

Implementation of a `merge` function

Open
#186 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
375
Forks
42
Avg merge
7h 25m
Merged PRs (30d)
17

Description

Hey there,
I thought it'd be very cool to have a specialisation of the merge function for ComponentArrays, with a similar behaviour as with Dictionarys or NamedTuples.

For instance, consider

N = 2
p = (r = ones(N), b = 3 * ones(N))
p2 = (r = 2 * ones(N))
merge(p, p2) #outputs (r = [2.0, 2.0], b = [3.0, 3.0])

It could be useful to have a similar functionality with p and p2 being ComponentArrays.
I am not sure whether this could be efficiently implemented though.

Contributor guide

Open the contributing guide

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

Start by examining the existing merge behavior for Dictionarys and NamedTuples, then trace how ComponentArrays represent named components. Define the expected merge behavior from the provided p and p2 example, including overriding r while preserving b, and verify the result with focused tests for ComponentArrays.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.