-
Notifications
You must be signed in to change notification settings - Fork 213
Support SpEC initial data in BBH pipeline #6031
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
Conversation
knelli2
left a comment
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.
Have you tested this out yet?
support/Pipelines/Bbh/Inspiral.py
Outdated
| # Here we have to deal with SpEC storing the initial data parameters in a | ||
| # perl script (yay!). We evaluate the perl script, emit the variables as | ||
| # YAML, and load that into Python as a dictionary. |
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.
Since we are technically added a dependency on perl now, should we document that somewhere? I'm not sure if it's safe to assume that all systems will have perl in the default PATH (though they should...)
| ) | ||
|
|
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.
Can't reach with github comments, but in this docstring, add that the ID_INPUT_FILE_PATH can either be to a SpECTRE ID input file or a SpEC ID_Params.perl file
support/Pipelines/Bbh/Inspiral.py
Outdated
| ] | ||
| perl_script = [ | ||
| f'do "{id_params_file.resolve()}";', | ||
| "print YAML::Dump({ " |
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.
Is this part of the core perl install? I don't know how easy it is to install perl modules locally. It may be easier to parse the file ourselves rather than rely on a perl module. We then also don't have to worry about calling into perl from a python script :)
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.
I don't think so? I just tried on my local machine a test.pl that had only use YAML and it complained about a missing module. This also does warn against using the YAML module if we were going to use a module.
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.
Ok I wanted to avoid parsing perl syntax with regex because I hate that too :D I'll see what can be done. (this code isn't the most critical in the big picture either, I'd like to delete it again in sooner or 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.
Could you just read the file in as a string, do some replacements like you're already doing and use a yaml parser in python?
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.
Convert perl syntax to yaml or json? Yea good idea
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.
Basically, yeah
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.
Just rewrite all of SpEC to use yaml. Easy ;) :D
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.
Ok done (@knelli2's suggestion, not @nilsdeppe's 😄)
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.
Just rewrite all of SpEC to use yaml. Easy ;) :D
Actually that's kind of what we're doing ;)
Proposed changes
Allows to start a BBH evolution from SpEC initial data like this:
Closes #6020.
Upgrade instructions
Code review checklist
make docto generate the documentation locally intoBUILD_DIR/docs/html.Then open
index.html.code review guide.
bugfixornew featureif appropriate.Further comments