Skip to content

Commit

Permalink
removes unused setter, moves inputs construction for WeightedCost for…
Browse files Browse the repository at this point in the history
… performance
  • Loading branch information
BradyPlanden committed Sep 23, 2024
1 parent f94dcc2 commit bb99bf9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion pybop/costs/_weighted_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def compute(
de = np.empty((len(self.parameters), len(self.costs)))

for i, cost in enumerate(self.costs):
inputs = cost.parameters.as_dict()
if self._has_identical_problems:
y, dy = (y, dy)
elif cost.has_separable_problem:
inputs = cost.parameters.as_dict()
if calculate_grad:
y, dy = cost.problem.evaluateS1(inputs)
else:
Expand Down
4 changes: 0 additions & 4 deletions pybop/costs/base_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ def n_parameters(self):
def has_separable_problem(self):
return self._has_separable_problem

@has_separable_problem.setter
def has_separable_problem(self, has_separable_problem):
self._has_separable_problem = has_separable_problem

@property
def target(self):
return self._target
Expand Down

0 comments on commit bb99bf9

Please sign in to comment.