Bases: object
Profile manipulations. Support for Daily, Weekly, Yearly, Compact and Free-form profiles. The latter are considered group profiles and have additional API calls available.
See the Tools/plot_profiles.py sample for a detailed reference on how to read all profile types data.
See VEProject API for details on how to create new profiles
Basic usage:
project = iesve.VEProject.get_current_project()
dayprofiles, groupprofiles = project.profiles()
for id, profile in groupprofiles.items():
if profile.is_weekly():
print('Weekly profile {}, {}.'.format(id, profile.reference))
elif profile.is_yearly():
print('Yearly profile {}, {}.'.format(id, profile.reference))
Detailed Data Description
a list of daily profile IDs (strings) that make up the weekly profile.
a list of lists: [ weekly profile ID, fromDay, toDay ]
weekly profile ID: the weekly profile ID for this time period
fromDay: year day where the profile becomes active (ie day 1 to 365)
toDay = last day of profile (ie day 1 to 365)
a list of time periods.
Each time period is defined as:
[ [toDay, toMonth], entry, entry, entry ]
[ InUse, startHour, startMinute, endHour, endMinute ]
InUse: True / False Bool
StartHour, startMinute: 0-23, 0-59 for the start time (24:00 is permitted and equal to 00:00)
EndHour, endMinute: 0-23, 0-59 for the end time (24:00 is permitted and equal to 00:00)
list of lists: [ month, day, hour, minute, value ]
Note! You must call load_data() before the data is available. Failure to call load_data() will return only a dummy start/end node
Retrieve profile data. The returned data depends on profile type. All the data structures return are compatible with the corresponding set_data() method.
Daily profile: a list of [ x, y, formula ] lists that represent the data for the profile.
Weekly profile: a list of daily profile IDs that make up the weekly profile.
Yearly profile: a list of lists: [ weekly profile ID, fromDay, toDay ], where fromDay = year day where the profile becomes active, toDay = last day of profile
Compact profile: a nested sets of lists, each list representing on/off time periods
Note! You must call load_data() before the data is available. Failure to call load_data() will return only a dummy start/end node
True if the profile is a group profile (weekly, yearly, compact or free-form), False if a daily profile.
Set profile data. The data to be passed depends on profile type. You need to call save_profiles() on the originating VEProject instance to permanently save any changes.
Data is represented as a list of [x,y,formula] lists
[ [x,y,formula], [x,y,formula], … ]
Data is represented as a list of daily profile IDs
[ ID1, ID2, … ]
Data is represented as a list of [weekly profile ID(string), fromDay(int), toDay(int)] lists
[ [ID1, from1, to1], [ID2, from2, to2], … ]
Data is represented as a list of lists that contains compact profile data:
The outer list is for the number of time periods
[ [toDay, toMonth], [entry], [entry], [entry], … ]
Description: “Label: DaysOfWeek” (eg. “Weekends: Sat, Sun”)
StartHour, startMinute: 0-24, 0-59 for the start time
EndHour, endMinute: 0-24, 0-59 for the end time
[False, 0, 0] if time is not active
Set the free-form entries for this profile.
Data is a list of lists, where each list entry consists of a list containing the month, day, hour, minute and value of that entry.
Value is a double if no formula is set, and a string otherwise.
First and last entries cannot be changed.
month: 1-12
day: 1-31
hour: 0-23
minute: 0-59
Profile ID
Profile reference (name)
Bases: VEProfile
Interface for DailyProfile
a list of [ x, y, formula ] lists that represent the data for the profile.
x: time of day
y: value for time of day (0 if a formula is used)
formula: empty string if no formula is used, else the formula for that time value
Adds the given category (profile_category enum) to the profile.
Removes the given category (profile_category enum) from the profile
Gets all the categories assigned to the profile.
Checks whether the category is assigned to the profile.
Checks whether the category is supported by the profile
Replaces the categories assigned to the profile with the given list.
Bases: VEProfile
See base class for description of data
Adds the given category (profile_category enum) to the profile.
Removes the given category (profile_category enum) from the profile.
Gets all the categories assigned to the profile.
Checks whether the category is assigned to the profile
True if the profile is a compact profile, else False.
True if the profile is a free form profile, else False
“Checks whether the category is supported by the profile.
True if the profile is a weekly profile, else False
True if the profile is a yearly (annual) profile, else False.
Replaces the categories assigned to the profile with the given list.
Bases: GroupProfile
See base classes for more methods and information
a list of time periods.
Each time period is defined as:
[ [toDay, toMonth], entry, entry, entry ]
[ InUse, startHour, startMinute, endHour, endMinute ]
InUse: True / False Bool
StartHour, startMinute: 0-23, 0-59 for the start time (24:00 is permitted and equal to 00:00)
EndHour, endMinute: 0-23, 0-59 for the end time (24:00 is permitted and equal to 00:00)
(int) Number of periods in profile
Bases: GroupProfile
Interface for FreeFormProfile
See base classes for more methods and information
Note: Free form profiles require an appropriate licence to read/write. If such a licence is not available, any attempt to access free form profile data will throw an exception.
True if the free form data was loaded successfully and contains no error. False otherwise
Load the free form profile data. Note that this may take a long time. The optional Bool parameter hide_ui (default: True) can be passed as False to show a wait indicator whilst loading.
Save the free form profile data back to disk. Note that this may take a long time. The optional Bool parameter hide_ui (default: True) can be passed as False to show a wait indicator whilst loading.
Bases: IntEnum