Skip to content

Commit cbc9447

Browse files
FilippoOlivodario-coscia
authored andcommitted
Doc collector
1 parent 317f85a commit cbc9447

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

pina/collector.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88

99
class Collector:
1010
"""
11-
Collector class for collecting data from the problem.
11+
Collector class for retrieving data from different conditions in the
12+
problem.
1213
"""
1314

1415
def __init__(self, problem):
15-
""" "
16+
"""
1617
Initialize the Collector class, by creating a hook between the collector
17-
and the problem and initializing the data collections.
18+
and the problem and initializing the data collections (dictionary where
19+
data will be stored).
1820
1921
:param AbstractProblem problem: The problem to collect data from.
2022
"""
@@ -34,15 +36,18 @@ def __init__(self, problem):
3436
@property
3537
def full(self):
3638
"""
37-
Return True if all conditions are ready.
39+
Whether all conditions are ready or not.
40+
41+
:return: True if all conditions are ready.
42+
:rtype: bool
3843
"""
3944

4045
return all(self._is_conditions_ready.values())
4146

4247
@full.setter
4348
def full(self, value):
4449
"""
45-
Set the full property of the collector. Admit only boolean values.
50+
Check the consistency of the value and set the full property.
4651
4752
:param bool value: The value to set the full property to.
4853
"""
@@ -52,10 +57,9 @@ def full(self, value):
5257
@property
5358
def data_collections(self):
5459
"""
55-
Return the data collections, created by combining together all condition
56-
in the problem.
60+
Return the data collections.
5761
58-
:return: The data collections.
62+
:return: The data collections where the data is stored.
5963
:rtype: dict
6064
"""
6165

@@ -64,20 +68,19 @@ def data_collections(self):
6468
@property
6569
def problem(self):
6670
"""
67-
Property that return the problem connected to the collector.
71+
Problem connected to the collector.
6872
69-
:return: The problem connected to the collector.
73+
:return: The problem from which the data is collected.
7074
:rtype: AbstractProblem
7175
"""
7276
return self._problem
7377

7478
@problem.setter
7579
def problem(self, value):
7680
"""
77-
Return the problem connected to the collector.
81+
Ser the problem connected to the collector.
7882
79-
return: The problem connected to the collector.
80-
rtype: AbstractProblem
83+
:param AbstractProblem value: The problem to connect to the collector.
8184
"""
8285

8386
self._problem = value
@@ -111,6 +114,7 @@ def store_sample_domains(self):
111114
Store inside data collections the sampled data of the problem. These
112115
comes from the conditions that require sampling.
113116
"""
117+
114118
for condition_name in self.problem.conditions:
115119
condition = self.problem.conditions[condition_name]
116120
if not hasattr(condition, "domain"):

0 commit comments

Comments
 (0)