Path

(class from pyomo.common.config)

class pyomo.common.config.Path(basePath=None, expandPath=None)[source]

Bases: object

Domain validator for a path-like object.

This will admit a path-like object and get the object’s file system representation through os.fsdecode. It will then expand any environment variables and leading usernames (e.g., “~myuser” or “~/”) appearing in either the value or the base path before concatenating the base path and value, expanding the path to an absolute path, and normalizing the path.

Parameters:
  • basePath (None, str, ConfigValue) – The base path that will be prepended to any non-absolute path values provided. If None, defaults to Path.BasePath.

  • expandPath (bool) – If True, then the value will be expanded and normalized. If False, the string representation of the value will be returned unchanged. If None, expandPath will defer to the (negated) value of Path.SuppressPathExpansion

__init__(basePath=None, expandPath=None)[source]

Methods

__init__([basePath, expandPath])

domain_name()

Attributes

BasePath

SuppressPathExpansion

Member Documentation