If "class-defined ICA" is equivalent to ica.py
in this article Sound Source Separation by Independent Component Analysis
ica.py
in the same folder and run the caller script file using that folder as the current folder.ica.py
file resides to the environment variable PYTHONPATH
.ica.py
in the same folder, and move the current folder during import as follows:importos
curdir=os.getcwd()
os.chdir(os.path.dirname(os.path.abspath(__file__)))
from ica import ICA
os.chdir (curdir)
ica.py
file resides to the beginning of the module path variable sys.path.import sys
sys.path [0:0] = 'path/to/ica.py folder'
from ica import ICA
ica
folder is located in place of the folder where ica.py
is located in one of the above ways:
ica
Create folder_init__.py
file in the ica
folder and leave the contents of the ica.py
file intactica
Copy the ica.py
file into the folder, create an additional _init__.py
file, and write the following:ica
Create folder_init__.py
file in the ica
folder and leave the contents of the ica.py
file intactica
Copy the ica.py
file into the folder, create an additional _init__.py
file, and write the following:_init__.py
file in the ica
folder and leave the contents of the ica.py
file intactica
Copy the ica.py
file into the folder, create an additional _init__.py
file, and write the following:from.ica import ICA
© 2025 OneMinuteCode. All rights reserved.