From 9bad6a7159e58675e0d62a95e52eee546054d7c6 Mon Sep 17 00:00:00 2001 From: Noelle Cheng Date: Wed, 27 Aug 2025 13:09:00 +0800 Subject: [PATCH 1/3] fix extract_basal_contacts --- map2loop/contact_extractor.py | 15 +++++++-------- map2loop/map2loop | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) create mode 120000 map2loop/map2loop diff --git a/map2loop/contact_extractor.py b/map2loop/contact_extractor.py index 776bbddf..21644d1c 100644 --- a/map2loop/contact_extractor.py +++ b/map2loop/contact_extractor.py @@ -62,19 +62,18 @@ def extract_basal_contacts(self, basal_contacts = self.contacts.copy() else: basal_contacts = self.contacts.copy() - if any(unit not in units for unit in basal_contacts["UNITNAME_1"].unique()): - missing_units = ( - basal_contacts[~basal_contacts["UNITNAME_1"].isin(units)]["UNITNAME_1"] - .unique() - .tolist() - ) + units_1 = set(basal_contacts["UNITNAME_1"]) + units_2 = set(basal_contacts["UNITNAME_2"]) + all_contact_units = units_1.union(units_2) + missing_units = [unit for unit in all_contact_units if unit not in units] + if missing_units: logger.error( - "There are units in the Geology dataset, but not in the stratigraphic column: " + "There are units in the stratigraphic column that don't appear in the contacts: " + ", ".join(missing_units) + ". Please readjust the stratigraphic column if this is a user defined column." ) raise ValueError( - "There are units in stratigraphic column, but not in the Geology dataset: " + "There are units in the stratigraphic column that don't appear in the contacts: " + ", ".join(missing_units) + ". Please readjust the stratigraphic column if this is a user defined column." ) diff --git a/map2loop/map2loop b/map2loop/map2loop new file mode 120000 index 00000000..96cf7543 --- /dev/null +++ b/map2loop/map2loop @@ -0,0 +1 @@ +/Users/noellecheng/Documents/combined/map2loop-two/map2loop \ No newline at end of file From 8db462a2f3659e63b551be570c9b8403c20a3925 Mon Sep 17 00:00:00 2001 From: Noelle Cheng Date: Wed, 27 Aug 2025 13:13:33 +0800 Subject: [PATCH 2/3] remove symb link --- map2loop/map2loop | 1 - 1 file changed, 1 deletion(-) delete mode 120000 map2loop/map2loop diff --git a/map2loop/map2loop b/map2loop/map2loop deleted file mode 120000 index 96cf7543..00000000 --- a/map2loop/map2loop +++ /dev/null @@ -1 +0,0 @@ -/Users/noellecheng/Documents/combined/map2loop-two/map2loop \ No newline at end of file From 73a23412f6b0580eee11dd6292229d950e272ab7 Mon Sep 17 00:00:00 2001 From: Noelle Cheng Date: Wed, 27 Aug 2025 13:27:40 +0800 Subject: [PATCH 3/3] change comment in extract_basal_contacts --- map2loop/contact_extractor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/map2loop/contact_extractor.py b/map2loop/contact_extractor.py index 21644d1c..0a69697e 100644 --- a/map2loop/contact_extractor.py +++ b/map2loop/contact_extractor.py @@ -68,12 +68,12 @@ def extract_basal_contacts(self, missing_units = [unit for unit in all_contact_units if unit not in units] if missing_units: logger.error( - "There are units in the stratigraphic column that don't appear in the contacts: " + "There are units in the Geology dataset, but not in the stratigraphic column: " + ", ".join(missing_units) + ". Please readjust the stratigraphic column if this is a user defined column." ) raise ValueError( - "There are units in the stratigraphic column that don't appear in the contacts: " + "There are units in the Geology dataset, but not in the stratigraphic column: " + ", ".join(missing_units) + ". Please readjust the stratigraphic column if this is a user defined column." )