Skip to content

Commit fe81d97

Browse files
ndaelman-hundaelman
andauthored
Remove editable annotations (#162)
* Fix typo * Remove spurious normalization * - Deactivate `EditQuantity` annotations - Remove more spurious normalizers * Apply ruff * Remove annotations * - Remove `ELNAnnotation` imports - Remove 2 extra editable annotations --------- Co-authored-by: ndaelman <ndaelman@physik.hu-berlin.de>
1 parent 0c0caad commit fe81d97

16 files changed

+2
-221
lines changed

docs/normalize.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Section1(ArchiveSection):
2525
class Section2(ArchiveSection):
2626
normalizer_level = 0
2727

28-
def normalize(self, achive, logger):
28+
def normalize(self, archive, logger):
2929
super().normalize(archive, logger)
3030
# Some operations here or before `super().normalize(archive, logger)`
3131

@@ -36,7 +36,7 @@ class ParentSection(ArchiveSection):
3636

3737
sub_section_2 = SubSection(Section2.m_def, repeats=True)
3838

39-
def normalize(self, achive, logger):
39+
def normalize(self, archive, logger):
4040
super().normalize(archive, logger)
4141
# Some operations here or before `super().normalize(archive, logger)`
4242
```

src/nomad_simulations/schema_packages/atoms_state.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import numpy as np
55
import pint
66
from nomad.datamodel.data import ArchiveSection
7-
from nomad.datamodel.metainfo.annotations import ELNAnnotation
87
from nomad.datamodel.metainfo.basesections import Entity
98
from nomad.metainfo import MEnum, Quantity, SubSection
109
from nomad.units import ureg
@@ -308,7 +307,6 @@ class CoreHole(ArchiveSection):
308307
description="""
309308
Reference to the OrbitalsState section that is used as a basis to obtain the `CoreHole` section.
310309
""",
311-
a_eln=ELNAnnotation(component='ReferenceEditQuantity'),
312310
)
313311

314312
n_excited_electrons = Quantity(
@@ -411,7 +409,6 @@ class HubbardInteractions(ArchiveSection):
411409
description="""
412410
Value of the (intraorbital) Hubbard interaction
413411
""",
414-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
415412
)
416413

417414
j_hunds_coupling = Quantity(
@@ -420,7 +417,6 @@ class HubbardInteractions(ArchiveSection):
420417
description="""
421418
Value of the (interorbital) Hund's coupling.
422419
""",
423-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
424420
)
425421

426422
u_interorbital_interaction = Quantity(
@@ -430,7 +426,6 @@ class HubbardInteractions(ArchiveSection):
430426
Value of the (interorbital) Coulomb interaction. In rotational invariant systems,
431427
u_interorbital_interaction = u_interaction - 2 * j_hunds_coupling.
432428
""",
433-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
434429
)
435430

436431
j_local_exchange_interaction = Quantity(
@@ -439,7 +434,6 @@ class HubbardInteractions(ArchiveSection):
439434
description="""
440435
Value of the exchange interaction. In rotational invariant systems, j_local_exchange_interaction = j_hunds_coupling.
441436
""",
442-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
443437
)
444438

445439
u_effective = Quantity(
@@ -474,7 +468,6 @@ class HubbardInteractions(ArchiveSection):
474468
description="""
475469
Name of the double counting correction algorithm applied.
476470
""",
477-
a_eln=ELNAnnotation(component='StringEditQuantity'),
478471
)
479472

480473
def resolve_u_interactions(self, logger: 'BoundLogger') -> Optional[tuple]:
@@ -586,7 +579,6 @@ class AtomsState(Entity):
586579
Note: for `CoreHole` systems we do not consider the charge of the atom even if
587580
we do not store the final `OrbitalsState` where the electron was excited to.
588581
""",
589-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
590582
)
591583

592584
core_hole = SubSection(sub_section=CoreHole.m_def, repeats=False)

src/nomad_simulations/schema_packages/basis_set.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import pint
1313
from nomad import utils
1414
from nomad.datamodel.data import ArchiveSection
15-
from nomad.datamodel.metainfo.annotations import ELNAnnotation
1615
from nomad.metainfo import MEnum, Quantity, SubSection
1716
from nomad.units import ureg
1817

@@ -57,7 +56,6 @@ class BasisSetComponent(ArchiveSection):
5756
description="""
5857
Reference to the section `AtomsState` specifying the localization of the basis set.
5958
""",
60-
a_eln=ELNAnnotation(components='ReferenceEditQuantity'),
6159
)
6260

6361
# TODO: add atom index-based instantiator for species if not present
@@ -69,7 +67,6 @@ class BasisSetComponent(ArchiveSection):
6967
Reference to the section `BaseModelMethod` containing the information
7068
of the Hamiltonian term to which the basis set applies.
7169
""",
72-
a_eln=ELNAnnotation(components='ReferenceEditQuantity'),
7370
)
7471

7572
# ? band_scope or orbital_scope: valence vs core
@@ -204,12 +201,6 @@ class AtomCenteredBasisSet(BasisSetComponent):
204201
sub_section=AtomCenteredFunction.m_def, repeats=True
205202
) # TODO change name
206203

207-
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
208-
super().normalize(archive, logger)
209-
# self.name = self.m_def.name
210-
# TODO: set name based on basis functions
211-
# ? use basis set names from Basis Set Exchange
212-
213204

214205
class APWBaseOrbital(ArchiveSection):
215206
"""

src/nomad_simulations/schema_packages/general.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import numpy as np
1010
from nomad.config import config
1111
from nomad.datamodel.data import Schema
12-
from nomad.datamodel.metainfo.annotations import ELNAnnotation
1312
from nomad.datamodel.metainfo.basesections import Activity, Entity
1413
from nomad.metainfo import Datetime, Quantity, SchemaPackage, Section, SubSection
1514

@@ -70,23 +69,20 @@ class Program(Entity):
7069
description="""
7170
The name of the program.
7271
""",
73-
a_eln=ELNAnnotation(component='StringEditQuantity'),
7472
)
7573

7674
version = Quantity(
7775
type=str,
7876
description="""
7977
The version label of the program.
8078
""",
81-
a_eln=ELNAnnotation(component='StringEditQuantity'),
8279
)
8380

8481
link = Quantity(
8582
type=str,
8683
description="""
8784
Website link to the program in published information.
8885
""",
89-
a_eln=ELNAnnotation(component='URLEditQuantity'),
9086
)
9187

9288
version_internal = Quantity(
@@ -95,7 +91,6 @@ class Program(Entity):
9591
Specifies a program version tag used internally for development purposes.
9692
Any kind of tagging system is supported, including git commit hashes.
9793
""",
98-
a_eln=ELNAnnotation(component='StringEditQuantity'),
9994
)
10095

10196
subroutine_name_internal = Quantity(
@@ -106,20 +101,15 @@ class Program(Entity):
106101
so the naming is representative. This naming is mostly meant for users
107102
who are familiar with the program's structure.
108103
""",
109-
a_eln=ELNAnnotation(component='StringEditQuantity'),
110104
)
111105

112106
compilation_host = Quantity(
113107
type=str,
114108
description="""
115109
Specifies the host on which the program was compiled.
116110
""",
117-
a_eln=ELNAnnotation(component='StringEditQuantity'),
118111
)
119112

120-
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
121-
pass
122-
123113

124114
class BaseSimulation(Activity):
125115
"""
@@ -140,7 +130,6 @@ class BaseSimulation(Activity):
140130
description="""
141131
The date and time when this computation ended.
142132
""",
143-
a_eln=ELNAnnotation(component='DateTimeEditQuantity'),
144133
)
145134

146135
cpu1_start = Quantity(
@@ -149,7 +138,6 @@ class BaseSimulation(Activity):
149138
description="""
150139
The starting time of the computation on the (first) CPU 1.
151140
""",
152-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
153141
)
154142

155143
cpu1_end = Quantity(
@@ -158,7 +146,6 @@ class BaseSimulation(Activity):
158146
description="""
159147
The end time of the computation on the (first) CPU 1.
160148
""",
161-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
162149
)
163150

164151
wall_start = Quantity(
@@ -167,7 +154,6 @@ class BaseSimulation(Activity):
167154
description="""
168155
The internal wall-clock time from the starting of the computation.
169156
""",
170-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
171157
)
172158

173159
wall_end = Quantity(
@@ -176,14 +162,10 @@ class BaseSimulation(Activity):
176162
description="""
177163
The internal wall-clock time from the end of the computation.
178164
""",
179-
a_eln=ELNAnnotation(component='NumberEditQuantity'),
180165
)
181166

182167
program = SubSection(sub_section=Program.m_def, repeats=False)
183168

184-
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
185-
pass
186-
187169

188170
class Simulation(BaseSimulation, Schema):
189171
"""

0 commit comments

Comments
 (0)