Skip to content

[bug] test_morse.py defaults to run_sim=False, producing a confusing error message #257

@drobnyjt

Description

@drobnyjt

Description
test_morse.py is an important example script because it demonstrates the best-to-date way of producing input files for RustBCA via Python and also demonstrates the effective use of ACPRAS to better reproduce experimental results. run_sim should be set to True in this example so that the simulations run instead of producing plots based on (nonexistent) simulated data.

To Reproduce
python test_morse.py

Expected behavior
run_sim should be True

Error messages, output files, or figures

Traceback (most recent call last):
  File "C:\rustbca\examples\test_morse.py", line 183, in <module>
    R_N[index], R_E[index] = run_krc_morse_potential(energy, index, num_samples=num_samples, run_sim=False)
  File "C:\rustbca\examples\test_morse.py", line 131, in run_krc_morse_potential
    reflected_list = np.atleast_2d(np.genfromtxt(f'krc_morse_{index}reflected.output', delimiter=','))
  File "C:\Program Files\Python39\lib\site-packages\numpy\lib\npyio.py", line 1977, in genfromtxt
    fid = np.lib._datasource.open(fname, 'rt', encoding=encoding)
  File "C:\Program Files\Python39\lib\site-packages\numpy\lib\_datasource.py", line 193, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)
  File "C:\Program Files\Python39\lib\site-packages\numpy\lib\_datasource.py", line 533, in open
    raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: krc_morse_0reflected.output not found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions