fix: online changes same sample name
This commit is contained in:
@@ -27,8 +27,8 @@ class ScanItem:
|
||||
)
|
||||
)
|
||||
|
||||
if interval_x < 1 or interval_y < 1:
|
||||
raise ValueError("Bugger off...")
|
||||
# if interval_x < 1 or interval_y < 1:
|
||||
# raise ValueError("Bugger off...")
|
||||
|
||||
base_scan_params = {
|
||||
"start_x": float(self.entry["X [start]"]) + self.offset_xy()[0],
|
||||
@@ -68,6 +68,7 @@ class SAXSParams:
|
||||
def __init__(self, offset: Callable):
|
||||
self.offset_xy = offset
|
||||
self.data = defaultdict(lambda: ScanItem(offset))
|
||||
self.global_suffix = 0
|
||||
|
||||
def load_from_csv(self, file_path: str) -> None:
|
||||
"""
|
||||
@@ -82,7 +83,11 @@ class SAXSParams:
|
||||
with open(os.path.expanduser(file_path), "r") as file:
|
||||
csv_reader = csv.DictReader(file)
|
||||
for row in csv_reader:
|
||||
self.data[row["sample name"]].entry = row
|
||||
if self.data.get(row["sample name"], None) is None:
|
||||
self.data[row["sample name"]].entry = row
|
||||
else:
|
||||
self.data[f'{row["sample name"]}_{self.global_suffix}'].entry = row
|
||||
self.global_suffix += 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user