geost.bro.regis.RegisUnits.select_unit_contains#

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

Select metadata by a substring for a partial unit code or codes.

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

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

Returns:

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

Return type:

~geost.bro.regis.RegisUnits

Raises:

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

Examples

Select units from REGIS II that contain a specific substring:

>>> regis_meta = geost.bro.regis_units()
>>> selected_meta = regis_meta.select_unit_contains("NUBX") # Select a single substring
>>> selected_meta = regis_meta.select_unit_contains(["NUBX", "NUOO"]) # Select multiple substrings