Skip to content

from_processor crashes: set_stratigraphic_column raises DeprecationWarning unconditionally #296

Description

@manduinca

Version: master (1.7.1), Python 3.12

GeologicalModel.from_processor ends by assigning the processor's column to the model:

# LoopStructural/modelling/core/geological_model.py:495
model.stratigraphic_column = processor.stratigraphic_column

The setter routes dicts to set_stratigraphic_column, which raises unconditionally:

# LoopStructural/modelling/core/geological_model.py:837
raise DeprecationWarning(
    "set_stratigraphic_column is deprecated, use model.stratigraphic_column.add_units instead"
)

So every processor path (ProcessInputData, Map2LoopProcessor, LoopProjectfileProcessor) crashes, including the bundled example examples/4_advanced/plot_1_model_from_geological_map.py. The dict-to-column conversion code after the raise is unreachable, and the column is cleared before raising.

Reproducer

from LoopStructural import GeologicalModel
from LoopStructural.datasets import load_geological_map_data
from LoopStructural.modelling import ProcessInputData

(contacts, orientations, thickness, order_df, bbox, *_rest) = load_geological_map_data()

processor = ProcessInputData(
    contacts=contacts,
    contact_orientations=orientations.rename({"formation": "name"}, axis=1),
    thicknesses=dict(zip(thickness["name"], thickness["thickness"])),
    stratigraphic_order=[("supergroup_0", list(order_df["unit name"]))],
    origin=bbox.loc["origin"].to_numpy(),
    maximum=bbox.loc["maximum"].to_numpy(),
)
model = GeologicalModel.from_processor(processor)
DeprecationWarning: set_stratigraphic_column is deprecated, use model.stratigraphic_column.add_units instead

I have a small fix ready: turn the raise into warnings.warn so the conversion code below it runs again, plus a regression test. PR incoming. Happy to rework it if you would rather port from_processor to the new add_units API directly.

Activity

  1. lachlangrose commented on Aug 5, 2026

    @lachlangrose
    Member

    @manduinca I will probably refactor the processor workflow, happy for you to make a pr for the small fix but it will likely be replaced in the near future.

  2. manduinca commented on Sep 2, 2026

    @manduinca
    ContributorAuthor

    This is fixed on master since #300: set_stratigraphic_column now warns instead of raising and from_processor completes. #297 is now just a regression test for this path. I think this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions