Skip to content

Commit

Permalink
Updating documents for library name change.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesArruda committed Dec 10, 2024
1 parent 0079fb8 commit 3ab7ac0
Show file tree
Hide file tree
Showing 20 changed files with 151 additions and 151 deletions.
26 changes: 13 additions & 13 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@
myst_heading_anchors = 2
myst_substitutions = {
"rtd": "[Read the Docs](https://readthedocs.org/)",
"Actor": "{py:class}`Actor <upstage.actor.Actor>`",
"State": "{py:class}`~upstage.states.State`",
"Task": "{py:class}`~upstage.task.Task`",
"TaskNetwork": "{py:class}`~upstage.task_network.TaskNetwork`",
"EnvironmentContext": "{py:class}`~upstage.base.EnvironmentContext`",
"UpstageBase": "{py:class}`~upstage.base.UpstageBase`",
"NamedEntity": "{py:class}`~upstage.base.NamedUpstageEntity`",
"LinearChangingState": "{py:class}`~upstage.states.LinearChangingState`",
"CartesianLocation": "{py:class}`~upstage.data_types.CartesianLocation`",
"GeodeticLocationChangingState": "{py:class}`~upstage.states.GeodeticLocationChangingState`",
"ResourceState": "{py:class}`~upstage.states.ResourceState`",
"SelfMonitoringStore": "{py:class}`~upstage.stores.SelfMonitoringStore`",
"DecisionTask": "{py:class}`~upstage.task.DecisionTask`",
"Actor": "{py:class}`Actor <upstage_des.actor.Actor>`",
"State": "{py:class}`~upstage_des.states.State`",
"Task": "{py:class}`~upstage_des.task.Task`",
"TaskNetwork": "{py:class}`~upstage_des.task_network.TaskNetwork`",
"EnvironmentContext": "{py:class}`~upstage_des.base.EnvironmentContext`",
"UpstageBase": "{py:class}`~upstage_des.base.UpstageBase`",
"NamedEntity": "{py:class}`~upstage_des.base.NamedUpstageEntity`",
"LinearChangingState": "{py:class}`~upstage_des.states.LinearChangingState`",
"CartesianLocation": "{py:class}`~upstage_des.data_types.CartesianLocation`",
"GeodeticLocationChangingState": "{py:class}`~upstage_des.states.GeodeticLocationChangingState`",
"ResourceState": "{py:class}`~upstage_des.states.ResourceState`",
"SelfMonitoringStore": "{py:class}`~upstage_des.stores.SelfMonitoringStore`",
"DecisionTask": "{py:class}`~upstage_des.task.DecisionTask`",
}


Expand Down
6 changes: 3 additions & 3 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Alternatively, you can download UPSTAGE and install it manually. Clone, or downl
Note that the tests include the two full examples from the documentation.

```console
(venv) $ pip install uptage[test]
(venv) $ pip install upstage-des[test]
(venv) $ pytest
```

Expand All @@ -61,8 +61,8 @@ Note that the tests include the two full examples from the documentation.
Unless you're adding to the codebase, you won't need to run the `sphinx-apidoc` command.

```console
(venv) $ pip install upstage[docs]
(venv) $ sphinx-apidoc -o .\docs\source\ .\src\upstage\ .\src\upstage\test\
(venv) $ pip install upstage-des[docs]
(venv) $ sphinx-apidoc -o .\docs\source\ .\src\upstage_des\ .\src\upstage_des\test\
(venv) $ sphinx-build -b html .\docs\source\ .\docs\build\
```

Expand Down
10 changes: 5 additions & 5 deletions docs/source/user_guide/how_tos/active_states.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Active States are an UPSTAGE feature where states are told how to update themsel
For example, a fuel depot may dispense fuel at a given rate for some amount of time. An employee may monitor that level at certain times. UPSTAGE allows the state to hold its own
update logic, rather than the employee code needing to know when the fuel started changing, at what rate, etc.

Active states are stopped and started with :py:meth:`~upstage.actor.Actor.activate_state` and :py:meth:`~upstage.actor.Actor.deactivate_state`.
Active states are stopped and started with :py:meth:`~upstage_des.actor.Actor.activate_state` and :py:meth:`~upstage_des.actor.Actor.deactivate_state`.

Active states are automatically stopped when a Task is interrupted.

Expand Down Expand Up @@ -78,7 +78,7 @@ They accept a speed and list of waypoints in their activation.

.. code-block:: python
from upstage.utils import waypoint_time_and_dist
from upstage_des.utils import waypoint_time_and_dist
class FlatlandCar(UP.Actor):
location: UP.CartesianLocation = UP.CartesianLocationChangingState()
Expand Down Expand Up @@ -147,7 +147,7 @@ The ``GeodeticLocationChangingState`` works the same way.
Creating your own
=================

