Skip to content

Commit

Permalink
Replace DataANDTextParser with DataTextParser
Browse files Browse the repository at this point in the history
  • Loading branch information
ladinesa committed Nov 3, 2023
1 parent 240b292 commit f8ebad3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
7 changes: 4 additions & 3 deletions electronicparsers/edmft/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
Calculation, ScfIteration, Energy, EnergyEntry, Charges, GreensFunctions, Dos, DosValues
)
from nomad.datamodel.metainfo.simulation.workflow import SinglePoint
from nomad.parsing.file_parser import DataTextParser
from .metainfo.edmft import x_edmft_method_parameters
from ..utils import get_files, DataANDTextParser, BeyondDFTWorkflowsParser
from ..utils import get_files, BeyondDFTWorkflowsParser
from ..wien2k.parser import StructParser # Wien2k is imported to parse the system information


Expand Down Expand Up @@ -107,7 +108,7 @@ def init_quantities(self):
repeats=True)]))]


class ImpurityGfOutParser(DataANDTextParser):
class ImpurityGfOutParser(DataTextParser):
def __init__(self):
super().__init__()

Expand Down Expand Up @@ -138,7 +139,7 @@ def str_multiply_to_float(val_in):
str_operation=str_multiply_to_float)]


class MaxEntSigOutParser(DataANDTextParser):
class MaxEntSigOutParser(DataTextParser):
def __init__(self):
super().__init__()

Expand Down
2 changes: 1 addition & 1 deletion electronicparsers/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
# limitations under the License.

from .utils import (
get_files, numpy_type_to_json_serializable, BeyondDFTWorkflowsParser, DataANDTextParser
get_files, numpy_type_to_json_serializable, BeyondDFTWorkflowsParser
)
19 changes: 0 additions & 19 deletions electronicparsers/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,22 +381,3 @@ def parse_dmft_workflow(self, wannier_archive: EntryArchive, dmft_workflow_archi
workflow.m_add_sub_section(DMFT.tasks, task)

dmft_workflow_archive.workflow2 = workflow


class DataANDTextParser(TextParser): # TODO rename to 'DataTextParser' after changes are done in NOMAD
"""Parser for structured data text files with a few lines containing unstructured text.
Args:
mainfile: the file to be parsed.
"""
def __init__(self):
super().__init__()

def init_quantities(self):
self._data = None

@property
def data(self):
if self._data is None:
self._data = np.loadtxt(self.mainfile)
return self._data

0 comments on commit f8ebad3

Please sign in to comment.