Skip to content

Commit

Permalink
assign JSON format to basis set
Browse files Browse the repository at this point in the history
  • Loading branch information
EBB2675 committed Oct 2, 2024
1 parent a325753 commit 8866ab7
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions src/nomad_simulations/schema_packages/basis_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from nomad import utils
from nomad.datamodel.data import ArchiveSection
from nomad.datamodel.metainfo.annotations import ELNAnnotation
from nomad.metainfo import MEnum, Quantity, SubSection
from nomad.metainfo import MEnum, Quantity, SubSection, JSON
from nomad.units import ureg

from nomad_simulations.schema_packages.atoms_state import AtomsState
Expand Down Expand Up @@ -191,7 +191,7 @@ class AtomCenteredFunction(ArchiveSection):
"""

function_type = Quantity(
type=MEnum('S', 'P', 'D', 'F', 'G', 'H', 'I', 'J'),
type=MEnum('s', 'p', 'd', 'f', 'g', 'h', 'i', 'j'),
description="""
the angular momentum of the shell to be added.
""",
Expand Down Expand Up @@ -224,7 +224,47 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)
# self.name = self.m_def.name

class AtomCenteredBasisSet(BasisSetComponent):
"""
Defines an atom-centered basis set, using a single JSON quantity for all basis set types,
while allowing different AtomState references for each basis set type.
"""

basis_set_data = Quantity(
type=JSON, # Use JSON to store basis set information, including atom references

This comment has been minimized.

Copy link
@JFRudzinski

JFRudzinski Oct 4, 2024

Collaborator

Not sure if this is what you are currently thinking, since I don't see it in #132, but just in case:

I know that I am the one who suggested this as a possibility, but as I see how you structured the entries here, I would instead use a repeating subsection with corresponding quantities.

The JSON type I would use if e.g., you read in a whole bunch of input parameters but didn't want to take the time to structure them uniformly.

I can go into more detail if it's relevant, just let me know

description="""
JSON object containing all the basis set information along with atom references. Example:
{
"main_basis_set": {
"name": "cc-pVTZ",
"atoms_ref": [ref_to_atoms_1, ref_to_atoms_2]
},
"aux_c_basis_set": {
"name": "cc-pVTZ/C",
"atoms_ref": [ref_to_atoms_3]
},
"aux_j_basis_set": {
"name": "RIJ",
"atoms_ref": [ref_to_atoms_4]
},
"aux_jk_basis_set": {
"name": "aug-cc-pVTZ/JK",
"atoms_ref": [ref_to_atoms_1, ref_to_atoms_5]
}
}
""",
)

functional_composition = SubSection(
sub_section=AtomCenteredFunction.m_def, repeats=True
)

def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)



'''
class AtomCenteredBasisSet(BasisSetComponent):
"""
Defines an atom-centered basis set.
Expand Down Expand Up @@ -275,7 +315,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
# self.name = self.m_def.name
# TODO: set name based on basis functions
# ? use basis set names from Basis Set Exchange

'''

class APWBaseOrbital(ArchiveSection):
"""
Expand Down

1 comment on commit 8866ab7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/nomad_simulations
   __init__.py4250%3–4
   _version.py11282%5–6
src/nomad_simulations/schema_packages
   __init__.py15287%39–41
   atoms_state.py1902189%13–15, 201–204, 228, 283–284, 352–353, 355, 537, 549–550, 611–615, 630–634, 641
   basis_set.py2472988%8–9, 122–133, 172–185, 224, 263, 497–501, 523–524, 568–571, 690, 721, 723
   general.py89891%4–7, 121, 185, 295–296, 306
   model_method.py2697871%10–12, 171–174, 177–184, 276–277, 297, 318–339, 355–381, 384–401, 587, 780, 791, 833–840, 878, 897, 977, 1034, 1109, 1223
   model_system.py3172592%25–27, 378, 410–411, 621–624, 671–678, 852–853, 1074–1078, 1084–1085, 1093–1094, 1099, 1122
   numerical_settings.py2596176%12–14, 217, 219–220, 223–226, 230–231, 238–241, 250–253, 257–260, 262–265, 270–273, 279–282, 469–496, 571, 606–609, 633, 636, 681, 683–686, 690, 694, 741, 745–766, 821–822, 889
   outputs.py1201092%9–10, 252–255, 295–298, 323, 325, 362, 381
   physical_property.py102793%20–22, 202, 331–333
   variables.py861286%8–10, 98, 121, 145, 167, 189, 211, 233, 256, 276
src/nomad_simulations/schema_packages/properties
   band_gap.py51590%8–10, 135–136
   band_structure.py1232580%9–11, 232–265, 278, 285, 321–322, 325, 372–373, 378
   energies.py42979%7–9, 36, 57, 82, 103, 119, 134
   fermi_surface.py17476%7–9, 40
   forces.py22673%7–9, 36, 56, 79
   greens_function.py991387%7–9, 210–211, 214, 235–236, 239, 260–261, 264, 400
   hopping_matrix.py29583%7–9, 58, 94
   permittivity.py48883%7–9, 97–105
   spectral_profile.py26012851%9–11, 57–60, 95–98, 199–300, 356–368, 393–396, 416, 421–424, 466–502, 526, 573–576, 592–593, 598–604
   thermodynamics.py752764%7–9, 35, 56, 72, 81, 90, 101, 110, 137, 147, 157, 172–174, 177, 193, 213–215, 218, 234, 254–256, 259
src/nomad_simulations/schema_packages/utils
   utils.py701480%8–11, 65–74, 83–84, 89, 92
TOTAL255650180% 

Tests Skipped Failures Errors Time
409 0 💤 0 ❌ 0 🔥 5.844s ⏱️

Please sign in to comment.