I could not find a function for optimizing a function that took a vector input and returned a scalar value in scipy.optimize, so I have attempted to create a class that does this.