1- from nomad .metainfo import SchemaPackage
21from nomad .datamodel .metainfo .annotations import Mapper
2+ from nomad .metainfo import SchemaPackage
3+ from nomad .parsing .file_parser .mapping_parser import MAPPING_ANNOTATION_KEY
34from nomad_simulations .schema_packages import (
45 atoms_state ,
56 general ,
1011 properties ,
1112 variables ,
1213)
13- from nomad .parsing .file_parser .mapping_parser import MAPPING_ANNOTATION_KEY
14-
1514
1615m_package = SchemaPackage ()
1716
@@ -45,10 +44,7 @@ class AtomsState(model_system.AtomsState):
4544class AtomicCell (model_system .AtomicCell ):
4645 model_system .AtomicCell .atoms_state .m_annotations .setdefault (
4746 MAPPING_ANNOTATION_KEY , {}
48- ).update (dict (
49- wout = Mapper (mapper = '.labels' ),
50- win = Mapper (mapper = '.@' )
51- ))
47+ ).update (dict (wout = Mapper (mapper = '.labels' ), win = Mapper (mapper = '.@' )))
5248
5349 model_system .AtomicCell .positions .m_annotations .setdefault (
5450 MAPPING_ANNOTATION_KEY , {}
@@ -217,11 +213,13 @@ class HoppingMatrix(properties.HoppingMatrix):
217213 ).update (dict (whr = Mapper (mapper = '.degeneracy_factors' )))
218214
219215 # TODO shape mismatch
220- # properties.HoppingMatrix.value.m_annotations.setdefault(MAPPING_ANNOTATION_KEY, {}).update(dict(whr=Mapper(mapper='.hoppings', unit='eV')))
216+ # properties.HoppingMatrix.value.m_annotations.setdefault(
217+ # MAPPING_ANNOTATION_KEY, {}
218+ # ).update(dict(whr=Mapper(mapper='.hoppings', unit='eV')))
221219
222- variables .WignerSeitz .m_def .m_annotations .setdefault (MAPPING_ANNOTATION_KEY , {}). update (
223- dict ( whr = Mapper ( mapper = '.@' ))
224- )
220+ variables .WignerSeitz .m_def .m_annotations .setdefault (
221+ MAPPING_ANNOTATION_KEY , {}
222+ ). update ( dict ( whr = Mapper ( mapper = '.@' )))
225223
226224
227225class CrystalFieldSplitting (properties .CrystalFieldSplitting ):
@@ -235,9 +233,9 @@ class CrystalFieldSplitting(properties.CrystalFieldSplitting):
235233
236234
237235class Energy2 (variables .Energy2 ):
238- variables .Energy2 .points .m_annotations .setdefault (MAPPING_ANNOTATION_KEY , {}). update (
239- dict ( dos = Mapper ( mapper = '.energies' , unit = 'eV' ))
240- )
236+ variables .Energy2 .points .m_annotations .setdefault (
237+ MAPPING_ANNOTATION_KEY , {}
238+ ). update ( dict ( dos = Mapper ( mapper = '.energies' , unit = 'eV' )))
241239
242240
243241class ElectronicDensityOfStates (properties .ElectronicDensityOfStates ):
@@ -253,10 +251,7 @@ class ElectronicDensityOfStates(properties.ElectronicDensityOfStates):
253251class Outputs (outputs .Outputs ):
254252 outputs .Outputs .electronic_band_structures .m_annotations .setdefault (
255253 MAPPING_ANNOTATION_KEY , {}
256- ).update (dict (
257- wout = Mapper (mapper = '.@' ),
258- band = Mapper (mapper = '.@' )
259- ))
254+ ).update (dict (wout = Mapper (mapper = '.@' ), band = Mapper (mapper = '.@' )))
260255
261256 outputs .Outputs .hopping_matrices .m_annotations .setdefault (
262257 MAPPING_ANNOTATION_KEY , {}
@@ -272,9 +267,9 @@ class Outputs(outputs.Outputs):
272267
273268
274269class Simulation (general .Simulation ):
275- general .Simulation .program .m_annotations .setdefault (MAPPING_ANNOTATION_KEY , {}). update (
276- dict ( wout = Mapper ( mapper = '.@' ))
277- )
270+ general .Simulation .program .m_annotations .setdefault (
271+ MAPPING_ANNOTATION_KEY , {}
272+ ). update ( dict ( wout = Mapper ( mapper = '.@' )))
278273
279274 # general.Simulation.model_system.m_annotations.setdefault(
280275 # MAPPING_ANNOTATION_KEY, {}
@@ -283,16 +278,18 @@ class Simulation(general.Simulation):
283278 # wout=Mapper(mapper='.structure')
284279 # ))
285280
286- model_method .Wannier .m_def .m_annotations .setdefault (MAPPING_ANNOTATION_KEY , {}). update (
287- dict ( wout = Mapper ( mapper = '.@' ))
288- )
281+ model_method .Wannier .m_def .m_annotations .setdefault (
282+ MAPPING_ANNOTATION_KEY , {}
283+ ). update ( dict ( wout = Mapper ( mapper = '.@' )))
289284
290- general .Simulation .outputs .m_annotations .setdefault (MAPPING_ANNOTATION_KEY , {}).update (
285+ general .Simulation .outputs .m_annotations .setdefault (
286+ MAPPING_ANNOTATION_KEY , {}
287+ ).update (
291288 dict (
292289 wout = Mapper (mapper = '.@' ),
293290 band = Mapper (mapper = '.@' ),
294291 whr = Mapper (mapper = '.@' ),
295- dos = Mapper (mapper = '.@' )
292+ dos = Mapper (mapper = '.@' ),
296293 )
297294 )
298295
@@ -303,12 +300,12 @@ class Simulation(general.Simulation):
303300 wout = Mapper (mapper = '@' ),
304301 band = Mapper (mapper = '@' ),
305302 whr = Mapper (mapper = '@' ),
306- dos = Mapper (mapper = '@' )
303+ dos = Mapper (mapper = '@' ),
307304 )
308305)
309306
310307
311308try :
312309 m_package .__init_metainfo__ ()
313310except Exception :
314- pass
311+ pass
0 commit comments