Coverage for fiqus/parsers/ParserDAT.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2024-05-20 03:24 +0200

1import pandas as pd 

2 

3 

4class ParserDAT: 

5 

6 def __init__(self, dat_file_path): 

7 """ 

8 Read dat file and returns its content as object attribute .pqv (postprocessed quantity value) that is a float 

9 :param dat_file_path: Full path to .pos file, including file name and extension. 

10 :return: nothing, keeps attribute pqv (postprocessed quantity value) 

11 """ 

12 pqn = 'pqn' # postprocessed quantity name 

13 delimiter = ' ' 

14 columns = ['NaN', pqn] 

15 df = pd.read_csv(dat_file_path, delimiter=delimiter, header=None, engine='python', names=columns, skipinitialspace=True) 

16 self.pqv = float(df[pqn][0])