8000 BUG: basename search does not account for multiple sources · Issue #459 · acoular/acoular · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

BUG: basename search does not account for multiple sources #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
adku1173 opened this issue Apr 11, 2025 · 0 comments
Open

BUG: basename search does not account for multiple sources #459

adku1173 opened this issue Apr 11, 2025 · 0 comments
Assignees
Labels

Comments

@adku1173
Copy link
Member

Using the following code results in basename 'void'

import acoular as ac

ts = ac.TimeSamples(file='three_sources.h5')
mx = ac.SourceMixer(sources=[ts])
c = ac.Cache(source=mx)
c.basename

This is unexpected and caused by the current implementation of

def find_basename(source, alternative_basename='void'):
"""Return the basename of the original source.
Traverses the source chain of the object and returns the basename of the original source.
If the source object does not have a basename, uses the alternative basename.
Parameters
----------
source : instance
:class:`~acoular.base.Generator` derived object
alternative_basename : str
Alternative basename to use if the source object does not have a basename.
Returns
-------
str
Basename of the original source.
"""
while source:
basename = getattr(source, 'basename', None)
if basename is not None:
return basename
source = getattr(source, 'source', None)
return alternative_basename

which does not account for the attribute 'sources'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0