ladybug.projectinfo module

Complete set of Project Information including location, orientation and weather.

class ladybug.projectinfo.ProjectInfo(north=0, weather_urls=None, location=None, ashrae_climate_zone=None, building_type=None, vintage=None)[source]

Bases: object

Complete set of Project Information including location, orientation and weather.

Parameters:
  • north – North angle in degrees. A number between -360 to 360 where positive values rotate the compass counterclockwise (towards the West) and negative values rotate the compass clockwise (towards the East). (Default: 0).

  • weather_urls – A list of URLs to zip files that includes EPW, DDY and STAT files. Such URLs can be found on EPWmap. The first URL in this list is used as the primary default weather file.

  • location – A Ladybug Location object for the exact latitude and longitude coordinates of the project. If unset and at least one URL has been specified from the weather_urls, the location will default to the information within the EPW file.

  • ashrae_climate_zone – Text indicating the ASHRAE climate zone. This input can be a single integer (in which case it is interpreted as A) or it can include the A, B, or C qualifier (eg. 3C). If unset and at least one URL has been specified from the weather_urls, the ashrae_climate_zone will default to the information within the STAT file if it exists.

  • building_type –

    A list of text for the building types contained within the project. The first building type is considered the primary type for the project. The following text values can be included.

    • NonResidential

    • Residential

    • MidriseApartment

    • HighriseApartment

    • LargeOffice

    • MediumOffice

    • SmallOffice

    • Retail

    • StripMall

    • PrimarySchool

    • SecondarySchool

    • SmallHotel

    • LargeHotel

    • Hospital

    • Outpatient

    • Warehouse

    • SuperMarket

    • FullServiceRestaurant

    • QuickServiceRestaurant

    • Laboratory

    • Courthouse

    • College

  • vintage –

    A list of text for the building vintages contained within the project. The following text values can be included.

    • DOE_Ref_Pre_1980

    • DOE_Ref_1980_2004

    • ASHRAE_2004

    • ASHRAE_2007

    • ASHRAE_2010

    • ASHRAE_2013

    • ASHRAE_2016

    • ASHRAE_2019

Properties:
  • north

  • north_angle

  • north_vector

  • weather_urls

  • location

  • default_epw_file

  • default_stat_file

  • default_ddy_file

  • default_design_days

  • ashrae_climate_zone

  • building_type

  • gbxml_building_type

  • vintage

ToString()[source]

Overwrite .NET ToString.

assign_attributes_from_weather()[source]

Hard-assign properties on this object from properties in the weather file.

static download_weather(weather_url, folder=None)[source]

Download and extract EPW and other files from a weather URL.

If the weather files are already found to exist on the machine, these will be returned instead of re-downloading them.

Parameters:
  • weather_url – Text representing the URL at which the climate data resides. To open the a map interface for all publicly available climate data, search the EPWmap application.

  • folder – An optional path to a directory into which the weather file will be downloaded and unzipped. If None, the weather files will be downloaded to the ladybug default weather data folder and placed in a sub-folder with the name of the weather file location.

Returns:

A tuple with three elements.

  • epw_file: The file path of the downloaded epw file.

  • stat_file: The file path of the downloaded stat file or None if stat file is included.

  • ddy_file: The file path of the downloaded ddy file or None if stat file is included.

duplicate()[source]

Get a copy of this object.

classmethod from_dict(data)[source]

Create a ProjectInfo object from a dictionary.

Parameters:

data – A ProjectInfo dictionary in following the format.

{
"type": "ProjectInfo",
"north": 15,  # project angle from true north
"weather_urls": [],  # Array of URLs pointing to weather files
"location": {},  # Ladybug Location object dictionary
"ashrae_climate_zone": "5A",  # climate zone
"building_type": ["LargeOffice"],  # array of uses within the building
"vintage": ["ASHRAE_2004"],  # array of vintages in the building
}
classmethod from_json(json_file)[source]

Initialize a Model from a JSON file.

Parameters:

json_file – Path to JSON file containing a ProjectInfo object.

to_dict()[source]

ProjectInfo dictionary representation.

to_json(name=None, folder=None, indent=None)[source]

Write ProjectInfo object to JSON.

