PyAutoFit: DynestyDynamic raises OverflowError (int too large to convert to C long) when run without an output path #28
Unanswered
samlange04
asked this question in
Bugs & Errors
Replies: 1 comment
|
Give the search a name until the patch is merged: search = af.DynestyDynamic(name="gauss", nlive_init=50)With no name, the call budget is a huge number ( |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Package: PyAutoFit (
autofit), currentmain(891fe64b9), dynesty 2.1.5. Platform: macOS, Python 3.13.7 (the overflow is not platform specific).What happens
DynestyDynamiccrashes when the search has no output path, i.e. it was created without anameso itspathsisNullPaths.DynestyStaticworks in the same situation.Giving the search a
name(so it writes to an output directory) avoids it.Cause
AbstractDynesty.iterations_fromreturns the per-chunk call budget passed to dynesty asmaxcall. ForNullPathswith nomaxcallset it returnsint(1e99)as an "unbounded" sentinel. dynesty's dynamic sampler evaluatesmaxcall - ncallwherencallis a numpy int64, and a 99-digit Python int cannot be converted to a C long for that subtraction. The static sampler only comparesncall >= maxcallin pure Python, so it is unaffected.Proposed fix
Return
sys.maxsizeinstead ofint(1e99)in theNullPathsbranch.sys.maxsizeis the sentinel dynesty itself substitutes whenmaxcall=None, andsys.maxsize - np.int64(n)is well defined. Themaxcall-set branch is unchanged.Branch: https://github.com/samlange04/PyAutoFit/tree/fix/dynesty-dynamic-nullpaths-overflow. With it applied the script above runs to completion, and the fix comes with a regression test parametrised over both dynesty searches.
PR: PyAutoLabs/PyAutoFit#1658
All reactions