JuliaInterop / JuliaInterop/MATLAB.jl
mxarray on partially initialized structs
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 286
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
In one of the packages I use there is a struct that gets partially initialized. This makes it so mxarray fails because of :
mxarray.jl:488
set_field(mx, names_str[i], mxarray(getfield(d, names[i])))
getfield throws an error, as this field isn't defined. I'm not entirely sure how to go about fixing this. I guess you could add a new UNDEF struct in matlab.jl, check if isdefined(d,names[i]) and if not, do set_field(mx,names_str[i],mxarray(UNDEF)) (if this sounds ok I'll open a pull request).
Alternatively, I can define my own mxstruct conversions for those problematic types.
Contributor guide
No contributing guide indexed for this repository
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 at mxarray.jl:488 and inspect how partially initialized struct fields are handled before getfield is called. Review matlab.jl for the proposed undefined-value representation; done means mxarray can convert such structs without failing while preserving the missing-field state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100