def custom_objective(self, objective_function, *args):
result = sco.minimize(<EOL>objective_function,<EOL>x0=self.initial_guess,<EOL>args=args,<EOL>method="<STR_LIT>",<EOL>bounds=self.bounds,<EOL>constraints=self.constraints,<EOL>)<EOL>self.weights = result["<STR_LIT:x>"]<EOL>return dict(zip(self.tickers, self.weights))<EOL>
Optimise some objective function. While an implicit requirement is that the function
can be optimised via a quadratic optimiser, this is not enforced. Thus there is a
decent chance of silent failure.

:param objective_function: function which maps (weight, args) -> cost
:type objective_function: function with signature (np.ndarray, args) -> float
:return: asset weights that optimise the custom objective
:rtype: dict