To create you own Active State, subclass :py:class:`~upstage.states.ActiveState`.
To create you own Active State, subclass :py:class:`~upstage_des.states.ActiveState`.

The bare minimum is to implement the ``_active`` method.

Expand All @@ -156,8 +156,8 @@ Here is an example of an ActiveState that changes according to an exponent.
.. code-block:: python
:linenos:
from upstage.states import ActiveState
from upstage.actor import Actor
from upstage_des.states import ActiveState
from upstage_des.actor import Actor
class ExponentChangingState(ActiveState):
"""A state that changes according to: x_t = x_0 + at^(b)"""
Expand Down
8 changes: 4 additions & 4 deletions docs/source/user_guide/how_tos/communications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
Communications
==============

UPSTAGE provides a built-in method for passing communications between actors. The :py:class:`~upstage.communications.comms.CommsManager` class
UPSTAGE provides a built-in method for passing communications between actors. The :py:class:`~upstage_des.communications.comms.CommsManager` class
allows actors to send messages while allowing for simplified retry attempts and timeouts. It also allows for communications
blocking to be turned on and off on a point to point basis.

The :py:class:`~upstage.communications.comms.Message` class is used to describe a message, although strings and dictionaries can
The :py:class:`~upstage_des.communications.comms.Message` class is used to describe a message, although strings and dictionaries can
also be passed as messages, and UPSTAGE will convert them into the ``Message`` class.

The communications manager needs to be instantiated and run, and any number of them can be run, to represent different modes of
Expand All @@ -15,7 +15,7 @@ comms managers.

.. code-block:: python
import upstage.api as UP
import upstage_des.api as UP
class Worker(UP.Actor):
walkie = UP.CommunicationStore(mode="UHF")
Expand All @@ -36,7 +36,7 @@ comms managers.
loudspeaker_comms.run()
The ``CommsManager`` class allows for explicitly connecting actors and the store that will receive messages, but using the
:py:class:`~upstage.states.CommunicationStore` lets the manager auto-discover the proper store for a communications mode, letting
:py:class:`~upstage_des.states.CommunicationStore` lets the manager auto-discover the proper store for a communications mode, letting
the simulation designer only need to pass the source actor, destination actor, and message information to the manager.

To send a message, use the comm manager's ``make_put`` method to return an UPSTAGE event to yield on to send the message.
Expand Down
14 changes: 7 additions & 7 deletions docs/source/user_guide/how_tos/decision_tasks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
Decision Tasks
==============

Decision tasks are :py:class:`~upstage.task.Task`s that take zero time and were briefly demonstrated in :doc:`Rehearsal </tutorials/rehearsal>`. The purpose of a
Decision task is to allow decision making and :py:class:`~upstage.task_networks.TaskNetwork` routing without moving the simulation clock and do so inside of a Task Network.
Decision tasks are :py:class:`~upstage_des.task.Task`s that take zero time and were briefly demonstrated in :doc:`Rehearsal </tutorials/rehearsal>`. The purpose of a
Decision task is to allow decision making and :py:class:`~upstage_des.task_networks.TaskNetwork` routing without moving the simulation clock and do so inside of a Task Network.

A decision task must implement two methods:

* :py:class:`~upstage.task.DecisionTask.make_decision`
* :py:class:`~upstage.task.DecisionTask.rehearse_decision`
* :py:class:`~upstage_des.task.DecisionTask.make_decision`
* :py:class:`~upstage_des.task.DecisionTask.rehearse_decision`

Neither method outputs anything. The expectation is that inside these methods you modify the task network using:

* :py:meth:`upstage.actor.Actor.clear_task_queue`: Empty a task queue
* :py:meth:`upstage.actor.Actor.set_task_queue`: Add tasks to an empty queue (by string name) - you must empty the queue first.
* :py:meth:`upstage.actor.Actor.set_knowledge`: Modify knowledge
* :py:meth:`upstage_des.actor.Actor.clear_task_queue`: Empty a task queue
* :py:meth:`upstage_des.actor.Actor.set_task_queue`: Add tasks to an empty queue (by string name) - you must empty the queue first.
* :py:meth:`upstage_des.actor.Actor.set_knowledge`: Modify knowledge

The difference between making and rehearsing the decision is covered in the tutorial. The former method is called during normal operations of UPSTAGE, and the latter is called during a
rehearsal of the task or network. It is up the user to ensure that no side-effects occur during the rehearsal that would touch non-rehearsing state, actors, or other data.
8 changes: 4 additions & 4 deletions docs/source/user_guide/how_tos/entity_naming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Named Entities
==============

Named entities are an :py:class:`~upstage.base.EnvironmentContext` and :py:class:`~upstage.base.NamedUpstageEntity` enabled feature where you can store instances in particular "entity groups" to gather
them from later. UPSTAGE's :py:class:`~upstage.actor.Actor` inherits from :py:class:`~upstage.base.NamedUpstageEntity`, giving all Actors the feature.
Named entities are an :py:class:`~upstage_des.base.EnvironmentContext` and :py:class:`~upstage_des.base.NamedUpstageEntity` enabled feature where you can store instances in particular "entity groups" to gather
them from later. UPSTAGE's :py:class:`~upstage_des.actor.Actor` inherits from :py:class:`~upstage_des.base.NamedUpstageEntity`, giving all Actors the feature.

All Actors are retrievable with the :py:meth:`~upstage.base.UpstageBase.get_actors` method if they inherit from Actor.
All Actors are retrievable with the :py:meth:`~upstage_des.base.UpstageBase.get_actors` method if they inherit from Actor.

Entities are retrievable with :py:meth:`~upstage.base.UpstageBase.get_all_entity_groups` and :py:meth:`~upstage.base.UpstageBase.get_entity_group`.
Entities are retrievable with :py:meth:`~upstage_des.base.UpstageBase.get_all_entity_groups` and :py:meth:`~upstage_des.base.UpstageBase.get_entity_group`.

Defining a named entity is done in the class definition:

Expand Down
22 changes: 11 additions & 11 deletions docs/source/user_guide/how_tos/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ All events accept a ``rehearsal_time_to_complete`` argument.

The available UPSTAGE events are:

:py:class:`~upstage.events.Event`
:py:class:`~upstage_des.events.Event`
---------------------------------

Mimics SimPy's raw ``Event``, useful for marking pauses until a success.

See :py:meth:`~upstage.actor.Actor.create_knowledge_event` for a use case.
See :py:meth:`~upstage_des.actor.Actor.create_knowledge_event` for a use case.

One use case is the knowledge event, which enables a way to publish and event to an actor, and have some other source ``succeed`` it.

Expand All @@ -31,7 +31,7 @@ One use case is the knowledge event, which enables a way to publish and event to
subordinate.succeed_knowledge_event(name="pause", some_data={...})
:py:class:`~upstage.events.Wait`
:py:class:`~upstage_des.events.Wait`
--------------------------------
A standard SimPy timeout. Can be explicit or generate from a random uniform distribution.

Expand All @@ -44,7 +44,7 @@ The random uniform distribution accepts an input for the rehearsal time, while t
yield UP.Wait.from_random_uniform(low, high, rehearsal_time_to_complete=high)
:py:class:`~upstage.events.Get`
:py:class:`~upstage_des.events.Get`
-------------------------------
Get from a store or container.

Expand All @@ -60,7 +60,7 @@ Get from a store or container.
assert get_event.get_value() == amount
:py:class:`~upstage.events.FilterGet`
:py:class:`~upstage_des.events.FilterGet`
-------------------------------------
A get with a filter function, used for SimPy's ``FilterStore``.

Expand All @@ -70,9 +70,9 @@ A get with a filter function, used for SimPy's ``FilterStore``.
item = yield get_event
:py:class:`~upstage.resources.sorted.SortedFilterGet`
:py:class:`~upstage_des.resources.sorted.SortedFilterGet`
-----------------------------------------------------
A get with a filter or sorting function, used with :py:class:`~upstage.resources.sorted.SortedFilterStore`, and others.
A get with a filter or sorting function, used with :py:class:`~upstage_des.resources.sorted.SortedFilterStore`, and others.

.. code-block:: python
Expand All @@ -84,7 +84,7 @@ A get with a filter or sorting function, used with :py:class:`~upstage.resources
item = yield get_event
:py:class:`~upstage.events.Put`
:py:class:`~upstage_des.events.Put`
-------------------------------
Put something into a store or container

Expand All @@ -99,7 +99,7 @@ Put something into a store or container
yield UP.Put(some_store, amount)
:py:class:`~upstage.events.ResourceHold`
:py:class:`~upstage_des.events.ResourceHold`
----------------------------------------
Put and release holds on limited resources.

Expand All @@ -114,7 +114,7 @@ Put and release holds on limited resources.
# Now you've given it back
:py:class:`~upstage.events.All`
:py:class:`~upstage_des.events.All`
-------------------------------
Succeed when all passed events succeed.

Expand All @@ -128,7 +128,7 @@ Succeed when all passed events succeed.
assert wait_event.is_complete()
:py:class:`~upstage.events.Any`
:py:class:`~upstage_des.events.Any`
-------------------------------
Succeed when any passed events succeed

Expand Down
Loading

0 comments on commit 3ab7ac0

Please sign in to comment.