Commit ea7de35d authored by Daniel Speckhard's avatar Daniel Speckhard
Browse files

Added Dl-Poly parser.

parent d7fa8427
Pipeline #44191 passed with stages
in 23 minutes and 46 seconds
......@@ -61,3 +61,6 @@
[submodule "dependencies/parsers/castep"]
path = dependencies/parsers/castep
url = https://gitlab.mpcdf.mpg.de/nomad-lab/parser-castep
[submodule "dependencies/parsers/dl-poly"]
path = dependencies/parsers/dl-poly
url = https://gitlab.mpcdf.mpg.de/nomad-lab/parser-dl-poly
......@@ -167,6 +167,16 @@
"-sv", "tests/test_normalizing.py::test_normalizer[parsers/castep-tests/data/parsers/castep/BC2N-Pmm2-Raman.castep]"
]
},
{
"name": "DL-Poly Normalizer",
"type": "python",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/.pyenv/bin/pytest",
"args": [
"-sv", "tests/test_normalizing.py::test_normalizer[parsers/dl-poly-tests/data/parsers/dl-poly/OUTPUT]"
]
},
{
"name": "Python: Current File",
"type": "python",
......
Subproject commit b42810dee0ef7eb97cc5de41f4b5b110f21ab374
Subproject commit 5c7cf8add659c51d940960daa430927923720f7e
Subproject commit ae97cd460788eaa1ff52b5e55f5fc812c63c42f0
Subproject commit 248e14fd36539380eed6a4e2a41986d3317d9ac3
Subproject commit 83a4de4efa40731f7e192c795fc1e82f00f27fc8
......@@ -53,7 +53,7 @@ class RepositoryNormalizer(Normalizer):
return match.group(0)
def get_optional_value(self, key, section):
# Section is section_system, section_symmetry, etc...
# Section input param is section_system, section_symmetry, etc...
val = None # Initialize to None, so we can compare section values.
diff_flag = False # Flag to store whether vals differ between sections.
# Loop over the sections with the name section in the backend.
......
......@@ -46,7 +46,6 @@ class SystemNormalizer(SystemBasedNormalizer):
""" Main normalizer that runs system, syste_type and symmetry analysis."""
self.atom_labels = section_system['atom_labels']
self.atom_species = section_system['atom_atom_numbers']
self.atom_positions = section_system['atom_positions']
self.periodic_dirs = section_system.get('configuration_periodic_dimensions', None)
if self.periodic_dirs is None:
......@@ -114,24 +113,28 @@ class SystemNormalizer(SystemBasedNormalizer):
def system_analysis(self) -> None:
"""Analyze system properties of a simulation from parsed values."""
results = dict()
if self.atom_labels is not None and self.atom_species is None:
formula = None
# TODO: @dts, might be good to clean this up so it is more readable in the
# future. Most of this flow is from the old system-classifier.
if self.atom_labels is not None:
atom_label_to_num = SystemNormalizer.atom_label_to_num
self.atom_species = [
atom_label_to_num(atom_label) for atom_label in self.atom_labels
]
formula = None
if self.atom_species:
self._backend.addValue('atom_species', self.atom_species)
results['atom_species'] = self.atom_species
atom_symbols = [
ase.data.chemical_symbols[atom_number] for atom_number in self.atom_species
]
formula = ase.Atoms(atom_symbols).get_chemical_formula(mode='all')
self._backend.addValue('chemical_composition', formula)
formula_reduced = ase.Atoms(atom_symbols).get_chemical_formula(mode='reduce')
self._backend.addValue('chemical_composition_reduced', formula_reduced)
if self.periodic_dirs is not None and any(self.periodic_dirs):
formula_bulk = formula_reduced
else:
formula_bulk = formula
self._backend.addValue('chemical_composition_bulk_reduced', formula_bulk)
if self.cell is not None:
results['lattice_vectors'] = self.cell
......@@ -144,14 +147,8 @@ class SystemNormalizer(SystemBasedNormalizer):
if self.periodic_dirs is not None:
results['configuration_periodic_dimensions'] = self.periodic_dirs.tolist()
# TODO: @dts, might be good to clean this up so it is more readable in the
# future.
configuration_id = 's' + addShasOfJson(results).b64digests()[0][0:28]
self._backend.addValue('configuration_raw_gid', configuration_id)
self._backend.addValue('atom_species', self.atom_species)
self._backend.addValue('chemical_composition', formula)
self._backend.addValue('chemical_composition_reduced', formula_reduced)
self._backend.addValue('chemical_composition_bulk_reduced', formula_bulk)
def symmetry_analysis(self) -> None:
"""Analyze the symmetry of the material bein simulated.
......
......@@ -274,6 +274,11 @@ parsers = [
name='parsers/castep',
parser_class_name='castepparser.CastepParser',
mainfile_contents_re=(r'\s\|\s*CCC\s*AA\s*SSS\s*TTTTT\s*EEEEE\s*PPPP\s*\|\s*')
),
LegacyParser(
name='parsers/dl-poly',
parser_class_name='dlpolyparser.DlPolyParserWrapper',
mainfile_contents_re=(r'\*\* DL_POLY \*\*')
)
]
......
This diff is collapsed.
SODIUM CHLORIDE WITH (27000 IONS)
restart scale
temperature 500.0
equilibration steps 200
steps 200
timestep 0.001
#scale 5
cutoff 12.0
rvdw 12.0
ewald precision 1d-6
#ensemble nvt hoover 0.02
ensemble nvt berendsen 0.01
print every 10
stats every 10
collect
job time 100
close time 10
finish
This diff is collapsed.
This diff is collapsed.
......@@ -44,14 +44,15 @@ parser_examples = [
('parsers/abinit', 'tests/data/parsers/abinit/Fe.out'),
('parsers/quantumespresso', 'tests/data/parsers/quantum-espresso/benchmark.out'),
('parsers/orca', 'tests/data/parsers/orca/orca3dot2706823.out'),
('parsers/castep', 'tests/data/parsers/castep/BC2N-Pmm2-Raman.castep')
('parsers/castep', 'tests/data/parsers/castep/BC2N-Pmm2-Raman.castep'),
('parsers/dl-poly', 'tests/data/parsers/dl-poly/OUTPUT')
]
faulty_unknown_one_d_matid_example = [
('parsers/template', 'tests/data/normalizers/no_sim_cell_boolean_positions.json')
]
correct_num_output_files = 22
correct_num_output_files = 23
class TestLocalBackend(object):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment