Closed HeloiseS closed 2 years ago
@HeloiseS Leave the spaces out inside the [ ]. If you have spaces there the shell parser thinks it's a new command-line argument (command-line arguments are space-delimited). COMPAS can't do anything about that - the shell parser does it's work before COMPAS gets to see the options. I thought I documented that in the online documentation, but I can't find it. I'm sure it was in the PDF documentation (the predecessor to the online documentation), so I must have inadvertently left it out. I'll update the documentation. Please leave this issue open, and I'll close it once I have updated the documentation.
I note that I do document the spaces issue for vector options here:
Edit: Also, if you want to specify ranges and sets in pythonSubmit, you need to put quotes around the range/set value. i.e.
This will fail in pythonSubmit:
metallicity = [0.0112,3,0.01]
but this will work:
metallicity = '[0.0112,3,0.01]'
Python will try to parse the first one, and fail, but for the second it will pass the quoted parameter through to the command line.
This is documented here:
https://compas.readthedocs.io/en/latest/pages/User%20guide/Running%20COMPAS/running-via-python.html
(maybe it should also be on t he ranges/sets pages).
(Note to self: also fix "correspodning" in program-options-vector-options.rst)
Cheers!
It now runs with the spces removed but when i run compas --metallicity [0.012,3,0.001] -n 5000
i only get 3 models. I thought it would give me 5000 models per mets but it seems to ignore the -n? switching order doesn't help is there priorities in commnds i need to consider?
I did that because the ranges and sets were meant to make it easy to specify a range (and set) of initial conditions. and if the user specified ranges and sets for multiple options (e.g. metallicity, initial-mass-1, initial-mass-2, etc. - the ones that otherwise would be sampled by COMPAS), then also using -n/--number-of-systems would just produce multiple copies of the same binaries - so I ignore -n/--number-of-systems. I probably didn't document that, did I...? I'll fix that.
However, if you use a grid file, then the ranges and sets on the command-line will be played out for each grid file line.
So this:
./compas --metallicity [0.012,3,0.001] --eccentricity s[0.1,0.2,0.3] --grid mygrid.txt
and 5 lines in mygrid.txt
will result in 45 binaries (3 x 3 x 5)
@jeffriley -- do I understand correctly that the only action item on this is to document the existing behaviour?
@ilyamandel indeed you do. I'll get to it soon...
Thanks, @jeffriley !
Documentation changes in PR #724
Close when merged
This issue is submitted as part of the JOSS review #3838
:bug: Description So I'm trying to make models for a range of metallicities following the instructions on this page.
The command I'm trying to parse is as follows (note i have aliased the location of COMPAS to
compas
):compas --metallicity [0.0012, 3, 0.01] --number-of-systems 5000
I tried with having ther
andrange
in front of the square brackets to no avail. I tried within the pythonSubmit.py file withmetallicity = [0.0112, 3, 0.01]
and got the same error.EDIT: your example works though, so I clearly did something wrong, just not sure what :)