Skip to content
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

[bug] Issue with generate_rustbca_input in scripts #230

Open
nickschw2 opened this issue Dec 6, 2023 · 1 comment
Open

[bug] Issue with generate_rustbca_input in scripts #230

nickschw2 opened this issue Dec 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@nickschw2
Copy link

generate_rustbca_input in rustbca.py produces toml files that cannot be run with cargo run --release <filename>. The errors I have identified include the following

  • root_finder, interactional_potential, and scattering_integral require that the values be contained within double quotes
  • The new method of 2D mesh input has not been updated in this function

This issue is likely also true for a few other functions in the script, but I've only used this one.

@nickschw2 nickschw2 added the bug Something isn't working label Dec 6, 2023
@drobnyjt
Copy link
Collaborator

drobnyjt commented Dec 6, 2023

Hi @nickschw2 - yeah, that function just hasn't been kept up to date with RustBCA's input files. I encountered an issue with the toml Python library's handling of nested inline tables and, not being able to figure out an effective fix, essentially deprecated generate_rustbca_input by attempting to remove every mention of it from the Wiki and the readme (let me know if I missed a place).

If you'd like to fix it and open a pull request, I'd be happy to approve it; I'm not sure when I would be able to get around to taking another stab at it, and honestly might just as soon delete it as fix and keep it.

If you want a workaround, you can skip the toml library by making the entire input file a multi-line f-string that gets printed to a file instead of a dictionary that needs to be processed by the toml library, like so:

some_value = 5

input file = f'''
[options]
some_option = {some_value}
'''
with open('input.toml', 'w') as file:
    file.write(input_file)

This is used for example in test_morse.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants