Bläddra i källkod

change docstring return type

Toan Quach 10 månader sedan
förälder
incheckning
076de38686

+ 1 - 1
taipy/core/_entity/submittable.py

@@ -86,7 +86,7 @@ class Submittable:
         """Indicate if the entity is ready to be run.
 
         Returns:
-            A Reason object that can function as a Boolean value.
+            A ReasonCollection object that can function as a Boolean value,
             which is True if the given entity is ready to be run or there is no reason to be blocked, False otherwise.
         """
         reason_collection = ReasonCollection()

+ 2 - 1
taipy/core/_manager/_manager.py

@@ -128,7 +128,8 @@ class _Manager(Generic[EntityType]):
     @classmethod
     def _exists(cls, entity_id: str) -> ReasonCollection:
         """
-        Returns True if the entity id exists.
+        A ReasonCollection object that can function as a Boolean value,
+        which is True if the entity id exists.
         """
         reason_collector = ReasonCollection()
 

+ 2 - 1
taipy/core/job/job.py

@@ -353,7 +353,8 @@ class Job(_Entity, _Labeled):
         """Indicate if the job can be deleted.
 
         Returns:
-            True if the job can be deleted. False otherwise.
+            A ReasonCollection object that can function as a Boolean value,
+            which is True if the job can be deleted. False otherwise.
         """
         from ... import core as tp
 

+ 1 - 1
taipy/core/reason/reason.py

@@ -227,4 +227,4 @@ class SubmissionStatusIsUndefined(Reason, _DataNodeReasonMixin):
     """
 
     def __init__(self, submission_id: str):
-        Reason.__init__(self, f"The submission {submission_id} status is undefined.")
+        Reason.__init__(self, f"The status of submission {submission_id} is undefined.")

+ 2 - 1
taipy/core/submission/submission.py

@@ -241,7 +241,8 @@ class Submission(_Entity, _Labeled):
         """Indicate if the submission can be deleted.
 
         Returns:
-            True if the submission can be deleted. False otherwise.
+            A ReasonCollection object that can function as a Boolean value,
+            which is True if the submission can be deleted. False otherwise.
         """
         from ... import core as tp
 

+ 10 - 5
taipy/core/taipy.py

@@ -130,7 +130,8 @@ def is_editable(
     This function checks if the given entity can be edited.
 
     Returns:
-        True if the given entity can be edited. False otherwise.
+        A ReasonCollection object that can function as a Boolean value,
+        which is True if the given entity can be edited. False otherwise.
     """
     if isinstance(entity, Cycle):
         return _CycleManagerFactory._build_manager()._is_editable(entity)
@@ -186,7 +187,8 @@ def is_readable(
     This function checks if the given entity can be read.
 
     Returns:
-        True if the given entity can be read. False otherwise.
+        A ReasonCollection object that can function as a Boolean value,
+        which is True if the given entity can be read. False otherwise.
     """
     if isinstance(entity, Cycle):
         return _CycleManagerFactory._build_manager()._is_readable(entity)
@@ -318,7 +320,8 @@ def exists(
             identifier of the entity to check for existence.
 
     Returns:
-        True if the given entity exists. False otherwise.
+        A ReasonCollection object that can function as a Boolean value,
+        which is True if the given entity exists. False otherwise.
 
     Raises:
         ModelNotFound: If the entity's type cannot be determined.
@@ -447,7 +450,8 @@ def is_deletable(entity: Union[Scenario, Job, Submission, ScenarioId, JobId, Sub
             job or submission to check.
 
     Returns:
-        True if the given scenario, job or submission can be deleted. False otherwise.
+        A ReasonCollection object that can function as a Boolean value,
+        which is True if the given scenario, job or submission can be deleted. False otherwise.
     """
     if isinstance(entity, Job):
         return _JobManagerFactory._build_manager()._is_deletable(entity)
@@ -619,7 +623,8 @@ def is_promotable(scenario: Union[Scenario, ScenarioId]) -> ReasonCollection:
         scenario (Union[Scenario, ScenarioId]): The scenario to be evaluated for promotion.
 
     Returns:
-        True if the given scenario can be promoted to be a primary scenario. False otherwise.
+        A ReasonCollection object that can function as a Boolean value,
+        which is True if the given scenario can be promoted to be a primary scenario. False otherwise.
     """
     return _ScenarioManagerFactory._build_manager()._is_promotable_to_primary(scenario)