Repository: Avaiga/taipy
File: taipy/core/cycle/cycle.py (Python)

Code before:

from .._entity._entity import _Entity
from .._entity._labeled import _Labeled
from .._entity._properties import _Properties
from .._entity._reload import _Reloader, _self_reload, _self_setter
from ..exceptions.exceptions import _SuspiciousFileOperation
from ..notification.event import Event, EventEntityType, EventOperation, _make_event
from .cycle_id import CycleId


class Cycle(_Entity, _Labeled):
    """An iteration of a recurrent work pattern.

    Data applications are often used to solve business problems that operate periodically
    (i.e. in time cycles) such as weekly predictions of sales data, monthly master planning
    of supply chains, quarterly financial reports, yearly budgeting, etc.

    For this purpose, `Cycle^` represents a single iteration of such a time pattern.
    Each _cycle_ has a start date and a duration. Examples of cycles are:

    - Monday, 2. January 2023 as a daily cycle
    - Week 01 2023, from 2. January as a weekly cycle
    - January 2023 as a monthly cycle
    - etc.

    `Cycles^` are created along with the `Scenarios^` that are attached to them.
    At its creation, a new scenario is attached to a single cycle, the one that
    matches its optional _frequency_ and its _creation_date_.

    The possible frequencies are:

    - `Frequency.DAILY`
    - `Frequency.WEEKLY`
    - `Frequency.MONTHLY`
    - `Frequency.QUARTERLY`
    - `Frequency.YEARLY`

    Attributes:
        id (str): The unique identifier of the cycle.
        frequency (Frequency^): The frequency of this cycle.
        creation_date (datetime): The date and time of the creation of this cycle.
        start_date (datetime): The date and time of the start of this cycle.
        end_date (datetime): The date and time of the end of this cycle.
        name (str): The name of this cycle.
        properties (dict[str, Any]): A dictionary of additional properties.

    !!! example "Example for January cycle"

        ![cycles](../refmans/img/cycles_january_colored.svg){ align=left width="250" }

        Let's assume an end-user publishes production orders (i.e., a production plan) every

Review comment (suggestion):
I'm not sure if the hyperlink works or not

```suggestion
    `Cycle^`s are created along with the `Scenario^`s that are attached to them.
```

Code after:

from .._entity._entity import _Entity
from .._entity._labeled import _Labeled
from .._entity._properties import _Properties
from .._entity._reload import _Reloader, _self_reload, _self_setter
from ..exceptions.exceptions import _SuspiciousFileOperation
from ..notification.event import Event, EventEntityType, EventOperation, _make_event
from .cycle_id import CycleId


class Cycle(_Entity, _Labeled):
    """An iteration of a recurrent work pattern.

    Many business operations are periodic, such as weekly predictions of sales data, monthly
    master planning of supply chains, quarterly financial reports, yearly budgeting, etc.
    The data applications to solve these business problems often require modeling the
    corresponding periods (i.e., cycles).

    For this purpose, a `Cycle^` represents a single iteration of such a time pattern.
    Each _cycle_ has a start date and a duration. Examples of cycles are:

    - Monday, 2. January 2023 as a daily cycle
    - Week 01 2023, from 2. January as a weekly cycle
    - January 2023 as a monthly cycle
    - etc.

    `Cycle^`s are created along with the `Scenario^`s that are attached to them.
    At its creation, a new scenario is attached to a single cycle, the one that
    matches its optional _frequency_ and its _creation_date_.

    The possible frequencies are:

    - `Frequency.DAILY`
    - `Frequency.WEEKLY`
    - `Frequency.MONTHLY`
    - `Frequency.QUARTERLY`
    - `Frequency.YEARLY`

    Attributes:
        id (str): The unique identifier of the cycle.
        frequency (Frequency^): The frequency of this cycle.
        creation_date (datetime): The date and time of the creation of this cycle.
        start_date (datetime): The date and time of the start of this cycle.
        end_date (datetime): The date and time of the end of this cycle.
        name (str): The name of this cycle.
        properties (dict[str, Any]): A dictionary of additional properties.

    !!! example "Example for January cycle"

        ![cycles](../refmans/img/cycles_january_colored.svg){ align=left width="250" }