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
Open
@adku1173

Description

@adku1173

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'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0