TeamCOMPAS / COMPAS

COMPAS rapid binary population synthesis code
http://compas.science
MIT License
65 stars 66 forks source link

Grid file arguments not read correctly #519

Closed reinhold-willcox closed 3 years ago

reinhold-willcox commented 3 years ago

Describe the bug

COMPAS behavior is not consistent when running command line arguments vs gridfile arguments. Note that this is the actual cause of issue #517 (which is now closed). I believe the issue is that the gridfile reader is not correctly recognizing the "--evolve-unbound-systems" flag, but command line compas has no problem with this.

Label the issue urgency_moderate - This is a moderately urgent issue severity_moderate - This is a moderately severe bug

To Reproduce Create a file gridfile.txt with the same line of arguments as in issue #517.

--number 1 --random-seed 1253348 --initial-mass-1 7.774703670821885 --semi-major-axis 693.9547537158253 --initial-mass-2 6.628395253709512 --metallicity 0.0142 --eccentricity 0 --kick-theta-1 1.121298905520773 --kick-theta-2 -0.11028283259069305 --kick-phi-1 3.2789799698707145 --kick-phi-2 0.07861287414621784 --kick-mean-anomaly-1 5.386188554554972 --kick-mean-anomaly-2 5.452499790241414 --evolve-unbound TRUE --remnant-mass-prescription FRYER2012 --kick-magnitude-1 100 --kick-magnitude-2 100

Then run as both a true gridfile, and separately as command line args (either copy pasted, or passing the args to stdin as below). Even without looking at the H5 files, the stdout shows that the gridfile does not produce 2 NSs.

$ COMPAS --grid gridfile.txt 

...
Start generating binaries at Fri Jan 29 10:39:21 2021

0: Unbound binary: Neutron_Star + Main_Sequence_>_0.7

...
$ COMPAS `< gridfile.txt`

...
Start generating binaries at Fri Jan 29 10:39:34 2021

0: Allowed time exceeded: Neutron_Star + Neutron_Star

Expected behavior Arguments passed in either a gridfile or command line args should produce the same output.

Screenshots If applicable, add screenshots to help explain your problem.

Versioning (please complete the following information):

Other information The binary in particular disrupts at first SN, which is why I think the evolve-unbound-systems flag is what's playing up. I haven't checked that this is definitely the root of the issue, or that none of the other parameters are acting up.

jeffriley commented 3 years ago

My bad. Option '--evolve-unbound-systems' is only ever read from the commandline. I have no idea what I was thinking when I did that - either I thought nobody would mix evolving unbound and not evolving unbound in the same run, or it was just an oversight. Either way, I'll push a fix that will treat '--evolve-unbound-systems' like any other option that can be specified in a grid file.