SciML / SciML/ComponentArrays.jl
Constructors should just construct
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 375
- Forks
- 42
- Avg merge
- 7h 25m
- Merged PRs (30d)
- 17
Description
There is too much "non-constructor" work being done by dispatching on constructor methods right now. One big issue with the way it's set up right now is that ComponentArray(x) returns x in cases where x isn't a NamedTuple. This is bad. Constructors should only return their type. All of the recursive handling we're doing in the constructors should be a separate function.
I also have a feeling we could more easily solve some of the indexing constant folding issues if this were simplified.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the ComponentArray(x) constructor and the current dispatch on constructor methods, then inspect how recursive handling and indexing constant folding depend on them. Done means constructors only return their declared type, with recursive handling moved to a separate function and the existing ComponentArray(x) behavior reviewed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100