VEProfile

class iesve.VEProfile

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

  • Weekly profile
    • a list of daily profile IDs (strings) that make up the weekly profile.

  • Yearly 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)

  • Compact profile
    • a list of time periods.

    • Each time period is defined as:

    • [ [toDay, toMonth], entry, entry, entry ]

    • Where an entry consists of the following list items:
      • [ 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)

  • Free form profile
    • 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


get_data() list

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

  • Free form profilelist 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


is_absolute() bool


is_group() bool

True if the profile is a group profile (weekly, yearly, compact or free-form), False if a daily profile.


is_modulating() bool


set_data(data: list) bool

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.

  • Daily Profile:
    • Data is represented as a list of [x,y,formula] lists

    • [ [x,y,formula], [x,y,formula], … ]

  • Weekly Profile:
    • Data is represented as a list of daily profile IDs

    • [ ID1, ID2, … ]

  • Yearly Profile:
    • Data is represented as a list of [weekly profile ID(string), fromDay(int), toDay(int)] lists

    • [ [ID1, from1, to1], [ID2, from2, to2], … ]

  • Compact Profile:
    • Data is represented as a list of lists that contains compact profile data:

    • The outer list is for the number of time periods

    • Each time period is represented by a list of lists:
      • [ [toDay, toMonth], [entry], [entry], [entry], … ]

      • Where an entry list is:
        • [description, firstTime, secondTime]
          • Description: “Label: DaysOfWeek” (eg. “Weekends: Sat, Sun”)

          • firstTime and secondTime are:
            • [True, startHour, startMinute, endHour, endMinute]
              • StartHour, startMinute: 0-24, 0-59 for the start time

              • EndHour, endMinute: 0-24, 0-59 for the end time

            • OR:
              • [False, 0, 0] if time is not active

  • Free-form Profile:
    • 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, day, hour, minute, value],…]
      • month: 1-12

      • day: 1-31

      • hour: 0-23

      • minute: 0-59


id: str

Profile ID


reference: str

Profile reference (name)



class iesve.DailyProfile

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


add_category(category: profile_category) None

Adds the given category (profile_category enum) to the profile.


clear_category(category: profile_category) None

Removes the given category (profile_category enum) from the profile


get_categories() list[profile_category]

Gets all the categories assigned to the profile.


has_category(category: profile_category) bool

Checks whether the category is assigned to the profile.


is_supported_category(category: profile_category) bool

Checks whether the category is supported by the profile


set_categories(categories: list[profile_category]) None

Replaces the categories assigned to the profile with the given list.



class iesve.GroupProfile

Bases: VEProfile

See base class for description of data


add_category(category: profile_category) None

Adds the given category (profile_category enum) to the profile.


clear_category(category: profile_category) None

Removes the given category (profile_category enum) from the profile.


get_categories() list[profile_category]

Gets all the categories assigned to the profile.


has_category(category: profile_category) bool

Checks whether the category is assigned to the profile


is_compact() bool

True if the profile is a compact profile, else False.


is_freeform() bool

True if the profile is a free form profile, else False


is_supported_category(category: profile_category) bool

“Checks whether the category is supported by the profile.


is_weekly() bool

True if the profile is a weekly profile, else False


is_yearly() bool

True if the profile is a yearly (annual) profile, else False.


set_categories(categories: list[profile_category]) None

Replaces the categories assigned to the profile with the given list.



class iesve.CompactProfile

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 ]

  • Where an entry consists of the following list items:
    • [ 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)


num_periods: int

(int) Number of periods in profile



class iesve.FreeFormProfile

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.


is_graphable() bool

True if the free form data was loaded successfully and contains no error. False otherwise


load_data(hide_ui: bool = True) None

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_data(hide_ui: bool = True) None

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.



Enums

class iesve.profile_category(*values)

Bases: IntEnum


cooling = 1024


daylighting = 64


emissions_factors = 16384


equipment = 128


ev_charging = 32768


heating = 512


hvac = 8


hvac_linked = 8192


lighting = 4


misc = 16


none = 0


occupancy = 2


plant = 2048


solar = 256


ventilation = 32


water = 4096