sailor.assetcentral.functional_location
Retrieve Functional Location information from AssetCentral.
Classes are provided for individual Functional Locations as well as groups of Functional Locations (FunctionalLocationSet).
- class sailor.assetcentral.functional_location.FunctionalLocation(ac_json)[source]
Bases:
AssetcentralEntity
AssetCentral Functional Location Object.
- Parameters
ac_json (dict) –
- classmethod get_available_properties()
Return the available properties for this class.
- property id
Return the ID of the object.
- class sailor.assetcentral.functional_location.FunctionalLocationSet(elements)[source]
Bases:
AssetcentralEntitySet
Class representing a group of Functional Locations.
- as_df(columns=None)
Return all information on the objects stored in the MasterDataEntitySet as a pandas dataframe.
columns
can be specified to select the columns (and their order) for the DataFrame.- Parameters
columns (Optional[Iterable[str]]) –
- filter(**kwargs)
Select a subset of the collection based on named filter criteria for the attributes of the elements.
All keyword arguments are concatenated as filters with OR operator, i.e., only one of the supplied filters must match for an entity to be selected.
Returns a new AssetcentralEntitySet object.
- Return type
MasterDataEntitySet
- plot_distribution(by=None, fill=None, dropna=False)
Plot the distribution of elements of a MasterDataEntitySet based on their properties.
This effectively creates a histogram with the number of elements per group on the y-axis, and the group (given by the by parameter) on the x-axis. Additionally, the fill colour of the bar can be used to distinguish a second dimension.
- sailor.assetcentral.functional_location.find_functional_locations(*, extended_filters=(), **kwargs)[source]
Fetch Functional Locations from AssetCentral with the applied filters, return an FunctionalLocationSet.
This method supports the common filter language explained at Filter Language.
- Parameters
extended_filters – See Filter Language.
**kwargs – See Filter Language.
- Return type
Examples
Find all Functional Locations with the name ‘MyFloc’:
find_functional_locations(name='MyFloc')
Find all Functional Locations which either have the name ‘MyFloc’ or the name ‘MyOtherFloc’:
find_functional_locations(name=['MyFloc', 'MyOtherFloc'])
Find all Functional Locations by manufacturer ‘ACME Corp’ which are operated by ‘Operator 42’:
find_functional_locations(manufacturer='ACME Corp', operator='Operator 42')