From 222f06b88ba4b5a5c2eaa9247b8a7fc289bf724e Mon Sep 17 00:00:00 2001 From: javoha Date: Fri, 15 Mar 2019 14:56:34 +0100 Subject: [PATCH] - fix for fault declaration --- gempy/data_management.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gempy/data_management.py b/gempy/data_management.py index 77ac4c083..61971bb1c 100644 --- a/gempy/data_management.py +++ b/gempy/data_management.py @@ -992,22 +992,21 @@ def set_faults(self, series_name=None): try: # Check if there is already a df self.faults - - try: - if any(self.faults.columns != self.series.columns): + if series_name: + self.faults['isFault'] = self.faults.index.isin(series_name) + else: + try: + if any(self.faults.columns != self.series.columns): + series_name = self.count_faults() + self.faults = pn.DataFrame(index=self.series.columns, columns=['isFault']) + self.faults['isFault'] = self.faults.index.isin(series_name) + except ValueError: series_name = self.count_faults() self.faults = pn.DataFrame(index=self.series.columns, columns=['isFault']) self.faults['isFault'] = self.faults.index.isin(series_name) - except ValueError: - series_name = self.count_faults() - self.faults = pn.DataFrame(index=self.series.columns, columns=['isFault']) - self.faults['isFault'] = self.faults.index.isin(series_name) - - if series_name: - self.faults['isFault'] = self.faults.index.isin(series_name) except AttributeError: - + print("creating fautls") if not series_name: series_name = self.count_faults() self.faults = pn.DataFrame(index=self.series.columns, columns=['isFault'])