Results
- class iesopt.Results(*, file: str = None, model=None)[source]
- entries(field: str = None)[source]
Get all available entries for a specific field, or all fields if field is None.
- Parameters:
field – Optional[str] Field to get entries for, by default None which returns all fields
- query_available_results(component: str, mode: str = 'both')[source]
Query the available results for a specific component, optionally filtered by mode.
- Parameters:
component – str Component to query results for
mode – Optional[str] Mode to query results for, either “both”, “primal”, or “dual”, by default “both”
- to_dict(filter=None, field_types=None, build_cache: bool = True) dict [source]
Extract results from the Results object and return them as a dictionary.
- Parameters:
filter – Optional[Callable] Filter function to apply to the results, by default None, must take three arguments: (c, t, f) where c is the component’s name, t is the field type (“var”, “exp”, “con”, or “obj”), and f is the field name.
field_types – Optional[list[str]] Field types to extract, by default None, which extracts all field types.
build_cache – Optional[bool] Whether to build a cache of the results, by default True.
- Returns:
Dictionary of results, with keys as tuples of (component, fieldtype, field) and values as the result.
- to_pandas(filter=None, field_types=None, orientation: str = 'long', build_cache: bool = True)[source]
Extract results from the Results object and return them as
pandas.DataFrame
orpandas.Series
(depending on the shape of the included results).- Parameters:
filter – Optional[Callable] Filter function to apply to the results, by default None, must take three arguments: (c, t, f) where c is the component’s name, t is the field type (“var”, “exp”, “con”, or “obj”), and f is the field name
field_types – Optional[list[str]] Field types to extract, by default None, which extracts all field types
orientation – Optional[str] Orientation of the resulting DataFrame, either “wide” or “long”, by default “long”
build_cache – Optional[bool] Whether to build a cache of the results, by default True.
- Returns:
DataFrame or Series of results, depending on the orientation and shape of the results.