Skip to content

Commit 0115c67

Browse files
authored
Merge pull request #11 from lwins-lights/fix-comment-create-cvxpy-problem
Fix misleading docstring in the "create_cvxpy_problem" method
2 parents 4b8d8c9 + 297f9e5 commit 0115c67

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

portpy/photon/optimization.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,15 @@ def create_cvxpy_problem(self):
5858
"""
5959
It runs optimization to create optimal plan based upon clinical criteria
6060
61-
:return: cvxpy problem object
61+
This method constructs the components of the CVXPY optimization problem:
62+
- Populates :attr obj: with a list of individual objective terms
63+
- Populates :attr constraints: with dose-based and clinical constraints
64+
65+
Note:
66+
This method does not return a CVXPY Problem object. Instead, it prepares the internal components
67+
used by :meth solve(): or for manual construction of a CVXPY Problem.
6268
69+
:return:
6370
"""
6471

6572
# unpack data
@@ -324,16 +331,16 @@ def add_boo(self, num_beams: int):
324331

325332
def solve(self, return_cvxpy_prob=False, *args, **kwargs):
326333
"""
327-
Return optimal solution and influence matrix associated with it in the form of dictionary
328-
If return_problem set to true, returns cvxpy problem instance
334+
Return optimal solution and influence matrix associated with it in the form of dictionary
335+
If return_problem set to true, returns cvxpy problem instance
329336
330-
:Example
331-
dict = {"optimal_fluence": [..],
332-
"inf_matrix": my_plan.inf_marix
333-
}
337+
:Example
338+
dict = {"optimal_fluence": [..],
339+
"inf_matrix": my_plan.inf_marix
340+
}
334341
335-
:return: solution dictionary, cvxpy problem instance(optional)
336-
"""
342+
:return: solution dictionary, cvxpy problem instance(optional)
343+
"""
337344

338345
problem = cp.Problem(cp.Minimize(cp.sum(self.obj)), constraints=self.constraints)
339346
print('Running Optimization..')

0 commit comments

Comments
 (0)