Conversation
rhayes777
approved these changes
Apr 8, 2024
Collaborator
rhayes777
left a comment
There was a problem hiding this comment.
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) |
Collaborator
There was a problem hiding this comment.
Just return this line rather than defining an ephemeral variable
Collaborator
Author
There was a problem hiding this comment.
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, |
Comment on lines
+42
to
+46
| def model_absolute(self, a): | ||
| try: | ||
| return self.samples_summary.model_absolute(a) | ||
| except AttributeError: | ||
| return self.model |
Collaborator
There was a problem hiding this comment.
Is it worth adding a warning?
Comment on lines
+305
to
+311
| try: | ||
| Samples.from_csv( | ||
| paths=self.paths, | ||
| model=self.model, | ||
| ) | ||
| except FileNotFoundError: | ||
| pass |
Collaborator
There was a problem hiding this comment.
Did you mean to return this?
| # ) | ||
|
|
||
|
|
||
| # def test_interpolate(interpolator): |
Collaborator
There was a problem hiding this comment.
Ooof why is this all commented out?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New API for how the
Analysisclass returns aReturn.Now, the
Analysisclass has aResultclass attribute, which a user can overwrite with their own customResultclass.This removes a number of unecessary
make_resultfunctions that end up populatingAnalysisobjects and is a cleaner API for users, as shown in the docs updated in this PR.