Hot: inspect fails for newliy written string variables

Open
#129 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start with the provided reproduction using Sofa.add_variable and Sofa.inspect, then compare the in-memory object with the object returned after write_sofa/read_sofa. Trace why inspect handles the round-tripped string variable but not the newly created one; done means inspect succeeds for the in-memory string variable without requiring serialization.

Written by the indexing model from the issue text.

Description

hot

inspect fails for newliy written string variables

    sofa_test = sf.Sofa('GeneralTF')
    sofa_test.add_variable('TestString', 'test', 'string', 'S')
    sofa_test.inspect()

in this case sofa_test.inspect()fails, since 'test' does not have size attribute.
Not sure were to fix this, otherwise I would have opend a PR directly.

and this would work:

    sofa_test = sf.Sofa('GeneralTF')
    sofa_test.add_variable('TestString', 'test', 'string', 'S')
    sf.write_sofa(sofa_test, 'test.sofa')
    sofa_test = sf.read_sofa('test.sofa')
    sofa_test.inspect()
Dominant language
Python
Stars
37
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from pyfar/sofar

All issues in pyfar/sofar

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.