Skip to content

Conversation

@nilsvu
Copy link
Member

@nilsvu nilsvu commented May 25, 2024

Proposed changes

Allows to start a BBH evolution from SpEC initial data like this:

spectre bbh start-inspiral ID_Params.perl -O Ev

Closes #6020.

Upgrade instructions

Code review checklist

  • The code is documented and the documentation renders correctly. Run
    make doc to generate the documentation locally into BUILD_DIR/docs/html.
    Then open index.html.
  • The code follows the stylistic and code quality guidelines listed in the
    code review guide.
  • The PR lists upgrade instructions and is labeled bugfix or
    new feature if appropriate.

Further comments

@nilsvu nilsvu added the cli/pybindings Command line interface & Python bindings label May 25, 2024
@nilsvu nilsvu added this to the BBH Pipeline Automation milestone May 25, 2024
Copy link
Contributor

@knelli2 knelli2 left a 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?

Comment on lines 61 to 63
# 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.
Copy link
Contributor

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...)

Comment on lines 161 to 148
)

Copy link
Contributor

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

]
perl_script = [
f'do "{id_params_file.resolve()}";',
"print YAML::Dump({ "
Copy link
Member

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 :)

Copy link
Contributor

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.

Copy link
Member Author

@nilsvu nilsvu May 29, 2024

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)

Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, yeah

Copy link
Member

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

Copy link
Member Author

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 😄)

Copy link
Member Author

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 ;)

@nilsvu nilsvu force-pushed the spec_id_pipeline branch from 79b4cb6 to 3c3d29d Compare May 29, 2024 01:42
@nilsvu nilsvu force-pushed the spec_id_pipeline branch from 3c3d29d to 6147db8 Compare May 29, 2024 01:44
@nilsdeppe nilsdeppe merged commit f0ece6c into sxs-collaboration:develop May 29, 2024
@nilsvu nilsvu deleted the spec_id_pipeline branch June 6, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli/pybindings Command line interface & Python bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow BBH inspiral pipeline to start from SpEC ID

3 participants