Make PyAutoGalaxy / PyAutoLens Result refer to correct object
The following line:
result = search.fit(model=model, analysis=analysis)
Does not know that the output result is a PyAutoLens result (e.g. https://github.com/Jammy2211/PyAutoLens/blob/master/autolens/imaging/model/result.py).
This is a pain for PyCharm predictive variables, as it means it does not show me attributes like max_log_likelihood_fit.
I don't think Python generics are sufficient to solve this.
One way to do it is to use 'cast'
from typing import cast
result = cast(MyResultType, result)
Is there any way to do this in the source code?
the fit method is in the search of autofit, so I guess not without importing autolens / galaxy objects.
Bit of a nightmare as we dont really want users to have to cast the result themselves.