Skip to content
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

Tasks outside qudi-core are not found #96

Open
simon1schmitt opened this issue May 13, 2024 · 0 comments
Open

Tasks outside qudi-core are not found #96

simon1schmitt opened this issue May 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@simon1schmitt
Copy link
Contributor

Version

Development

What is affected by the bug?

Similar to adding additional fit-methods, I expected that it would be possible to include tasks by placing the corresponding python files into 'src/qudi/tasks' of a different project (so not qudi-core). This, however, seems not to work. After moving these python files into the tasks-folder of the qudi-core-module, everything works as expected (so python syntax or similar should not be the problem).

When does the bug occur?

Whenever trying to add tasks from a different project.

How do we replicate the issue?

In a different project (for example the qudi-iqo-modules), create a folder under 'src/qudi/tasks' and put a corresponding file into it (for example simply copy present test_task file and change the task names).

Expected behavior

From my understanding, it should be possible to add tasks without putting them into the qudi-core-project directly.

Relevant log output

Exception during activation:

ModuleNotFoundError: No module named 'tasks.my_test_tasks'
Traceback (most recent call last):

  File "...\qudi-core\src\qudi\core\module.py", line 301, in __activation_callback
    self.on_activate()

  File "...\qudi-core\src\qudi\logic\taskrunner.py", line 61, in on_activate
    task = import_module_script(module, cls, reload=self._consecutive_activation)

  File "C:\Users\simon.schmitt\dev\repos\qudi\qudi-core\src\qudi\core\scripting\modulescript.py", line 243, in import_module_script
    mod = importlib.import_module(module)

  File "C:\Users\simon.schmitt\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import

  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load

  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked

Additional Comments

Removed personal file paths in stack trace.

Contact Details

[email protected]

@simon1schmitt simon1schmitt added the bug Something isn't working label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant