Skip to content

Commit

Permalink
Revert "added commondatawriter.py & export method for CommonData pyth…
Browse files Browse the repository at this point in the history
…on objects"

This reverts commit d2d2a5c.
  • Loading branch information
FrancescoMerlotti committed Jun 18, 2024
1 parent 9efa715 commit 2ca27d5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 101 deletions.
84 changes: 0 additions & 84 deletions validphys2/src/validphys/commondatawriter.py

This file was deleted.

18 changes: 1 addition & 17 deletions validphys2/src/validphys/coredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import dataclasses
from typing import Dict

from validphys.commondatawriter import write_commondata_to_file, write_systype_to_file

import numpy as np
import pandas as pd

Expand Down Expand Up @@ -223,6 +221,7 @@ def with_cuts(self, cuts):
self, ndata=newndata, commondata_table=new_commondata_table
)


@property
def central_values(self):
return self.commondata_table["data"]
Expand Down Expand Up @@ -303,18 +302,3 @@ def with_central_value(self, cv):
tb = self.commondata_table.copy()
tb["data"] = cv
return dataclasses.replace(self, commondata_table=tb)

def export(self, path):
"""Export the data, and error types
Use the same format as libNNPDF:
- A DATA_<dataset>.dat file with the dataframe of accepted points
- A systypes/STYPES_<dataset>.dat file with the error types
"""

dat_path = path / f"DATA_{self.setname}.dat"
sys_path = path / "systypes" / f"SYSTYPE_{self.setname}_DEFAULT.dat"
sys_path.parent.mkdir(exist_ok=True)

write_systype_to_file(self, sys_path)
write_commondata_to_file(self, dat_path)

0 comments on commit 2ca27d5

Please sign in to comment.