Parameters:
  • name – A text string for the name of the JSON file. If None, the location name will be used and if no location is assigned, a unique ID will be generated. (Default: None).

  • folder – A text string for the directory where the JSON will be written. If unspecified, the default EPW folder will be used. This is usually at “%APPDATA%ladybug_toolsweather.”

  • indent – A positive integer to set the indentation used in the resulting JSON file. (Default: None).

BUILDING_TYPES = {'College': 'SchoolOrUniversity', 'Courthouse': 'Courthouse', 'FullServiceRestaurant': 'DiningFamily', 'HighriseApartment': 'MultiFamily', 'Hospital': 'HospitalOrHealthcare', 'Laboratory': 'Unknown', 'LargeDataCenterHighITE': 'DataCenter', 'LargeDataCenterLowITE': 'DataCenter', 'LargeHotel': 'Hotel', 'LargeOffice': 'Office', 'MediumOffice': 'Office', 'MidriseApartment': 'MultiFamily', 'NonResidential': 'Unknown', 'Outpatient': 'HospitalOrHealthcare', 'PrimarySchool': 'SchoolOrUniversity', 'QuickServiceRestaurant': 'DiningCafeteriaFastFood', 'Residential': 'SingleFamily', 'Retail': 'Retail', 'SecondarySchool': 'SchoolOrUniversity', 'SmallDataCenterHighITE': 'DataCenter', 'SmallDataCenterLowITE': 'DataCenter', 'SmallHotel': 'Motel', 'SmallOffice': 'Office', 'StripMall': 'Retail', 'SuperMarket': 'Retail', 'Warehouse': 'Warehouse'}
CLIMATE_ZONES = ('0A', '1A', '2A', '3A', '4A', '5A', '6A', '0B', '1B', '2B', '3B', '4B', '5B', '6B', '3C', '4C', '5C', '7', '8')
VINTAGES = ('DOE_Ref_Pre_1980', 'DOE_Ref_1980_2004', 'ASHRAE_2004', 'ASHRAE_2007', 'ASHRAE_2010', 'ASHRAE_2013', 'ASHRAE_2016', 'ASHRAE_2019')
property ashrae_climate_zone

Get or set text for the climate zone in which the project is located.

This input can be a single integer (in which case it is interpreted as A) or it can include the A, B, or C qualifier (eg. 3C). This property defaults to the climate zone listed in the STAT or EPW weather file if not explicitly specified.

property building_type

Get or set a list of text for the uses of the building.

Choose from the following.

  • NonResidential

  • Residential

  • MidriseApartment

  • HighriseApartment

  • LargeOffice

  • MediumOffice

  • SmallOffice

  • Retail

  • StripMall

  • PrimarySchool

  • SecondarySchool

  • SmallHotel

  • LargeHotel

  • Hospital

  • Outpatient

  • Warehouse

  • SuperMarket

  • FullServiceRestaurant

  • QuickServiceRestaurant

  • Laboratory

  • Courthouse

  • College

property default_ddy_file

Get the default DDY file for the project if weather_urls are specified.

property default_design_days

Get the default design days for the project if weather_urls are specified.

property default_epw_file

Get the default EPW file for the project if weather_urls are specified.

property default_stat_file

Get the default STAT file for the project if weather_urls are specified.

property gbxml_building_type

Get text for the type of building as it might appear in gbXML.

property location

Get or set a Location object for the location of the project.

This property defaults to the location of the first weather file if not explicitly specified.

property north

Get or set a number between -360 and 360 for the north direction in degrees.

This is the counterclockwise difference between the North and the positive Y-axis. A value of 90 will rotate the compass West and -90 will rotate it East.

property north_angle

Get or set a number between -360 and 360 for the north direction in degrees.

This is the counterclockwise difference between the North and the positive Y-axis. A value of 90 will rotate the compass West and -90 will rotate it East.

property north_vector

Get or set a ladybug_geometry Vector2D for the north direction.

property vintage

Get or set a list of text for the vintages that appear within the building.

Choose from the following.

  • DOE_Ref_Pre_1980

  • DOE_Ref_1980_2004

  • ASHRAE_2004

  • ASHRAE_2007

  • ASHRAE_2010

  • ASHRAE_2013

  • ASHRAE_2016

  • ASHRAE_2019

property weather_urls

Get or set an array of Weather URLs for the weather files of the project.