Skip to content

Commit

Permalink
Add entry point for HubbardStructureData
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed Oct 20, 2022
1 parent d1e2808 commit ed2b1d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ aiida-quantumespresso = 'aiida_quantumespresso.cli:cmd_root'

[project.entry-points.'aiida.data']
'quantumespresso.force_constants' = 'aiida_quantumespresso.data.force_constants:ForceConstantsData'
'quantumespresso.hubbard_structure' = 'aiida_quantumespresso.data.hubbard_structure:HubbardStructureData'

[project.entry-points.'aiida.parsers']
'quantumespresso.cp' = 'aiida_quantumespresso.parsers.cp:CpParser'
Expand Down
7 changes: 7 additions & 0 deletions src/aiida_quantumespresso/calculations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from qe_tools.converters import get_parameters_from_cell

from aiida_quantumespresso.utils.convert import convert_input_to_namelist_entry
from aiida_quantumespresso.data.hubbard_structure import HubbardStructureData

from .base import CalcJob
from .helpers import QEInputValidationError
Expand Down Expand Up @@ -680,6 +681,10 @@ def _generate_PWCPinputdata(cls, parameters, settings, pseudos, structure, kpoin
kpoints_card = ''.join(kpoints_card_list)
del kpoints_card_list

# HUBBARD CARD
hubbard_card = structure.get_quantum_espresso_hubbard_card() if isinstance(structure, HubbardStructureData) \
else None

# =================== NAMELISTS AND CARDS ========================
try:
namelists_toprint = settings.pop('NAMELISTS')
Expand Down Expand Up @@ -723,6 +728,8 @@ def _generate_PWCPinputdata(cls, parameters, settings, pseudos, structure, kpoin
if cls._use_kpoints:
inputfile += kpoints_card
inputfile += cell_parameters_card
if hubbard_card is not None:
inputfile += hubbard_card

# Generate additional cards bases on input parameters and settings that are subclass specific
tail = cls._generate_PWCP_input_tail(input_params=input_params, settings=settings)
Expand Down

0 comments on commit ed2b1d4

Please sign in to comment.