Skip to content

Commit

Permalink
Process module search fix (lava-nc#285)
Browse files Browse the repository at this point in the history
* update refport unittest to always wait when it writes to port for consistent behavior

Signed-off-by: bamsumit <[email protected]>

* Removed pyproject changes

Signed-off-by: bamsumit <[email protected]>

* Fix to convolution tests. Fixed imcompatible mnist_pretrained for old python versions.

Signed-off-by: bamsumit <[email protected]>

* Missing moudle parent fix

Signed-off-by: bamsumit <[email protected]>
  • Loading branch information
bamsumit authored Jul 28, 2022
1 parent 53e2781 commit 55b8eb8
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/lava/magma/compiler/compiler_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,23 +811,24 @@ def _find_proc_models(proc: AbstractProcess) \
if not proc_module.__name__ == "__main__":
# Get the parent module.
module_spec = importlib.util.find_spec(proc_module.__name__)
parent_module = importlib.import_module(module_spec.parent)

# Get all the modules inside the parent (namespace) module. This
# is required here, because the namespace module can span multiple
# repositories.
namespace_module_infos = list(
pkgutil.iter_modules(
parent_module.__path__,
parent_module.__name__ + "."
if module_spec.parent:
parent_module = importlib.import_module(module_spec.parent)

# Get all the modules inside the parent (namespace) module.
# This is required here, because the namespace module can span
# multiple repositories.
namespace_module_infos = list(
pkgutil.iter_modules(
parent_module.__path__,
parent_module.__name__ + "."
)
)
)

# Extract the directory name of each module.
for _, name, _ in namespace_module_infos:
module = importlib.import_module(name)
module_dir_name = os.path.dirname(inspect.getfile(module))
dir_names.append(module_dir_name)
# Extract the directory name of each module.
for _, name, _ in namespace_module_infos:
module = importlib.import_module(name)
module_dir_name = os.path.dirname(inspect.getfile(module))
dir_names.append(module_dir_name)

# Go through all directories and extract all the ProcModels.
for dir_name in dir_names:
Expand Down

0 comments on commit 55b8eb8

Please sign in to comment.