You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromlava.magma.core.process.processimportAbstractProcessclassTestProcess(AbstractProcess):
"""Test process for proc-model search"""
models.py
fromlava.magma.core.model.modelimportAbstractProcessModelfromlava.magma.core.decoratorimportimplementsfromlava.magma.core.sync.protocols.loihi_protocolimportLoihiProtocolfrom .processimportTestProcess@implements(proc=TestProcess, protocol=LoihiProtocol)classTestModelRelative(AbstractProcessModel):
"""Process model defined using relative import of Process."""
When running a network with TestProcess,
Cannot import module 'modules' when searching ProcessModels for Process 'TestProcess'.
Expected behavior
The compiler finds the associated process model.
Environment (please complete the following information):
Device: Laptop
OS: Ubuntu
Lava version: 0.10.0
Additional context
I believe the issue stems from using file paths for importing the modules containing process models. When importing this way, relative imports do not work since the information about the parent module is lost. This can be avoided by importing the modules by name and adding the appropriate prefixes when iterating through submodules.
The text was updated successfully, but these errors were encountered:
Describe the bug
If a process model is defined using a relative import, the function
ProcGroupDiGraphs._find_proc_models()
fails to find it.To reproduce current behavior
Steps to reproduce the behavior:
process.py
models.py
Expected behavior
The compiler finds the associated process model.
Environment (please complete the following information):
Additional context
I believe the issue stems from using file paths for importing the modules containing process models. When importing this way, relative imports do not work since the information about the parent module is lost. This can be avoided by importing the modules by name and adding the appropriate prefixes when iterating through submodules.
The text was updated successfully, but these errors were encountered: