Skip to content

Commit

Permalink
Documentation updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesArruda committed Dec 12, 2024
1 parent c91a4a3 commit 9615faa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/source/user_guide/tutorials/first_simulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ state is similar, except that a default value of 120 minutes is supplied.

.. note::
There is no explicit time dimension in upstage_des. The clock units are up to the user,
and the user must ensure that all times are properly defined. See :doc:`Times </user_guide/how_tos/times>`
for more, including using time units in ``Wait``.
and the user must ensure that all times are properly defined. See :doc:`Time Units </user_guide/how_tos/times>`
for more, including using time units in :py:class:`~upstage_des.events.Wait`.


Then you will later instantiate a cashier with [#f1]_:
Expand Down
13 changes: 10 additions & 3 deletions src/upstage_des/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def intersection_model(self) -> INTERSECTION_LOCATION_CALLABLE:

@property
def time_unit(self) -> str:
"""Time unit, Treated as 'hr' if not set."""
"""Time unit, Treated as 'hr' if not set.
This value modifies ``pretty_now`` from ``UpstageBase``,
and can be used to modfy ``Wait`` timeouts.
"""

@property
def random(self) -> Random:
Expand All @@ -97,8 +101,11 @@ def random(self) -> Random:
def daily_time_count(self) -> float | int:
"""The number of time_units in a "day".
If time_unit is s, m, hr, day, week, etc., then
this is automatically considered 24.
This value only modifies ``pretty_now`` from ``UpstageBase``.
This is only used if the time_unit is not
s, min, or hr. In that case, 24 hour days are
assumed.
"""

if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion src/upstage_des/test/test_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
UpstageBase,
UpstageError,
add_stage_variable,
get_stage_variable,
get_stage,
get_stage_variable,
)
from upstage_des.base import clear_top_context, create_top_context

Expand Down
10 changes: 5 additions & 5 deletions src/upstage_des/units/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def unit_convert(value: int | float, units_from: str, units_to: str) -> float:
time:
* s, second, or seconds
* min, minute, or minutes
* hr, hour, or hours
* day or days
* week or weeks
* s, second, or seconds
* min, minute, or minutes
* hr, hour, or hours
* day or days
* week or weeks
All units are lower-cased on input.
Expand Down

0 comments on commit 9615faa

Please sign in to comment.