-
Notifications
You must be signed in to change notification settings - Fork 61
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
Implement new kick prescription #678
Conversation
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 looks great! if you can add a test to make sure that we have a way to test whether or not a future development for the kick subroutine breaks what you have now, then we are good!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #678 +/- ##
===========================================
- Coverage 86.91% 79.63% -7.28%
===========================================
Files 40 48 +8
Lines 25542 26992 +1450
===========================================
- Hits 22198 21494 -704
- Misses 3344 5498 +2154 ☔ View full report in Codecov by Sentry. |
* offner22 primary mass dependent binary fraction (#644) * added offner22 primary mass dependent binary fraction * pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from) * pinned numpy version so 3.7 works --------- Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org> * Update utils.py (#648) * Update utils.py fix trapezoid import * Update utils.py missed one trapz * version bump and dropping below python3.9 (#653) * version bump and dropping below python3.9 * forward to numpy 1.26.0 * trying a different version * fix trapz import * Update build_wheels_and_publish.yml explicitly install gcc * Update build_wheels_and_publish.yml trying to fix gfortran * Update build_wheels_and_publish.yml specifying path with symlink, checking path * Update build_wheels_and_publish.yml (#654) * Update build_wheels_and_publish.yml * Update _version.py * Update meson.build * Update pyproject.toml (#655) * Version bump for pip (#656) * Update meson.build * Update _version.py * Add power law sampling options for ``porb`` and ``q`` (#651) * add `q_power_law` parameter to change the power law of the mass ratio distribution * allow custom power laws for orbital periods * add mass ratio sampling test * add test for custom porb power laws * add to changelog * New ``gamma`` option for circumbinary discs (#652) * add new gamma prescription, add some int() statements * add details to docs page * update ini files * * Modifying the init file to include the commit hash. (#659) *Created get_commit_hash file that finds the commit hash. *Modified the meson.build file to run get_commit_hash when cosmic is installed. * Created maximum wall time option (#620) * Added compression options for pandas * Created maximum wall time argument * Add debugging setup, avoid NaNs from timestep issue (#647) * setup debugging environment * ignore a bunch of files * add a testing fortran script * move debugging to its own folder * add a python script for creating the input * add a simple makefile for testing * important change: use `loop` instead of `1000` for timestep condition * add a note about settings * clean up vscode setup * I can't count 🙃 * added new test suite location * fixing numpy pinned version * forcing numpy version I guess --------- Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org> Co-authored-by: Katie Breivik <kbreivik@andrew.cmu.edu> * allow a gamma of -3 in error_check (#661) * fixing wheel build for pypi, hopefully * tiny version bump (#665) * Update _version.py * Update pyproject.toml add @TomWagg as dev * Update meson.build bump version * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml removing gfortran symlink * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml (#666) * Update build_wheels_and_publish.yml * this should be a working build. * add meson to requirements * Fixing linux only wheel (#667) * Update build_wheels_and_publish.yml * adding in python versions * Update build_wheels_and_publish.yml * Update meson.build * Update meson.build * Update pyproject.toml * Pip fix (#669) * add DS_Store to ignore * finalllllly got the platform specific wheels built with a pure: false * tiny bump in version for tag * Update build_wheels_and_publish.yml need to repair linux build with cibuildwheel for PyPI * Update meson.build forgot to bump version here * build wheels and publish fix (#670) * pins cibuildwheel==2.17.0 so that we can build across macOS versions. * allow push to pypi * add x_86 and arch compatibility for wheels (#671) * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update meson.build version * Update _version.py version * Update pyproject.toml version * combine the bpp and bcm columns * pass bpp column information * add bpp column variables * pass all columns to bpp_array * only need 49 actually * bin nums separate, only index certain parts of table * all the binaries! * change writebpp function to use any columns * add new bcm variables * switch to a single function for simplicity * change everything to writetab * pass deltam to comenv too * use writetab not writebpp in comenv.f * ip not jp * add bcm stuff and convert integer columns with a loop (add kstars/evol_type) * `rsunau` ended up in the wrong place, this should fix porbs * Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows (#672) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v3...v4.1.7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * metisse update * Pypi fix (#676) * trying out pypi tests * add in wheel repair * trying native build * adding in pytest check * adding in pytest install * Update build_wheels_and_publish.yml remove the cibuildwheel environment variables and updating action versions * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml Had wrong download action version * Update build_wheels_and_publish.yml add in auditwheel for manylinux * Update build_wheels_and_publish.yml (#677) * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml split mac and linux builds * Update build_wheels_and_publish.yml trying to get cibuildwheels working again for linux * Update pyproject.toml removed pytest from cibuildwheel args * Update build_wheels_and_publish.yml don't actually publish * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update build_wheels_and_publish.yml * Update _version.py * Update pyproject.toml * Update meson.build * Implement new kick prescription (#678) * start a function for changing bases * add cross product function * fix indents * better variables and copy over initial function part * angles, better variables, natal kick done * fix transformation for pre-disrupted binaries * add vector calculations * everything done except Euler angles * add dot product and angle functions * fix indentation, add kick info logging of disrupt * start adding Euler angles * rename files * fix vector variables * get rid of redundant anomaly stuff * snstar->sn, update jorb, record in kick_info * make kick info bigger * /= is not a thing in fortran who knew * it lives! (compiles!) * move helpers, calculate new sep, use correct mass! * better docstring info * add check for collisions * clean up all of the units * properly update Euler angles * declare all the variables * put the old function back in * change kickflag definition * change default kickflag to 1 not 0 * update kickflag docs * update ini files * missed some kickflags * calculate h_mag earlier, fix jorb units * fix tiny typo * update tests to check on OLD kick prescription for now * add another test for ejection velocities * update changelog and version * more version updates --------- Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org> * fix error check * Fix NaNs coming from supernova kicks (#679) * account for cases with no natal kick and ecc_prev=0.0 * don't forget binstate mergertype bookkeeping * Update cosmic-pop (#683) Fixed parsing of binfrac model. Now string values are properly handled. * get working * fixing tests but as a hack for a couple of them because we updated the kicks and I dont have time to fix it --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com> Co-authored-by: Tom Wagg <tomjwagg@gmail.com> Co-authored-by: elenagonzalez870 <52000594+elenagonzalez870@users.noreply.github.com> Co-authored-by: Vera Eris Del Favero <77068792+xevra@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tldr;
This PR replaces the default COSMIC prescription for handling kick velocities. Instead of using Kiel & Hurley 2009, it now follows Pfahl+2002. The former produces strange results for disrupted systems, in which the secondary ejection velocity showed a dependence on the natal kick strength, which goes against physical intuition (see #675).
Changes
Breaking code changes:
kickflag
is now an option that can be 1, 2, 3, or 4 to replace the old options. Additionally, if users want to use the old K&H prescription, you use the negative of any of those values.Other code fixes (note: in the interest of reproducibility I haven't fixed these in the old Kiel prescription)
Physical evolution changes
Comparison of a disrupted system
For unbound systems, the velocity of the companion has been changed a fair bit. Here's 5000 random draws for the same binary (m1=20, m1=15, porb=200, Z=0.02, ecc=0)
Comparison of a bound system
And for bound systems, the final separations are pretty much unchanged (these are just different random draws so you see a little scatter).
This will close #675.