forked from M-Labs/artiq
coredevice: fix typing problems
This commit is contained in:
parent
c8ebd80fe2
commit
8f596ed04f
|
@ -87,7 +87,7 @@ class Core:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@portable
|
@portable
|
||||||
def seconds_to_mu(self, seconds: float):
|
def seconds_to_mu(self, seconds: float) -> int64:
|
||||||
"""Convert seconds to the corresponding number of machine units
|
"""Convert seconds to the corresponding number of machine units
|
||||||
(RTIO cycles).
|
(RTIO cycles).
|
||||||
|
|
||||||
|
@ -96,12 +96,12 @@ class Core:
|
||||||
return int64(seconds//self.ref_period)
|
return int64(seconds//self.ref_period)
|
||||||
|
|
||||||
@portable
|
@portable
|
||||||
def mu_to_seconds(self, mu: int64):
|
def mu_to_seconds(self, mu: int64) -> float:
|
||||||
"""Convert machine units (RTIO cycles) to seconds.
|
"""Convert machine units (RTIO cycles) to seconds.
|
||||||
|
|
||||||
:param mu: cycle count to convert.
|
:param mu: cycle count to convert.
|
||||||
"""
|
"""
|
||||||
return mu*self.ref_period
|
return float(mu)*self.ref_period
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
def delay(self, dt: float):
|
def delay(self, dt: float):
|
||||||
|
@ -132,7 +132,7 @@ class Core:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
def get_rtio_destination_status(self, destination: int32):
|
def get_rtio_destination_status(self, destination: int32) -> bool:
|
||||||
"""Returns whether the specified RTIO destination is up.
|
"""Returns whether the specified RTIO destination is up.
|
||||||
This is particularly useful in startup kernels to delay
|
This is particularly useful in startup kernels to delay
|
||||||
startup until certain DRTIO destinations are up."""
|
startup until certain DRTIO destinations are up."""
|
||||||
|
|
Loading…
Reference in New Issue