-
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.
Fix input parser for cell parameters with integers (#71)
The input parser would except for input files that define cell parameters using integers instead of floats. The regex is updated to accept integers in addition to floats. Furthermore, the regexes are slightly refactored factoring out the pattern for valid numbers which was repeated multiple times.
- Loading branch information
Showing
4 changed files
with
154 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
&control | ||
calculation = 'scf' | ||
/ | ||
&system | ||
ibrav = 0 | ||
/ | ||
ATOMIC_SPECIES | ||
Na 22.99 Na.upf | ||
ATOMIC_POSITIONS crystal | ||
Na 0.0 0.0 0.0 | ||
CELL_PARAMETERS angstrom | ||
5.7 0 0 | ||
0 5.7 0 | ||
0 0 5.7 | ||
K_POINTS gamma |
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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"atomic_positions": { | ||
"fixed_coords": [ | ||
[ | ||
false, | ||
false, | ||
false | ||
] | ||
], | ||
"names": [ | ||
"Na" | ||
], | ||
"positions": [ | ||
[ | ||
0.0, | ||
0.0, | ||
0.0 | ||
] | ||
], | ||
"units": "crystal" | ||
}, | ||
"atomic_species": { | ||
"masses": [ | ||
22.99 | ||
], | ||
"names": [ | ||
"Na" | ||
], | ||
"pseudo_file_names": [ | ||
"Na.upf" | ||
] | ||
}, | ||
"cell": [ | ||
[ | ||
5.7, | ||
0.0, | ||
0.0 | ||
], | ||
[ | ||
0.0, | ||
5.7, | ||
0.0 | ||
], | ||
[ | ||
0.0, | ||
0.0, | ||
5.7 | ||
] | ||
], | ||
"cell_parameters": { | ||
"cell": [ | ||
[ | ||
5.7, | ||
0.0, | ||
0.0 | ||
], | ||
[ | ||
0.0, | ||
5.7, | ||
0.0 | ||
], | ||
[ | ||
0.0, | ||
0.0, | ||
5.7 | ||
] | ||
], | ||
"units": "angstrom" | ||
}, | ||
"k_points": { | ||
"type": "gamma" | ||
}, | ||
"namelists": { | ||
"CONTROL": { | ||
"calculation": "scf" | ||
}, | ||
"SYSTEM": { | ||
"ibrav": 0 | ||
} | ||
}, | ||
"positions_angstrom": [ | ||
[ | ||
0.0, | ||
0.0, | ||
0.0 | ||
] | ||
] | ||
} |
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