deriving from EnvExperiment causes compilation failure #80
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#80
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Experiments in ARTIQ derive from
EnvExperiment
, and this is currently incompatible with NAC3. The compiler fails with this rather obscure error message:Should we just ignore ancestor classes that are not decorated with
@nac3
?and decorating
EnvExperiment
and its ancestors with@nac3
fails with:Removing the
Experiment
ancestor works around the problem.Doing it naively may not be a good idea because it would silently ignore ancestors where the user made a typo in the class name. If we go this route we should at least check that the ancestor class exists on the CPython side and raise an error if it does not.
Currently in nac3core, the
@nac3
annotated classes only allow single inheritance to prevent some troubles from multiple inheritance.(I am not sure... but should we relax this limitation to allow multiple inheritance, but only permit the cases that at most one of the base classes can be constructed on the kernel (have their constructor annotated by@kernel
)?)For nac3artiq, I think if the user made a typo, the python interpreter would complain so we can safely ignore those not decorated with
@nac3
and do not check anything in nac3core?For nac3standalone, I think the check is still necessary now and it would not be a good idea if we ignore them...
So maybe the nac3core needs to have two modes? Under the mode for nac3artiq it ignores the base class not decorated in
@nac3
, under the mode for standalone it does not?What about filtering out ancestor classes that are not decorated with nac3 in nac3artiq? Just a set of class python IDs that are annotated with nac3, so we can filter out those that are not annotated.
@pca006132 Sounds good.