-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/result cast #989
Feature/result cast #989
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to fix those interpolator tests
|
||
residual_map = self.data - model_data_1d | ||
chi_squared_map = (residual_map / self.noise_map) ** 2.0 | ||
log_likelihood = -0.5 * sum(chi_squared_map) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just return this line rather than defining an ephemeral variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for the example module, which users might read, so intentionally simple.
|
||
self._instance = instance or ModelInstance() | ||
self._samples = samples or MockSamples( | ||
max_log_likelihood_instance=self.instance, model=model or ModelMapper() | ||
# max_log_likelihood_instance=self.instance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented code
def model_absolute(self, a): | ||
try: | ||
return self.samples_summary.model_absolute(a) | ||
except AttributeError: | ||
return self.model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth adding a warning?
autofit/non_linear/result.py
Outdated
try: | ||
Samples.from_csv( | ||
paths=self.paths, | ||
model=self.model, | ||
) | ||
except FileNotFoundError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to return this?
# ) | ||
|
||
|
||
# def test_interpolate(interpolator): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooof why is this all commented out?
New API for how the
Analysis
class returns aReturn
.Now, the
Analysis
class has aResult
class attribute, which a user can overwrite with their own customResult
class.This removes a number of unecessary
make_result
functions that end up populatingAnalysis
objects and is a cleaner API for users, as shown in the docs updated in this PR.