Skip to content

Commit f714577

Browse files
authored
DOC: fix minor docstring grammar in events.py (#3783)
This PR fixes a few small docstring grammar issues in `ignite/engine/events.py`. There are **no code or behavior changes**, only wording fixes in comments/docstrings. All changes are minimal and localized, for example: ```python # Before """Single Event containing a filter, specifying whether the event should be run at the current event (if the event type is correct) Args: value: The actual enum value. Only needed for internal use. Do not touch! event_filter: A function taking the engine and the current event value as input and returning a boolean to indicate whether this event should be executed. Defaults to None, which will result to a function that always returns `True` name: The enum-name of the current object. Only needed for internal use. Do not touch! """ ``` ```python # After """Single event containing a filter specifying whether the handler should be run for the current event (if the event type is correct). Args: value: The actual enum value. Only needed for internal use. Do not touch! event_filter: A function taking the engine and the current event value as input and returning a boolean to indicate whether this event should be executed. Defaults to None, which will result in a function that always returns `True`. name: The enum-name of the current object. Only needed for internal use. Do not touch! """ ``` The deprecated default event filter docstring is also cleaned up: [is is] ```python # Before """Default event filter. This method is is deprecated and will be removed. Please, use None instead""" # After """Default event filter. This method is deprecated and will be removed. Please use None instead.""" ``` These changes: - Fix a duplicated word: `is is`. - Replace “result to” with the correct “result in”. - Make the `CallableEventWithFilter` docstring clearer and grammatically correct. - Fixed: "User can also combine events" --> "Users can also ..."
1 parent 8de8822 commit f714577

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ignite/engine/events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CallableEventWithFilter:
2323
Args:
2424
value: The actual enum value. Only needed for internal use. Do not touch!
2525
event_filter: A function taking the engine and the current event value as input and returning a
26-
boolean to indicate whether this event should be executed. Defaults to None, which will result to a
26+
boolean to indicate whether this event should be executed. Defaults to None, which will result in a
2727
function that always returns `True`
2828
name: The enum-name of the current object. Only needed for internal use. Do not touch!
2929
"""
@@ -178,7 +178,7 @@ def wrapper(engine: "Engine", event: int) -> bool:
178178

179179
@staticmethod
180180
def default_event_filter(engine: "Engine", event: int) -> bool:
181-
"""Default event filter. This method is is deprecated and will be removed. Please, use None instead"""
181+
"""Default event filter. This method is deprecated and will be removed. Please, use None instead"""
182182
warnings.warn("Events.default_event_filter is deprecated and will be removed. Please, use None instead")
183183
return True
184184

@@ -347,7 +347,7 @@ def call_every_itr_before_after(engine):
347347
Event filter function `event_filter` accepts as input `engine` and `event` and should return True/False.
348348
Argument `event` is the value of iteration or epoch, depending on which type of Events the function is passed.
349349
350-
Since v0.4.0, user can also combine events with `|`-operator:
350+
Since v0.4.0, users can also combine events with `|`-operator:
351351
352352
.. code-block:: python
353353

0 commit comments

Comments
 (0)