Skip to content

Commit 4b70874

Browse files
committed
Change scheduler naming (#188)
1 parent ef41764 commit 4b70874

File tree

11 files changed

+86
-85
lines changed

11 files changed

+86
-85
lines changed

docs/images/tickit-overview-with-system-component.svg

Lines changed: 17 additions & 0 deletions
Loading

docs/images/tickit-simple-overview-with-system-simulation.svg

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/user/explanations/components.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ System Simulation
2222

2323
System simulation components are themselves entire tickit simulations. They
2424
contain their own device simulation components and a scheduler for orchestrating
25-
them. However, the scheduler in a system component acts as a slave scheduler
25+
them. However, the scheduler in a system component acts as a nested scheduler
2626
which is driven by the master scheduler in the top level of the simulation
2727
it belongs to.
2828

@@ -75,7 +75,7 @@ The Overall Simulation
7575

7676
A simulation containing both types of component will look something like this:
7777

78-
.. figure:: ../../images/tickit-simple-overview-with-system-simulation.svg
78+
.. figure:: ../../images/tickit-overview-with-system-component.svg
7979
:align: center
8080

8181

docs/user/explanations/glossary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Glossary
2020
unpredictable internal changes.
2121

2222
System Simulation
23-
A system simulation is a component which wraps a slave scheduler and a
23+
A system simulation is a component which wraps a nested scheduler and a
2424
collection of components, allowing for infinitely nested systems.
2525

2626
Device Simulation

docs/user/reference/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ This is the internal API reference for tickit
8585
``tickit.core.management.schedulers.master``
8686
--------------------------------------------
8787

88-
.. automodule:: tickit.core.management.schedulers.slave
88+
.. automodule:: tickit.core.management.schedulers.nested
8989
:members:
9090

91-
``tickit.core.management.schedulers.slave``
92-
-------------------------------------------
91+
``tickit.core.management.schedulers.nested``
92+
--------------------------------------------
9393

9494

9595
.. automodule:: tickit.core.management.event_router

src/tickit/core/components/component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Component:
3535
An interface for types which implement stand-alone simulation components.
3636
Components define the top level building blocks of a tickit simulation (examples
3737
include the DeviceComponent which host a device and corresponding adapter or a
38-
SystemComponent which hosts a SlaveScheduler and internal Components).
38+
SystemComponent which hosts a NestedScheduler and internal Components).
3939
"""
4040

4141
name: ComponentID

src/tickit/core/components/system_component.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from tickit.core.adapter import AdapterContainer
1010
from tickit.core.components.component import BaseComponent, Component, ComponentConfig
1111
from tickit.core.management.event_router import InverseWiring
12-
from tickit.core.management.schedulers.slave import SlaveScheduler
12+
from tickit.core.management.schedulers.nested import NestedScheduler
1313
from tickit.core.state_interfaces.state_interface import StateConsumer, StateProducer
1414
from tickit.core.typedefs import Changes, ComponentID, ComponentPort, PortID, SimTime
1515
from tickit.utils.topic_naming import output_topic
@@ -19,9 +19,9 @@
1919

2020
@dataclass
2121
class SystemComponent(BaseComponent):
22-
"""A component containing a slave scheduler and several components.
22+
"""A component containing a nested scheduler and several components.
2323
24-
A component which acts as a nested tickit simulation by wrapping a slave scheduler
24+
A component which acts as a nested tickit simulation by wrapping a NestedScheduler
2525
and a set of internal components, this component delegates core behaviour to the
2626
components within it, whilst outputting their requests for wakeups and interrupts.
2727
"""
@@ -49,7 +49,7 @@ async def run_forever(
4949
blocks until and of the components or the scheduler complete.
5050
"""
5151
inverse_wiring = InverseWiring.from_component_configs(self.components)
52-
self.scheduler = SlaveScheduler(
52+
self.scheduler = NestedScheduler(
5353
inverse_wiring,
5454
state_consumer,
5555
state_producer,
@@ -75,10 +75,10 @@ async def run_forever(
7575
await asyncio.wait(self._tasks)
7676

7777
async def on_tick(self, time: SimTime, changes: Changes) -> None:
78-
"""Delegates core behaviour to the slave scheduler.
78+
"""Delegates core behaviour to the nested scheduler.
7979
8080
An asynchronous method which delegates core behaviour of computing changes and
81-
determining a callback period to the slave scheduler and sends the resulting
81+
determining a callback period to the nested scheduler and sends the resulting
8282
Output.
8383
8484
Args:

src/tickit/core/management/schedulers/slave.py renamed to src/tickit/core/management/schedulers/nested.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
LOGGER = logging.getLogger(__name__)
2121

2222

23-
class SlaveScheduler(BaseScheduler):
24-
"""A slave scheduler which orchestrates nested tickit simulations."""
23+
class NestedScheduler(BaseScheduler):
24+
"""A scheduler which orchestrates nested tickit simulations."""
2525

2626
def __init__(
2727
self,
@@ -31,7 +31,7 @@ def __init__(
3131
expose: Dict[PortID, ComponentPort],
3232
raise_interrupt: Callable[[], Awaitable[None]],
3333
) -> None:
34-
"""Slave scheduler constructor which adds wiring and saves values for reference.
34+
"""NestedScheduler constructor which adds wiring and saves values for reference.
3535
3636
Args:
3737
wiring (Union[Wiring, InverseWiring]): A wiring or inverse wiring object
@@ -40,10 +40,10 @@ def __init__(
4040
by the component.
4141
state_producer (Type[StateProducer]): The state producer class to be used
4242
by the component.
43-
expose (Dict[PortID, ComponentPort]): A mapping of slave scheduler
43+
expose (Dict[PortID, ComponentPort]): A mapping of nested scheduler
4444
outputs to internal component ports.
4545
raise_interrupt (Callable[[], Awaitable[None]]): A callback to request that
46-
the slave scheduler is updated immediately.
46+
the nested scheduler is updated immediately.
4747
"""
4848
wiring = self.add_exposing_wiring(wiring, expose)
4949
super().__init__(wiring, state_consumer, state_producer)
@@ -57,22 +57,22 @@ def add_exposing_wiring(
5757
wiring: Union[Wiring, InverseWiring],
5858
expose: Dict[PortID, ComponentPort],
5959
) -> InverseWiring:
60-
"""Adds wiring to expose slave scheduler outputs.
60+
"""Adds wiring to expose nested scheduler outputs.
6161
62-
Adds wiring to expose slave scheduler outputs, this is performed creating a
62+
Adds wiring to expose nested scheduler outputs, this is performed creating a
6363
mock "expose" component with inverse wiring set by expose.
6464
6565
Args:
6666
wiring (Union[Wiring, InverseWiring]): A wiring or inverse wiring object
6767
representing the connections between components in the system.
68-
expose (Dict[PortID, ComponentPort]): A mapping of slave scheduler
68+
expose (Dict[PortID, ComponentPort]): A mapping of nested scheduler
6969
outputs to internal component ports.
7070
7171
Returns:
7272
InverseWiring:
7373
An inverse wiring object representing the connections between
7474
components in the system and the "expose" component which acts as the
75-
slave scheduler output.
75+
nested scheduler output.
7676
"""
7777
if isinstance(wiring, Wiring):
7878
wiring = InverseWiring.from_wiring(wiring)
@@ -109,7 +109,7 @@ async def on_tick(
109109
110110
An asynchronous method which determines which components within the simulation
111111
require being woken up, sets the input changes for use by the "external" mock
112-
component, performs a tick, determines the period in which the slave scheduler
112+
component, performs a tick, determines the period in which the nested scheduler
113113
should next be updated, and returns the changes collated by the "expose" mock
114114
component.
115115
@@ -122,7 +122,7 @@ async def on_tick(
122122
Tuple[Changes, Optional[SimTime]]:
123123
A tuple of a mapping of the changed exposed outputs and their new
124124
values and optionally a duration in simulation time after which the
125-
slave scheduler should be called again.
125+
nested scheduler should be called again.
126126
"""
127127
wakeup_components = {
128128
component for component, when in self.wakeups.items() if when <= time
@@ -163,7 +163,7 @@ async def schedule_interrupt(self, source: ComponentID) -> None:
163163
async def handle_component_exception(self, message: ComponentException) -> None:
164164
"""Handle exceptions raised from components by shutting down the simulation.
165165
166-
If a component inside a system simulation produces an exception, the slave
166+
If a component inside a system simulation produces an exception, the nested
167167
scheduler will produce a message to all components it contains to cause them
168168
to cancel any running component tasks (adapter tasks). Afterwards the scheduler
169169
stores the ComponentException message, allowing its associated system simulation

0 commit comments

Comments
 (0)