JuliaArrays / JuliaArrays/StaticArrays.jl

Allow StaticArray or FieldVector with extra fields

Open
#592 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design feature
Dominant language
Julia
Stars
844
Forks
159
Avg merge
3d 21h
Merged PRs (30d)
3

Description

It would be nice if custom defined StaticArrays or FieldVectors could have extra fields which would not form part of the array. Example:

struct Point3D <: FieldVector{3, Float64}
    x::Float64
    y::Float64
    z::Float64
    proj::String # Proj4 or similar string
end

This feature would allow to use arbitrary fields of a type to be exposed as a vector, and then be used in e.g. diff-eq solver.

I don't think this can work with the current similar_type interface. If similar_type would take an instance instead of a type, then that could be used to make an appropriate constructor.

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

Review the StaticArray and FieldVector definitions and the similar_type interface first. Confirm how custom fields can be excluded from the array representation while remaining available on the type, and verify that the resulting vector can be used by differential-equation solvers.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.