-
Notifications
You must be signed in to change notification settings - Fork 51
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
Update pool decorator, and multiprocessing #539
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1035,6 +1035,10 @@ def per_region_smooth_cvd( | |
) | ||
|
||
return cvd | ||
|
||
def _transformer(p, weight1, weight2): | ||
return p["count"] * p[weight1] * p[weight2] | ||
|
||
# user-friendly wrapper for diagsum_symm and diagsum_pairwise - part of new "public" API | ||
@pool_decorator | ||
def expected_cis( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would be useful to expose transforms in expected_cis? cc @sergpolly @nvictus |
||
|
@@ -1179,7 +1183,7 @@ def expected_cis( | |
# define balanced data transform: | ||
weight1 = clr_weight_name + "1" | ||
weight2 = clr_weight_name + "2" | ||
transforms = {"balanced": lambda p: p["count"] * p[weight1] * p[weight2]} | ||
transforms = {"balanced": partial(_transformer, weight1=weight1, weight2=weight2)} | ||
else: | ||
raise ValueError( | ||
"cooler is not balanced, or" | ||
|
@@ -1317,8 +1321,7 @@ def expected_trans( | |
# define balanced data transform: | ||
weight1 = clr_weight_name + "1" | ||
weight2 = clr_weight_name + "2" | ||
transforms = {"balanced": lambda p: p["count"] * p[weight1] * p[weight2]} | ||
|
||
transforms = {"balanced": partial(_transformer, weight1=weight1, weight2=weight2)} | ||
else: | ||
raise ValueError( | ||
"cooler is not balanced, or" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems that a few deletable test files got added to the PR @Yaoyx There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Files have been removed |
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.
I wonder if this might be better named
_balance_transform
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.
Yea, that might be more informative. Updated