-
Notifications
You must be signed in to change notification settings - Fork 8
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
Refactoring the integration / integrand workflow in the cluster count calculation #353
Conversation
…, they accept a function to integrate and perform that integration. Adding the ability to pass extra arguments.
…emoving any generic construction of an integrand. Leaving the cluster abundance class as a collections of methods users can use to construct their own cluster "recipes"
…ients that produce theoretical predictions.
…needed for comparison script).
Note- H_V seems to perform best now, need to compare to old numbers.
…ll CI commands succeed locally.
* Updating the way numcosmo calls the wrapped function in the integrator for clarity * Adding statically typed callables to the cluster recipes (forgot to do this one).
…nit tests** * Adding TupleBin tests
* Adding an init for cluster recipes * Writing (really, moving) tests for the cluster recipes
* Adding docstrings * Adding an unbinned cluster recipe as proof of concept.
* Adding unbinned unit tests.
We agreed to have the |
@@ -12,7 +13,11 @@ | |||
from firecrown.models.cluster.recipes.cluster_recipe import ClusterRecipe | |||
|
|||
|
|||
# pylint: disable=R0801 |
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 discussed the disabling of the duplicated code complaint and agree that it should be relaxed for recipes.
We'd prefer to see the disabling being done in a file or directory level through pylintrc
to having it on each class.
We should also use the named form, rather than the numeric form, of what is being disabled.
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 surprisingly hard to do with pylint. The best solution I've found is that you can write custom pylint plugins and dynamically append ignore statements to specific classes.
I implemented this by adding a new pylint_plugins
directory to the root of the project (and added a readme explaining why). I then added a duplicate_code.py
which contains the custom plugin that can ignore the duplicate-code warning, and inside that I only add the ignore comment to firecrown.models.cluster.recipes
classes.
Then, I updated the pylint rc files to load this plugin by default.
I pushed this up in the most recent commit.
* Added updated pylint to use the custom plugins through the rc file * Removing custom disable duplicate code warning
This PR changes the cluster number counts likelihood workflow to support potentially more complex integrands.
Kernel
abstract class and concept of a shared interface between components of the integrand.ClusterAbundance
. The responsibility of assembling the integrand for the cluster number counts is now placed on the user in the form ofClusterRecipe
cluster_recipe
module. This is where users can assemble a cluster number counts integrand using the pieces in firecrown.models.clusterpylint_plugins
top level directory that enables ignoring of specific warnings on specific classes. Included an example to ignore the duplicate code warning (we agreed this should not apply toClusterRecipe
).