Commit 63c52686 authored by Daniel Speckhard's avatar Daniel Speckhard
Browse files

Not working yet.

parent 5215a7fb
...@@ -9,6 +9,7 @@ syntax: glob ...@@ -9,6 +9,7 @@ syntax: glob
*.pyc *.pyc
*.bk *.bk
*.swp *.swp
*.egg-info
.DS_Store .DS_Store
*.annotate *.annotate
......
# Copyright 2016-2019 Hjorth Larsen
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from setuptools import setup, find_packages
def main():
setup(
name='siestaparser',
version='0.1',
description='NOMAD parser implementation for Siesta.',
author='Hjorth Larsen',
author_email='asklarsen@gmail.com',
license='GPL3',
package_dir={'': './'},
packages=find_packages(),
include_package_data=True,
install_requires=[
'nomadcore',
],
)
if __name__ == '__main__':
main()
# Copyright 2016-2018 Lauri Himanen, Fawzi Mohamed, Ankit Kariryaa
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from siestaparser.main import SiestaParser
#!/bin/bash
python main.py test/H2O/out --annotate 2>&1 | tee test/H2O/json
python main.py test/H2O-relax/out --annotate 2>&1 | tee test/H2O-relax/json
python main.py test/Al-bulk/out --annotate 2>&1 | tee test/Al-bulk/json
python main.py test/Al-slab/out --annotate 2>&1 | tee test/Al-slab/json
python main.py test/MgO/out --annotate 2>&1 | tee test/MgO/json
python main.py test/smeagol-Au-leads/Au.out --annotate 2>&1 | tee test/smeagol-Au-leads/json
python main.py test/smeagol-Au-scregion/Au.out --annotate 2>&1 | tee test/smeagol-Au-scregion/json
# Copyright 2016-2018 Ask Hjorth Larsen, Fawzi Mohamed
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Main author and maintainer: Ask Hjorth Larsen <asklarsen@gmail.com>
varlist = [
'%endblock',
'Atom-Setup-Only',
'Atom.Debug.KB.Generation',
'AtomCoorFormatOut',
'AtomLeftVcte',
'AtomRightVcte',
'AtomicCoordinatesFormat',
'BasisPressure',
'BornCharge',
'BuildSuperCell',
'BulkLead',
'BulkTransport',
'BulkTransvCellSize',
'BulkTransvCellSizeX',
'BulkTransvCellSizeY',
'BulkTransvCellSizeZ',
'CB.MaxKappa',
'CB.WriteComplexBands',
'CDFT',
'CDFT.MaxIter',
'COOP.Write',
'CalcIETS',
'CalcMPSH',
'ChangeKgridInMD',
'Compat-pre-v4-DM-H',
'DM.AllowExtrapolation',
'DM.AllowReuse',
'DM.EnergyTolerance',
'DM.FIRE.Mixing',
'DM.FormattedFiles',
'DM.FormattedInput',
'DM.FormattedOutput',
'DM.HarrisTolerance',
'DM.KickMixingWeight',
'DM.MixSCF1',
'DM.MixingWeight',
'DM.NormalizationTolerance',
'DM.NormalizeDuringSCF',
'DM.NumberBroyden',
'DM.NumberKick',
'DM.NumberPulay',
'DM.OccupancyTolerance',
'DM.Pulay.Avoid.First.After.Kick',
'DM.PulayOnFile',
'DM.RequireEnergyConvergence',
'DM.RequireHarrisConvergence',
'DM.Tolerance',
'DM.UseSaveDM',
'Delta',
'DeltaWorkfunction',
'Diag.AllInOne',
'Diag.DivideAndConquer',
'Diag.Memory',
'Diag.NoExpert',
'Diag.ParallelOverK',
'Diag.PreRotate',
'Diag.Use2D',
'DiagMemory',
'DiagScale',
'DirectPhi',
'DivideAndConquer',
'EM.AddRhoGate',
'EM.AddVgIsolatedLocalCharges',
'EM.COOPCalculate',
'EM.COOPNumberOfBonds',
'EM.DebugRhoGate',
'EM.NetRhoGateCharge',
'EM.PrintLimits',
'EM.RhoGateLxMax',
'EM.RhoGateLxMin',
'EM.RhoGateLyMax',
'EM.RhoGateLyMin',
'EM.RhoGateLzMax',
'EM.RhoGateLzMin',
'EM.TRCAddVCDFT',
'EM.TimeReversal',
'EM.Timings',
'EM.addV',
'EMPDOSKSO',
'EMTransport',
'ElectronicTemperature',
'EnergLowestBound',
'FilterCutoff',
'FilterTol',
'FinalTransmRange',
'FixAuxiliaryCell',
'FixAuxillaryCell',
'FixSpin',
'ForceAuxCell',
'FullRamp',
'HSetupOnly',
'Harris_functional',
'HartreeLeadsBottom',
'HartreeLeadsLeft',
'HartreeLeadsRight',
'Ik_Select',
'InitTransmRange',
'InitTransport',
'KB.New.Reference.Orbitals',
'KB.Rmax',
'LDAU.units',
'LDAUForces',
'LDAU_METHOD',
'LatticeConstant',
'LongOutput',
'MD.AnnealOption',
'MD.BulkModulus',
'MD.FCAcousticSumRule',
'MD.FCAtomRestart',
'MD.FCAxisRestart',
'MD.FCDispl',
'MD.FCEigenVectors',
'MD.FCIR',
'MD.FCRead',
'MD.FCfirst',
'MD.FClast',
'MD.FinalTimeStep',
'MD.FireQuench',
'MD.InitialTemperature',
'MD.InitialTimeStep',
'MD.LengthTimeStep',
'MD.MaxCGDispl',
'MD.MaxForceTol',
'MD.MaxStressTol',
'MD.NoseMass',
'MD.NumCGsteps',
'MD.NumNEBsteps',
'MD.ParrinelloRahmanMass',
'MD.Quench',
'MD.RelaxCellOnly',
'MD.RemoveIntraMolecularPressure',
'MD.TRCSampling',
'MD.TRCSkip',
'MD.TargetPressure',
'MD.TargetTemperature',
'MD.TauRelax',
'MD.Timing',
'MD.TypeOfRun',
'MD.UseSaveCG',
'MD.UseSaveNEB',
'MD.UseSaveXV',
'MD.UseSaveZM',
'MD.UseStructFile',
'MD.VariableCell',
'MM.Cutoff',
'MM.UnitsDistance',
'MM.UnitsEnergy',
'MPSHAtomFirst',
'MPSHAtomLast',
'MPSHOrbFirst',
'MPSHOrbLast',
'MaxBondDistance',
'MaxSCFIterations',
'MeshCutoff',
'MeshSubDivisions',
'MinSCFIterations',
'MixCharge',
'MixHamiltonian',
'MixedParallel',
'MonitorForcesInSCF',
'MullikenInSCF',
'NC.OrbitalRotationEnd',
'NC.OrbitalRotationStart',
'NEB.SkipEdge',
'NEnergReal',
'NIVPoints',
'NPoles',
'NSlices',
'NTransmPoints',
'NaiveAuxiliaryCell',
'NeglNonOverlapInt',
'NenergImCircle',
'NenergImLine',
'NetCharge',
'NonCollinearSpin',
'NumSkipWriteDM',
'NumberLinearMix',
'NumberOfAtoms',
'NumberOfEigenStates',
'NumberOfSpecies',
'Number_of_species',
'ON.ChemicalPotential',
'ON.ChemicalPotentialOrder',
'ON.ChemicalPotentialRc',
'ON.ChemicalPotentialTemperature',
'ON.ChemicalPotentialUse',
'ON.MaxNumIter',
'ON.UseSaveLWF',
'ON.eta',
'ON.eta_alpha',
'ON.eta_beta',
'ON.etol',
'ON.functional',
'OccupationFunction',
'On.RcLWF',
'OpticalCalculation',
'Optim.Broyden',
'Output-Structure-Only',
'PAO.BasisSize',
'PAO.BasisType',
'PAO.EnergyShift',
'PAO.Filter',
'PAO.FixSplitTable',
'PAO.Keep.Findp.Bug',
'PAO.NewSplitCode',
'PAO.OldStylePolorbs',
'PAO.SoftDefault',
'PAO.SoftInnerRadius',
'PAO.SoftPotential',
'PAO.SplitNorm',
'PAO.SplitNormH',
'PAO.SplitTailNorm',
'PS.SIC',
'ParallelOverK',
'PartialChargesAtEveryGeometry',
'PartialChargesAtEveryScfStep',
'PoissonMultigrid',
'Print_ldau',
'ProcessorGridX',
'ProcessorGridY',
'ProcessorGridZ',
'ProjectionInSCF',
'ProjectionMethod',
'RcSpatial',
'ReInitialiseDM',
'ReadHamiltonian',
'ReadKPIN',
'ReparametrizePseudos',
'Restricted.Radial.Grid',
'Rmax.Radial.Grid',
'RotateSpin.Phi',
'RotateSpin.Theta',
'SCF.LinearMixingAfterPulay',
'SCF.MixAfterConvergence',
'SCF.MixingWeightAfterPulay',
'SCF.Pulay.Damping',
'SCF.Pulay.DebugSVD',
'SCF.Pulay.RcondSVD',
'SCF.Pulay.UseSVD',
'SCF.PulayDmaxRegion',
'SCF.PulayMinimumHistory',
'SCF.Read.Charge.NetCDF',
'SCF.Read.Deformation.Charge.NetCDF',
'SCF.Recompute-H-After-Scf',
'SCF.Want.Variational.EKS',
'SCFMustConverge',
'SIC.Flavour',
'SIC.Lambda',
'SIC.NoRelaxation',
'SIC.Npop',
'SIC.PopDMConv',
'SIC.PopKgridFactor',
'SIC.PopSmatSparsity',
'SIC.ProjectionMode',
'SIC.ProjectionType',
'SIC.Rot_Inv',
'STT.Calculation',
'STT.LinearResponse',
'SaveBaderCharge',
'SaveDeltaRho',
'SaveElectrostaticPotential',
'SaveHS',
'SaveInitialChargeDensity',
'SaveIonicCharge',
'SaveNeutralAtomPotential',
'SaveRho',
'SaveRhoXC',
'SaveTotalCharge',
'SaveTotalPotential',
'Scissor.Operator',
'SetBulkTransvCell',
'Siesta2Wannier90.NumberOfBands',
'Siesta2Wannier90.NumberOfBandsDown',
'Siesta2Wannier90.NumberOfBandsUp',
'Siesta2Wannier90.WriteAmn',
'Siesta2Wannier90.WriteEig',
'Siesta2Wannier90.WriteMmn',
'Siesta2Wannier90.WriteUnk',
'Sigma.DSigmaDE',
'SignatureRecords',
'SimulateDoping',
'SingleExcitation',
'SkipLastIter',
'SlabDipoleCorrection',
'SolutionMethod',
'SpinConfLeads',
'SpinOrbit',
'SpinPolarized',
'SystemLabel',
'SystemName',
'TS.MixH',
'TimeReversal',
'TimeReversalSymmetryForKpoints',
'TrCoefficients',
'TryMemoryIncrease',
'UseDomainDecomposition',
'UseNewDiagk',
'UseSaveData',
'UseSpatialDecomposition',
'UseStructFile',
'UseTreeTimer',
'VFinal',
'VGate',
'VInitial',
'Vna.Filter',
'WarningMinimumAtomicDistance',
'WriteBands',
'WriteCoorCerius',
'WriteCoorInitial',
'WriteCoorStep',
'WriteCoorXmol',
'WriteDM',
'WriteDM.History.NetCDF',
'WriteDM.NetCDF',
'WriteDMHS.History.NetCDF',
'WriteDMHS.NetCDF',
'WriteDMT',
'WriteDenchar',
'WriteDiagdS',
'WriteEDM',
'WriteEigenvalues',
'WriteForces',
'WriteHSDeriv',
'WriteHamiltonPop',
'WriteHirshfeldPop',
'WriteIonPlotFiles',
'WriteKbands',
'WriteKpoints',
'WriteMDXmol',
'WriteMDhistory',
'WriteMullikenPop',
'WriteProjections',
'WriteSpinMulliken',
'WriteSpinSCF',
'WriteVNA',
'WriteVoronoiPop',
'WriteWaveFunctions',
'XML.AbortOnErrors',
'XML.AbortOnWarnings',
'XML.Write',
'ZBroadeningG',
'ZLeftVcte',
'ZM.CalcAllForces',
'ZM.ForceTolAngle',
'ZM.ForceTolLength',
'ZM.MaxDisplAngle',
'ZM.MaxDisplLength',
'ZM.UnitsAngle',
'ZM.UnitsLength',
'ZRightVcte',
'ZVGateL',
'ZVGateR',
'ZeemanTermBx',
'ZeemanTermBy',
'ZeemanTermBz',
'alloc_report_level',
'alloc_report_threshold',
'blocksize',
'compat-pre-v4-dynamics',
'fdf-debug',
'kgrid_cutoff',
'processorY',
'timer_report_threshold',
'user-basis',
'user-basis-netcdf',
'xc.authors',
'xc.functional',
]
This diff is collapsed.
# Copyright 2016-2018 Ask Hjorth Larsen, Fawzi Mohamed
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Main author and maintainer: Ask Hjorth Larsen <asklarsen@gmail.com>
from __future__ import print_function
# TEMPLATES TAKEN FROM OCTOPUS. KEEP SYNCHRONIZED.
json_header = """{
"type": "nomad_meta_info_1_0",
"description": "autogenerated nomad meta info for %(parser)s parser. The file which generates this maintained in the parser's git repository.",
"dependencies": [ {
"relativePath": "common.nomadmetainfo.json"
}],
"metaInfos": [ %(info)s]
}"""
json_template = """{
"description": "%(description)s",
"dtypeStr": "%(dtypeStr)s",
"name": "%(name)s",
"repeats": false,
"shape": [],
"superNames": [
"%(supername)s"
]
}"""
json_section_template = """{
"description": "%(description)s",
"kindStr": "type_abstract_document_content",
"name": "%(name)s",
"superNames": [
"x_siesta_section_input"
]
}, {
"description": "input section",
"kindStr": "type_section",
"name": "x_siesta_section_input",
"superNames": [
"section_method"
]
}"""
# END OF TEMPLATES FROM OCTOPUS
import sys
#fname = sys.argv[1]
inputvars_fd = open('inputvars.py', 'w')
print('varlist = [', file=inputvars_fd)
def getlines():
fd = open('test/H2O/fdf-95611.log')
for line in fd:
if not line[:1].isalpha(): # Get rid of blocks
continue
yield line
withinblock = False
fd = open('test/smeagol-Au-leads/out.fdf')
for line in fd:
if line.startswith('%block'):
withinblock = True
elif line.startswith('%endblock'):
withinblock = False
if withinblock:
continue
yield line
seen = set()
#with open(fname) as fd:
#for line in getlines():
if 1:
varnames = []
for line in getlines():
# Get rid of comments
line = line.strip().rsplit('#', 1)[0].strip()
if not line:
continue
varname = line.split()[0]
lowervarname = varname.lower()
if lowervarname in seen:
continue # Already registered
seen.add(lowervarname)
varnames.append(varname)
varnames = list(set(varnames))
varnames.sort()
jsontokens = []
for var in varnames:
print(" '%s'," % var, file=inputvars_fd)
json = json_template % dict(description=r'siesta input variable \"%s\"'
% var,
name='x_siesta_input_%s' % var,
dtypeStr='C',
supername='x_siesta_input')
jsontokens.append(json)
section = json_section_template % dict(description='siesta input '
'variables',
name='x_siesta_input')
jsontokens.append(section)
txt = json_header % dict(parser='siesta',
info=', '.join(jsontokens))
print(txt)
print(']', file=inputvars_fd)
# Copyright 2016-2018 Ask Hjorth Larsen, Fawzi Mohamed
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Main author and maintainer: Ask Hjorth Larsen <asklarsen@gmail.com>
from __future__ import print_function
import os
from main import main
testdir = '../../test/examples'
dirnames = ['H2O',
'H2O-relax',
'Al-slab',
'Al-uc',
'Fe',
'MgO']
for dirname in dirnames:
fname = os.path.join(testdir, dirname, 'out')
with open('out.pycheck.%s.txt' % dirname, 'w') as outfd:
main(mainFile=fname, outF=outfd)
Markdown is supported
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