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

LAMMPSBaseParser: Fix the parsing of the performance data #65

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

sphuber
Copy link
Member

@sphuber sphuber commented Mar 23, 2023

The parser attempts to extract the measure of the steps per second from the logfile through a regex to match the following syntax:

Performance: 39.271 ns/day, 0.611 hours/ns, 45452.422 timesteps/s

However, this line can also appear in the form:

Performance: 140354.357 tau/day, 324.894 timesteps/s, 162.447 Matom-step/s

The regex is updated to be indifferent as to the position of the measure and simply look for the float preceding the timesteps/s marker. A test is added with an example log file with the latter format.

The parser attempts to extract the measure of the steps per second from
the logfile through a regex to match the following syntax:

    Performance: 39.271 ns/day, 0.611 hours/ns, 45452.422 timesteps/s

However, this line can also appear in the form:

    Performance: 140354.357 tau/day, 324.894 timesteps/s, 162.447 Matom-step/s

The regex is updated to be indifferent as to the position of the measure
and simply look for the float preceding the `timesteps/s` marker. A test
is added with an example log file with the latter format.

Due to the fixed parsing the reference data of the `test_parser_log`
test was out of date. The test used a manual manner of loading the
reference file and comparing it. This is replaced with the
`data_regression` fixture, which does this automatically and can be used
to automatically update the reference file.
@sphuber sphuber force-pushed the fix/performance-parsing branch from 48c224b to bbd1c0c Compare March 23, 2023 17:17
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Merging #65 (bbd1c0c) into develop (3167f7f) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop      #65   +/-   ##
========================================
  Coverage    90.24%   90.24%           
========================================
  Files           32       32           
  Lines         2439     2439           
========================================
  Hits          2201     2201           
  Misses         238      238           
Flag Coverage Δ
pytests 90.24% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiida_lammps/common/raw_parsers.py 83.20% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sphuber sphuber requested a review from JPchico March 23, 2023 18:05
Copy link
Collaborator

@JPchico JPchico left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for the help @sphuber !

@JPchico JPchico merged commit d05f0b1 into develop Mar 23, 2023
@sphuber sphuber deleted the fix/performance-parsing branch March 23, 2023 19:48
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

Successfully merging this pull request may close these issues.

2 participants