-
Notifications
You must be signed in to change notification settings - Fork 0
Impure mass distribution exact [version:1.0.1] #66
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
963440d
vectorized mass_distribution purity exact first version
henriquelettieri 239d70b
recipe updated with 3d calculation for impure cluster counts
henriquelettieri 74fbc1f
combined purity non purity in one function
henriquelettieri 96fc85d
binned_counts tests for new counts with purity code
henriquelettieri 47304c3
binned_counts tests for new counts with purity code
henriquelettieri ec3bf74
add new assert in _get_theory_prediction_counts and purity in shear c…
henriquelettieri abcffb2
add new assert in _get_theory_prediction_counts and purity in shear c…
henriquelettieri 4716996
add new assert in _get_theory_prediction_counts and purity in shear c…
henriquelettieri bf27930
add new assert in _get_theory_prediction_counts and purity in shear c…
henriquelettieri 9e06d7c
added comparisons in test_grid_shear_matches_exact_within_tolerance a…
henriquelettieri 02a616e
added comparisons in test_grid_shear_matches_exact_within_tolerance a…
henriquelettieri 9c2101b
added comparisons in test_grid_shear_matches_exact_within_tolerance a…
henriquelettieri 9150e09
added comparisons in test_grid_shear_matches_exact_within_tolerance a…
henriquelettieri 04644b7
added comparisons in test_grid_shear_matches_exact_within_tolerance a…
henriquelettieri a5af570
new version
henriquelettieri efbd70d
new version
henriquelettieri cc63cef
updating shear calculation
henriquelettieri 2a93f25
solving the low rel_err for completeness in shear calculation
henriquelettieri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,7 +65,7 @@ | |
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": 4, | ||
| "execution_count": 7, | ||
| "id": "0b708fef-7cdb-4239-84af-3f1520364076", | ||
| "metadata": {}, | ||
| "outputs": [], | ||
|
|
@@ -140,6 +140,7 @@ | |
| "name": "stdout", | ||
| "output_type": "stream", | ||
| "text": [ | ||
| "ola\n", | ||
| "Simpson Integral 87221.31147840535, dblquad integral 87220.6489541402\n", | ||
| "Abs error 0.6625242651498411, rel error 7.595956612371779e-06\n" | ||
| ] | ||
|
|
@@ -353,8 +354,8 @@ | |
| "\n", | ||
| "\n", | ||
| " (12, 10)\n", | ||
| "Simpson Integral 0.13497569756262148, dblquad integral 0.1349756810357927\n", | ||
| "Abs error 1.6526828794383164e-08, rel error 1.224430110635666e-07\n" | ||
| "Simpson Integral 0.13497569756262148, dblquad integral 0.06724380521649297\n", | ||
| "Abs error 0.06773189234612852, rel error 1.0072584698034883\n" | ||
| ] | ||
| } | ||
| ], | ||
|
|
@@ -505,8 +506,8 @@ | |
| "(0.2, 0.4) (1.0, 1.3)\n", | ||
| "Simpson Integral 465.86054457432704, dblquad integral 465.88615450982513\n", | ||
| "Abs error 0.025609935498096092, rel error 5.4970372590390504e-05\n", | ||
| "First eval took: 0.0015347003936767578, second eval took: 0.0007061958312988281, integral took: 0.0427401065826416\n", | ||
| "After reset: 0.0011837482452392578\n", | ||
| "First eval took: 0.0014820098876953125, second eval took: 0.0008060932159423828, integral took: 0.33889269828796387\n", | ||
| "After reset: 0.0011088848114013672\n", | ||
| " Counts 1, 2 ,3: (np.float64(465.86054457432704), np.float64(465.86054457432704), np.float64(465.86054457432704))\n" | ||
| ] | ||
| } | ||
|
|
@@ -555,8 +556,8 @@ | |
| "[3.67451479e+15]\n", | ||
| "Simpson Integral [3.67407585e+15], dblquad integral [3.67451479e+15]\n", | ||
| "Abs error [4.38941366e+11], rel error [0.00011946]\n", | ||
| "First eval took: 0.0026946067810058594, second eval took: 0.0008661746978759766, integral took: 0.11332583427429199\n", | ||
| "After reset: 0.0024514198303222656\n", | ||
| "First eval took: 0.002621173858642578, second eval took: 0.0007369518280029297, integral took: 0.09407925605773926\n", | ||
| "After reset: 0.0021927356719970703\n", | ||
| " Counts 1, 2 ,3: (array([3.67407585e+15]), array([3.67407585e+15]), array([3.67407585e+15]))\n" | ||
| ] | ||
| } | ||
|
|
@@ -636,8 +637,8 @@ | |
| "text": [ | ||
| "Simpson Integral [1.22802065], dblquad integral [1.36087356]\n", | ||
| "Abs error [0.13285291], rel error [0.09762325]\n", | ||
| "First eval took: 0.04190349578857422, second eval took: 0.0007469654083251953, integral took: 0.28732752799987793\n", | ||
| "After reset: 0.0007152557373046875\n", | ||
| "First eval took: 0.02831244468688965, second eval took: 0.0010771751403808594, integral took: 0.22215914726257324\n", | ||
| "After reset: 0.0007371902465820312\n", | ||
| " Values 1, 2 ,3: (array([1.22802065]), array([1.22802065]), array([1.22802065]))\n" | ||
| ] | ||
| } | ||
|
|
@@ -686,8 +687,8 @@ | |
| "(0.2, 0.4) (1.0, 1.3)\n", | ||
| "Simpson Integral 6643.852449550316, dblquad integral 6644.228454470479\n", | ||
| "Abs error 0.3760049201628135, rel error 5.659120885737057e-05\n", | ||
| "First eval took: 0.0013675689697265625, second eval took: 0.0006885528564453125, integral took: 0.0020668506622314453\n", | ||
| "After reset: 0.0012717247009277344\n", | ||
| "First eval took: 0.0015234947204589844, second eval took: 0.0005614757537841797, integral took: 0.002446413040161133\n", | ||
| "After reset: 0.0008502006530761719\n", | ||
| " Counts 1, 2 ,3: (np.float64(6643.852449550316), np.float64(6643.852449550316), np.float64(6643.852449550316))\n" | ||
| ] | ||
| } | ||
|
|
@@ -738,8 +739,8 @@ | |
| "(0.2, 0.4) (1.0, 1.3)\n", | ||
| "Simpson Integral 145.5788864174151, dblquad integral 145.5957901462481\n", | ||
| "Abs error 0.016903728833000287, rel error 0.00011610039559539764\n", | ||
| "First eval took: 0.0013070106506347656, second eval took: 0.0006926059722900391, integral took: 0.0016515254974365234\n", | ||
| "After reset: 0.0012030601501464844\n", | ||
| "First eval took: 0.0014867782592773438, second eval took: 0.0005896091461181641, integral took: 0.0023458003997802734\n", | ||
| "After reset: 0.0009424686431884766\n", | ||
| " Counts 1, 2 ,3: (np.float64(145.5788864174151), np.float64(145.5788864174151), np.float64(145.5788864174151))\n" | ||
| ] | ||
| } | ||
|
|
@@ -841,12 +842,12 @@ | |
| "text": [ | ||
| "\n", | ||
| "--- One-shot counts ---\n", | ||
| "Grid time: 0.0523 s\n", | ||
| "Integral time: 0.0023 s\n", | ||
| "Grid time: 0.0346 s\n", | ||
| "Integral time: 0.0019 s\n", | ||
| "\n", | ||
| "--- One-shot shear ---\n", | ||
| "Grid time: 0.0021 s\n", | ||
| "Integral time: 0.4202 s\n" | ||
| "Grid time: 0.0020 s\n", | ||
| "Integral time: 0.3056 s\n" | ||
| ] | ||
| } | ||
| ], | ||
|
|
@@ -936,8 +937,8 @@ | |
| "output_type": "stream", | ||
| "text": [ | ||
| "\n", | ||
| "TOTAL GRID TIME = 0.23 s\n", | ||
| "TOTAL INTEGRAL TIME = 24.13 s\n", | ||
| "TOTAL GRID TIME = 0.16 s\n", | ||
| "TOTAL INTEGRAL TIME = 17.28 s\n", | ||
| "\n", | ||
| "--- RESULTS COMPARISON ---\n", | ||
| "Total number of bins computed: 20\n", | ||
|
|
@@ -1014,7 +1015,7 @@ | |
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "execution_count": 20, | ||
| "id": "80383885-0945-4e1c-bf2e-ed64072d9130", | ||
| "metadata": { | ||
| "scrolled": true | ||
|
|
@@ -1076,7 +1077,16 @@ | |
| " shear diff = 0.000007\n", | ||
| " counts diff = 0.000010\n", | ||
| "\n", | ||
| "Trying mass_grid_size = 80\n" | ||
| "Trying mass_grid_size = 80\n", | ||
| " shear diff = 0.000007\n", | ||
| " counts diff = 0.000010\n", | ||
| "\n", | ||
| "Trying mass_grid_size = 120\n", | ||
| " shear diff = 0.000007\n", | ||
| " counts diff = 0.000010\n", | ||
| "\n", | ||
| "===== END ACCURACY SWEEP WITH COUNTS =====\n", | ||
| "\n" | ||
| ] | ||
| } | ||
| ], | ||
|
|
@@ -1253,9 +1263,9 @@ | |
| ], | ||
| "metadata": { | ||
| "kernelspec": { | ||
| "display_name": "Python (firecrown20.0)", | ||
| "display_name": "crow", | ||
| "language": "python", | ||
| "name": "firecrown_20" | ||
| "name": "crow" | ||
| }, | ||
| "language_info": { | ||
| "codemirror_mode": { | ||
|
|
@@ -1267,7 +1277,7 @@ | |
| "name": "python", | ||
| "nbconvert_exporter": "python", | ||
| "pygments_lexer": "ipython3", | ||
| "version": "3.13.0" | ||
| "version": "3.14.1" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
|
Collaborator
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. If you did not add anything to this notebook, just ran it, please restore it before commiting |
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
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 test should be in get_theorey_prediction and not here. Even if here things are 2d, if the integrator calls the function get_theory_prediction with these intervals, it will give a NDArray with several values, and if purity was not properly set, this can be a problem.