Skip to content

Commit d7314c8

Browse files
committed
Add @propertys for SchedulerState attributes
Ensures these Cython attributes can be retrieved by Python code.
1 parent ce72291 commit d7314c8

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

distributed/scheduler.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,70 @@ def __init__(
16181618
self._workers_dv: dict = cast(dict, self._workers)
16191619
super().__init__(**kwargs)
16201620

1621+
@property
1622+
def bandwidth(self):
1623+
return self._bandwidth
1624+
1625+
@property
1626+
def clients(self):
1627+
return self._clients
1628+
1629+
@property
1630+
def extensions(self):
1631+
return self._extensions
1632+
1633+
@property
1634+
def host_info(self):
1635+
return self._host_info
1636+
1637+
@property
1638+
def idle(self):
1639+
return self._idle
1640+
1641+
@property
1642+
def n_tasks(self):
1643+
return self._n_tasks
1644+
1645+
@property
1646+
def resources(self):
1647+
return self._resources
1648+
1649+
@property
1650+
def saturated(self):
1651+
return self._saturated
1652+
1653+
@property
1654+
def tasks(self):
1655+
return self._tasks
1656+
1657+
@property
1658+
def total_nthreads(self):
1659+
return self._total_nthreads
1660+
1661+
@property
1662+
def total_occupancy(self):
1663+
return self._total_occupancy
1664+
1665+
@total_occupancy.setter
1666+
def total_occupancy(self, v: double):
1667+
self._total_occupancy = v
1668+
1669+
@property
1670+
def unknown_durations(self):
1671+
return self._unknown_durations
1672+
1673+
@property
1674+
def unrunnable(self):
1675+
return self._unrunnable
1676+
1677+
@property
1678+
def validate(self):
1679+
return self._validate
1680+
1681+
@property
1682+
def workers(self):
1683+
return self._workers
1684+
16211685
def _remove_from_processing(self, ts: TaskState) -> str:
16221686
"""
16231687
Remove *ts* from the set of processing tasks.

0 commit comments

Comments
 (0)