-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use annotations from future for cleaner type hint. Moved qe_time_to_s…
…ec to utils. Renamed BaseStdoutParser.parse_stdout_base to parse for compatibility with parent abstract class.
- Loading branch information
Showing
11 changed files
with
58 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Tools for converting Quantum ESPRESSO outputs to Python data types.""" | ||
|
||
|
||
def convert_qe_time_to_sec(timestr): | ||
"""Given the walltime string of Quantum Espresso, converts it in a number of seconds (float).""" | ||
rest = timestr.strip() | ||
|
||
if 'd' in rest: | ||
days, rest = rest.split('d') | ||
else: | ||
days = '0' | ||
|
||
if 'h' in rest: | ||
hours, rest = rest.split('h') | ||
else: | ||
hours = '0' | ||
|
||
if 'm' in rest: | ||
minutes, rest = rest.split('m') | ||
else: | ||
minutes = '0' | ||
|
||
if 's' in rest: | ||
seconds, rest = rest.split('s') | ||
else: | ||
seconds = '0.' | ||
|
||
if rest.strip(): | ||
raise ValueError(f"Something remained at the end of the string '{timestr}': '{rest}'") | ||
|
||
num_seconds = float(seconds) + float(minutes) * 60.0 + float(hours) * 3600.0 + float(days) * 86400.0 | ||
|
||
return num_seconds | ||
from __future__ import annotations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters