Move sofar-related pyfar functionality to sofar

Open
#143 2 comments 0 reactions 1 assignee View on GitHub

@f-brinkmann is already working on this.

Since Aug 21, 2026.

Assessment

This issue has not been assessed yet.

Description

feature

In https://github.com/pyfar/pyfar/issues/958, we decided to

  • move the functionality pyfar.io.read_sofa and convert_sofa to sofar
  • implement possibly identical behavior to the classes Sofa and SofaStream
  • improve flexibility to return arbitrary coordinates

I would suggest to add methods as_audio_object and as_coordinates.

as_audio_object()

  • will return values in Sofa.Data as a pyfar Signal or FrequencyData depnding on the data type of the Sofa object
  • In case of SofaStream it could have an addition parameter slice to determine which data is returned

as_coordinates(attribute)

  • works as the above, with attribute determining which data of the Sofa object is returned as coordinates
  • also has the additional slice parameter for SofaStream

The only difference between Sofa and SofaStream methods is how the actual data is obtained. Everything else can be moved into shared private functions to avoid redundant code.

If we consider this to be some kind of I/O functionality, it might be more consistent to implement this as sofar.as_audio_object otherwise it could be Sofa.as_audio_object and SofaStream.as_audio_object.

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.