panic should not occur when host attribute does not exist #281

Closed
opened 2022-04-27 17:30:39 +08:00 by sb10q · 0 comments
from artiq.experiment import *
from artiq.coredevice.core import Core
from artiq.coredevice.ttl import TTLOut

@nac3
class CorePause(EnvExperiment):
    core: KernelInvariant[Core]
    led: KernelInvariant[TTLOut]

    def build(self):
        self.setattr_device("core")

    @kernel
    def run(self):
        pass
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'AttributeError'>, value: AttributeError("'CorePause' object has no attribute 'led'"), traceback: None }', nac3artiq/src/symbol_resolver.rs:1100:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/nix/store/qar69gl7dj6qsxzbfnad2zxydqzys22f-python3.9-artiq-8.0.unknown.beta/bin/.artiq_run-wrapped", line 9, in <module>
    sys.exit(main())
  File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 174, in main
    return run(with_file=True)
  File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 155, in run
    exp_inst.run()
  File "/home/sb/artiq/artiq/language/core.py", line 79, in run_on_core
    self.core.run(fake_method, args, kwargs)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 83, in run
    kernel_library = self.compile(function, args, kwargs, embedding_map)
  File "/home/sb/artiq/artiq/coredevice/core.py", line 77, in compile
    return self.compiler.compile_method_to_mem(obj, name, args, embedding_map)
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'AttributeError'>, value: AttributeError("'CorePause' object has no attribute 'led'"), traceback: None }
``` from artiq.experiment import * from artiq.coredevice.core import Core from artiq.coredevice.ttl import TTLOut @nac3 class CorePause(EnvExperiment): core: KernelInvariant[Core] led: KernelInvariant[TTLOut] def build(self): self.setattr_device("core") @kernel def run(self): pass ``` ``` thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'AttributeError'>, value: AttributeError("'CorePause' object has no attribute 'led'"), traceback: None }', nac3artiq/src/symbol_resolver.rs:1100:22 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Traceback (most recent call last): File "/nix/store/qar69gl7dj6qsxzbfnad2zxydqzys22f-python3.9-artiq-8.0.unknown.beta/bin/.artiq_run-wrapped", line 9, in <module> sys.exit(main()) File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 174, in main return run(with_file=True) File "/home/sb/artiq/artiq/frontend/artiq_run.py", line 155, in run exp_inst.run() File "/home/sb/artiq/artiq/language/core.py", line 79, in run_on_core self.core.run(fake_method, args, kwargs) File "/home/sb/artiq/artiq/coredevice/core.py", line 83, in run kernel_library = self.compile(function, args, kwargs, embedding_map) File "/home/sb/artiq/artiq/coredevice/core.py", line 77, in compile return self.compiler.compile_method_to_mem(obj, name, args, embedding_map) pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'AttributeError'>, value: AttributeError("'CorePause' object has no attribute 'led'"), traceback: None } ```
sb10q added this to the Alpha milestone 2022-04-27 17:30:47 +08:00
sb10q closed this issue 2022-05-18 06:36:21 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#281
There is no content yet.