xoa.cf.SGLocator

class xoa.cf.SGLocator(name_format=None, valid_locations=None)[source]

Staggered grid location parsing and formatting utility

Parameters
  • name_format (str) – A string containing the string patterns {root} and {loc}, which defaults to "{root}_{loc}"

  • valid_locations (list(str), None) – Valid location strings that are used when parsing

__init__(name_format=None, valid_locations=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

format_attr(attr, value, loc[, standardize])

Format a single attribute at a specified location

format_attrs(attrs[, loc, standardize])

Copy and format a dict of attributes

format_dataarray(da[, loc, standardize, …])

Format name and attributes of a copy of DataArray

get_location(da)

Parse a data array name and attributes to find location

match_attr(attr, value, root[, loc])

Check if an attribute is matching a location

merge_attr(attr, value0, value1[, loc, …])

Merge two attribute values taking care of location

parse_attr(attr, value)

Parse an attribute string to get its root and location

patch_attrs(attrs, patch[, loc, …])

Patch a dict of attribute with another dict taking care of loc

Attributes

formats

location_pattern

re_match

root_patterns

valid_attrs