geost.bro.geotop.GeotopUnits.select_description_contains#

GeotopUnits.select_description_contains(substring: str | list[str], case_sensitive: bool = False) → GeotopUnits[source]#

Select metadata by a substring for a partial description or descriptions.

Parameters:
  • substring (str | list[str]) – Substring or list of substrings to match within the descriptions.

  • case_sensitive (bool, optional) – Whether the match should be case-sensitive, by default False.

Returns:

class – GeotopUnits instance containing the metadata subset for the selected units.

Return type:

~geost.bro.geotop.GeotopUnits

Raises:

MissingUnitError – Raised if none of the specified substrings are present in the metadata.

Examples

Select units from the stratigraphic metadata of GeoTOP that contain a specific substring:

>>> gtp_meta_strat = geost.bro.get_geotop_metadata_strat()
>>> selected_meta = gtp_meta_strat.select_description_contains("Formatie van Naaldwijk") # Select a single substring
>>> selected_meta = gtp_meta_strat.select_description_contains(
...     ["Formatie van Naaldwijk", "Formatie van Nieuwkoop"]
... ) # Select multiple substrings