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

Wrong parsing of the results which sticks numbers together. #398

Open
gjoalland13 opened this issue Apr 18, 2024 · 0 comments
Open

Wrong parsing of the results which sticks numbers together. #398

gjoalland13 opened this issue Apr 18, 2024 · 0 comments

Comments

@gjoalland13
Copy link

gjoalland13 commented Apr 18, 2024

An error is raised when opening with the attached output file of a Flare calculation using the following code:

from flare.io.otf_parser import OtfAnalysis

output_file="path/to/file.out"
otf_analysis = OtfAnalysis(output_file, True)

The following issue is raised:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[61], line 18
     14 list_trun.append(trun)
     17 output_file = f"./n{nmax}l{lmax}cut{cut}/aiida_n{nmax}l{lmax}c{cut}.out"
---> 18 otf_analysis = OtfAnalysis(output_file, True)
     19 # list_outputs.append(otf_analysis)
     20 try:

File ~/work/.venv-flare/lib/python3.9/site-packages/flare/io/otf_parser.py:61, in OtfAnalysis.__init__(self, filename, calculate_energy)
     58 self.mae_list = []
     59 self.mav_list = []
---> 61 self.parse_pos_otf(blocks[1:])
     63 if self.calculate_energy:
     64     self.energies = self.thermostat["potential energy"]

File ~/work/.venv-flare/lib/python3.9/site-packages/flare/io/otf_parser.py:206, in OtfAnalysis.parse_pos_otf(self, blocks)
    203 self.times.append(sim_time)
    205 # TODO: generalize this to account for arbitrary starting list
--> 206 append_atom_lists(
    207     [],
    208     self.position_list,
    209     self.force_list,
    210     self.uncertainty_list,
    211     self.velocity_list,
...
--> 493 force = np.array([float(n) for n in frame_line[4:7]])
    494 uncertainty = np.array([float(n) for n in frame_line[7:10]])
    495 velocity = np.array([float(n) for n in frame_line[10:13]])

ValueError: could not convert string to float: '860.0756-1513.0615'

This issue is simply due to the wrong parsing of result of the calculation in line 1045 which sticks 860.0756 to -1513.0615 and confuses the analyzer:

I       -1.0149    6.2613    9.9483     -785.6177  860.0756-1513.0615        0.905    0.0000    0.0000        0.0000    0.0000    0.0000

This error is also repeated multiple times across the file for different components of force vectors.

output.txt

@gjoalland13 gjoalland13 changed the title Wrong parsing of the results which sticks two numbers together. Wrong parsing of the results which sticks two force components together. Apr 22, 2024
@gjoalland13 gjoalland13 changed the title Wrong parsing of the results which sticks two force components together. Wrong parsing of the results which sticks numbers together. Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant