Skip to content

Commit 8266dca

Browse files
committed
fix: set calculator params to correct argument names
1 parent 7f15d91 commit 8266dca

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

loopstructural/main/m2l_api.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import pandas as pd
32
from map2loop.contact_extractor import ContactExtractor
43
from map2loop.sampler import SamplerDecimator, SamplerSpacing
@@ -510,7 +509,7 @@ def calculate_thickness(
510509
if calculator_type == "InterpolatedStructure":
511510
calculator = InterpolatedStructure(
512511
bounding_box=bounding_box,
513-
dtm_data=dtm_gdal,
512+
# dtm_data=dtm_gdal,
514513
is_strike=orientation_type == 'Strike',
515514
max_line_length=max_line_length,
516515
)
@@ -519,7 +518,7 @@ def calculate_thickness(
519518
raise ValueError("max_line_length parameter is required for StructuralPoint calculator")
520519
calculator = StructuralPoint(
521520
bounding_box=bounding_box,
522-
dtm_data=dtm_gdal,
521+
# dtm_data=dtm_gdal,
523522
is_strike=orientation_type == 'Strike',
524523
max_line_length=max_line_length,
525524
)
@@ -530,12 +529,12 @@ def calculate_thickness(
530529
units_unique = units.drop_duplicates(subset=['UNITNAME']).reset_index(drop=True)
531530
units = pd.DataFrame({'name': units_unique['UNITNAME']})
532531
basal_contacts_gdf['type'] = 'BASAL' # required by calculator
533-
532+
structure_gdf['X'] = structure_gdf.geometry.x
533+
structure_gdf['Y'] = structure_gdf.geometry.y
534534
# No local export path placeholders required; export_debug_package handles exports
535535
try:
536536
if debug_manager and getattr(debug_manager, "is_debug", lambda: False)():
537537
# Export layers and pickled objects first to get their exported filenames
538-
539538
_exported = export_debug_package(
540539
debug_manager,
541540
runner_script_name="run_calculate_thickness.py",
@@ -544,17 +543,15 @@ def calculate_thickness(
544543
'units': units,
545544
'stratigraphic_order': stratigraphic_order,
546545
'basal_contacts': basal_contacts_gdf,
547-
'structure': structure_gdf,
548-
'geology': geology_gdf,
546+
'structure_data': structure_gdf,
547+
'geology_data': geology_gdf,
549548
'sampled_contacts': sampled_contacts_gdf,
550549
},
551550
)
552551

553552
except Exception as e:
554553
print("Failed to save sampler debug info")
555554
raise e
556-
structure_gdf['X'] = structure_gdf.geometry.x
557-
structure_gdf['Y'] = structure_gdf.geometry.y
558555

559556
thickness = calculator.compute(
560557
units,
@@ -573,8 +570,8 @@ def paint_stratigraphic_order(
573570
geology_layer: 'QgsVectorLayer',
574571
stratigraphic_order: list,
575572
unit_name_field: str = "UNITNAME",
576-
debug_manager = None,
577-
updater = None,
573+
debug_manager=None,
574+
updater=None,
578575
):
579576
"""Paint stratigraphic order onto geology polygons.
580577
Parameters

0 commit comments

Comments
 (0)