Skip to content
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

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

Yaoyx
Copy link
Collaborator

@Yaoyx Yaoyx commented Oct 8, 2024

@Yaoyx Yaoyx requested a review from golobor October 9, 2024 01:45
@@ -1035,6 +1035,10 @@ def per_region_smooth_cvd(
)

return cvd

def _transformer(p, weight1, weight2):
Copy link
Member

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

Copy link
Collaborator Author

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


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(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be useful to expose transforms in expected_cis? cc @sergpolly @nvictus

Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Collaborator Author

@Yaoyx Yaoyx Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files have been removed

@gfudenberg
Copy link
Member

@dmitrymyl I just invited you as a collaborator for the repo-- let us know if this resolves the issues you encountered!

@dmitrymyl
Copy link

dmitrymyl commented Oct 9, 2024

I checked this version against my profiling notebook -- now obs/exp pups are calculated fast and one can also supply custom map functors (as intended). So, this PR resolves both issues.

Timings:

Pileup kind nproc cooltools (default) cooltools x multiprocess cooltools x multiprocessing cooltools x concurrent.futures coolpuppy (default)
OBS 1 9.8 s 10.4 s 10.4 s 10.1 s 8.93 s
OBS 8 2.71 s 2.74 s 2.74 s 2.69 s 2.45 s
OBSEXP 1 11.7 s 13.8 s 12.6 s 14.6 s 14.6 s
OBSEXP 8 5.37 s 19.7 s 4.48 s 5.06 s 9.4 s

@gfudenberg gfudenberg merged commit aedd531 into open2c:master Oct 21, 2024
5 checks passed
Copy link
Member

@golobor golobor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants