repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.latitude
def latitude(self, value): """Set latitude value.""" self._latitude = math.radians(float(value)) assert -self.PI / 2 <= self._latitude <= self.PI / 2, \ "latitude value should be between -90..90."
python
def latitude(self, value): """Set latitude value.""" self._latitude = math.radians(float(value)) assert -self.PI / 2 <= self._latitude <= self.PI / 2, \ "latitude value should be between -90..90."
[ "def", "latitude", "(", "self", ",", "value", ")", ":", "self", ".", "_latitude", "=", "math", ".", "radians", "(", "float", "(", "value", ")", ")", "assert", "-", "self", ".", "PI", "/", "2", "<=", "self", ".", "_latitude", "<=", "self", ".", "P...
Set latitude value.
[ "Set", "latitude", "value", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L96-L100
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.longitude
def longitude(self, value): """Set longitude value in degrees.""" self._longitude = math.radians(float(value)) # update time_zone if abs((value / 15.0) - self.time_zone) > 1: # if time_zone doesn't match the longitude update the time_zone self.time_zone = value /...
python
def longitude(self, value): """Set longitude value in degrees.""" self._longitude = math.radians(float(value)) # update time_zone if abs((value / 15.0) - self.time_zone) > 1: # if time_zone doesn't match the longitude update the time_zone self.time_zone = value /...
[ "def", "longitude", "(", "self", ",", "value", ")", ":", "self", ".", "_longitude", "=", "math", ".", "radians", "(", "float", "(", "value", ")", ")", "# update time_zone", "if", "abs", "(", "(", "value", "/", "15.0", ")", "-", "self", ".", "time_zon...
Set longitude value in degrees.
[ "Set", "longitude", "value", "in", "degrees", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L108-L115
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.is_daylight_saving_hour
def is_daylight_saving_hour(self, datetime): """Check if a datetime is a daylight saving time.""" if not self.daylight_saving_period: return False return self.daylight_saving_period.isTimeIncluded(datetime.hoy)
python
def is_daylight_saving_hour(self, datetime): """Check if a datetime is a daylight saving time.""" if not self.daylight_saving_period: return False return self.daylight_saving_period.isTimeIncluded(datetime.hoy)
[ "def", "is_daylight_saving_hour", "(", "self", ",", "datetime", ")", ":", "if", "not", "self", ".", "daylight_saving_period", ":", "return", "False", "return", "self", ".", "daylight_saving_period", ".", "isTimeIncluded", "(", "datetime", ".", "hoy", ")" ]
Check if a datetime is a daylight saving time.
[ "Check", "if", "a", "datetime", "is", "a", "daylight", "saving", "time", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L127-L131
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.calculate_sun
def calculate_sun(self, month, day, hour, is_solar_time=False): """Get Sun data for an hour of the year. Args: month: An integer between 1-12 day: An integer between 1-31 hour: A positive number between 0..23 is_solar_time: A boolean to indicate if the in...
python
def calculate_sun(self, month, day, hour, is_solar_time=False): """Get Sun data for an hour of the year. Args: month: An integer between 1-12 day: An integer between 1-31 hour: A positive number between 0..23 is_solar_time: A boolean to indicate if the in...
[ "def", "calculate_sun", "(", "self", ",", "month", ",", "day", ",", "hour", ",", "is_solar_time", "=", "False", ")", ":", "datetime", "=", "DateTime", "(", "month", ",", "day", ",", "*", "self", ".", "_calculate_hour_and_minute", "(", "hour", ")", ",", ...
Get Sun data for an hour of the year. Args: month: An integer between 1-12 day: An integer between 1-31 hour: A positive number between 0..23 is_solar_time: A boolean to indicate if the input hour is solar time. (Default: False) Returns: ...
[ "Get", "Sun", "data", "for", "an", "hour", "of", "the", "year", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L133-L148
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.calculate_sun_from_hoy
def calculate_sun_from_hoy(self, hoy, is_solar_time=False): """Get Sun data for an hour of the year. Args: datetime: Ladybug datetime is_solar_time: A boolean to indicate if the input hour is solar time (Default: False). Returns: A sun object...
python
def calculate_sun_from_hoy(self, hoy, is_solar_time=False): """Get Sun data for an hour of the year. Args: datetime: Ladybug datetime is_solar_time: A boolean to indicate if the input hour is solar time (Default: False). Returns: A sun object...
[ "def", "calculate_sun_from_hoy", "(", "self", ",", "hoy", ",", "is_solar_time", "=", "False", ")", ":", "datetime", "=", "DateTime", ".", "from_hoy", "(", "hoy", ",", "self", ".", "is_leap_year", ")", "return", "self", ".", "calculate_sun_from_date_time", "(",...
Get Sun data for an hour of the year. Args: datetime: Ladybug datetime is_solar_time: A boolean to indicate if the input hour is solar time (Default: False). Returns: A sun object for this particular time
[ "Get", "Sun", "data", "for", "an", "hour", "of", "the", "year", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L150-L162
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.calculate_sun_from_date_time
def calculate_sun_from_date_time(self, datetime, is_solar_time=False): """Get Sun for an hour of the year. This code is originally written by Trygve Wastvedt \ (Trygve.Wastvedt@gmail.com) based on (NOAA) and modified by Chris Mackey and Mostapha Roudsari Args: date...
python
def calculate_sun_from_date_time(self, datetime, is_solar_time=False): """Get Sun for an hour of the year. This code is originally written by Trygve Wastvedt \ (Trygve.Wastvedt@gmail.com) based on (NOAA) and modified by Chris Mackey and Mostapha Roudsari Args: date...
[ "def", "calculate_sun_from_date_time", "(", "self", ",", "datetime", ",", "is_solar_time", "=", "False", ")", ":", "# TODO(mostapha): This should be more generic and based on a method", "if", "datetime", ".", "year", "!=", "2016", "and", "self", ".", "is_leap_year", ":"...
Get Sun for an hour of the year. This code is originally written by Trygve Wastvedt \ (Trygve.Wastvedt@gmail.com) based on (NOAA) and modified by Chris Mackey and Mostapha Roudsari Args: datetime: Ladybug datetime is_solar_time: A boolean to indicate if the inp...
[ "Get", "Sun", "for", "an", "hour", "of", "the", "year", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L164-L261
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.calculate_sunrise_sunset
def calculate_sunrise_sunset(self, month, day, depression=0.833, is_solar_time=False): """Calculate sunrise, noon and sunset. Return: A dictionary. Keys are ("sunrise", "noon", "sunset") """ datetime = DateTime(month, day, hour=12, leap_year=...
python
def calculate_sunrise_sunset(self, month, day, depression=0.833, is_solar_time=False): """Calculate sunrise, noon and sunset. Return: A dictionary. Keys are ("sunrise", "noon", "sunset") """ datetime = DateTime(month, day, hour=12, leap_year=...
[ "def", "calculate_sunrise_sunset", "(", "self", ",", "month", ",", "day", ",", "depression", "=", "0.833", ",", "is_solar_time", "=", "False", ")", ":", "datetime", "=", "DateTime", "(", "month", ",", "day", ",", "hour", "=", "12", ",", "leap_year", "=",...
Calculate sunrise, noon and sunset. Return: A dictionary. Keys are ("sunrise", "noon", "sunset")
[ "Calculate", "sunrise", "noon", "and", "sunset", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L263-L274
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.calculate_sunrise_sunset_from_datetime
def calculate_sunrise_sunset_from_datetime(self, datetime, depression=0.833, is_solar_time=False): """Calculate sunrise, sunset and noon for a day of year.""" # TODO(mostapha): This should be more generic and based on a method if datetime.year != 20...
python
def calculate_sunrise_sunset_from_datetime(self, datetime, depression=0.833, is_solar_time=False): """Calculate sunrise, sunset and noon for a day of year.""" # TODO(mostapha): This should be more generic and based on a method if datetime.year != 20...
[ "def", "calculate_sunrise_sunset_from_datetime", "(", "self", ",", "datetime", ",", "depression", "=", "0.833", ",", "is_solar_time", "=", "False", ")", ":", "# TODO(mostapha): This should be more generic and based on a method", "if", "datetime", ".", "year", "!=", "2016"...
Calculate sunrise, sunset and noon for a day of year.
[ "Calculate", "sunrise", "sunset", "and", "noon", "for", "a", "day", "of", "year", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L277-L325
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath._calculate_solar_geometry
def _calculate_solar_geometry(self, datetime): """Calculate Solar geometry for an hour of the year. Attributes: datetime: A Ladybug datetime Returns: Solar declination: Solar declination in radians eq_of_time: Equation of time as minutes """ ...
python
def _calculate_solar_geometry(self, datetime): """Calculate Solar geometry for an hour of the year. Attributes: datetime: A Ladybug datetime Returns: Solar declination: Solar declination in radians eq_of_time: Equation of time as minutes """ ...
[ "def", "_calculate_solar_geometry", "(", "self", ",", "datetime", ")", ":", "month", "=", "datetime", ".", "month", "day", "=", "datetime", ".", "day", "hour", "=", "datetime", ".", "hour", "minute", "=", "datetime", ".", "minute", "year", "=", "2016", "...
Calculate Solar geometry for an hour of the year. Attributes: datetime: A Ladybug datetime Returns: Solar declination: Solar declination in radians eq_of_time: Equation of time as minutes
[ "Calculate", "Solar", "geometry", "for", "an", "hour", "of", "the", "year", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L327-L466
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath._calculate_sunrise_hour_angle
def _calculate_sunrise_hour_angle(self, solar_dec, depression=0.833): """Calculate hour angle for sunrise time in degrees.""" hour_angle_arg = math.degrees(math.acos( math.cos(math.radians(90 + depression)) / (math.cos(math.radians(self.latitude)) * math.cos( mat...
python
def _calculate_sunrise_hour_angle(self, solar_dec, depression=0.833): """Calculate hour angle for sunrise time in degrees.""" hour_angle_arg = math.degrees(math.acos( math.cos(math.radians(90 + depression)) / (math.cos(math.radians(self.latitude)) * math.cos( mat...
[ "def", "_calculate_sunrise_hour_angle", "(", "self", ",", "solar_dec", ",", "depression", "=", "0.833", ")", ":", "hour_angle_arg", "=", "math", ".", "degrees", "(", "math", ".", "acos", "(", "math", ".", "cos", "(", "math", ".", "radians", "(", "90", "+...
Calculate hour angle for sunrise time in degrees.
[ "Calculate", "hour", "angle", "for", "sunrise", "time", "in", "degrees", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L468-L479
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath._calculate_solar_time
def _calculate_solar_time(self, hour, eq_of_time, is_solar_time): """Calculate Solar time for an hour.""" if is_solar_time: return hour return ( (hour * 60 + eq_of_time + 4 * math.degrees(self._longitude) - 60 * self.time_zone) % 1440) / 60
python
def _calculate_solar_time(self, hour, eq_of_time, is_solar_time): """Calculate Solar time for an hour.""" if is_solar_time: return hour return ( (hour * 60 + eq_of_time + 4 * math.degrees(self._longitude) - 60 * self.time_zone) % 1440) / 60
[ "def", "_calculate_solar_time", "(", "self", ",", "hour", ",", "eq_of_time", ",", "is_solar_time", ")", ":", "if", "is_solar_time", ":", "return", "hour", "return", "(", "(", "hour", "*", "60", "+", "eq_of_time", "+", "4", "*", "math", ".", "degrees", "(...
Calculate Solar time for an hour.
[ "Calculate", "Solar", "time", "for", "an", "hour", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L481-L488
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath._calculate_solar_time_by_doy
def _calculate_solar_time_by_doy(self, hour, doy): """This is how radiance calculates solar time. This is a place holder and \ need to be validated against calculateSolarTime. """ raise NotImplementedError() return (0.170 * math.sin((4 * math.pi / 373) * (doy - 80)) - ...
python
def _calculate_solar_time_by_doy(self, hour, doy): """This is how radiance calculates solar time. This is a place holder and \ need to be validated against calculateSolarTime. """ raise NotImplementedError() return (0.170 * math.sin((4 * math.pi / 373) * (doy - 80)) - ...
[ "def", "_calculate_solar_time_by_doy", "(", "self", ",", "hour", ",", "doy", ")", ":", "raise", "NotImplementedError", "(", ")", "return", "(", "0.170", "*", "math", ".", "sin", "(", "(", "4", "*", "math", ".", "pi", "/", "373", ")", "*", "(", "doy",...
This is how radiance calculates solar time. This is a place holder and \ need to be validated against calculateSolarTime.
[ "This", "is", "how", "radiance", "calculates", "solar", "time", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L490-L499
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath.draw_sunpath
def draw_sunpath(self, hoys=None, origin=None, scale=1, sun_scale=1, annual=True, rem_night=True): """Create sunpath geometry. \ This method should only be used from the + libraries. Args: hoys: An optional list of hours...
python
def draw_sunpath(self, hoys=None, origin=None, scale=1, sun_scale=1, annual=True, rem_night=True): """Create sunpath geometry. \ This method should only be used from the + libraries. Args: hoys: An optional list of hours...
[ "def", "draw_sunpath", "(", "self", ",", "hoys", "=", "None", ",", "origin", "=", "None", ",", "scale", "=", "1", ",", "sun_scale", "=", "1", ",", "annual", "=", "True", ",", "rem_night", "=", "True", ")", ":", "# check and make sure the call is coming fro...
Create sunpath geometry. \ This method should only be used from the + libraries. Args: hoys: An optional list of hours of the year(default: None). origin: Sunpath origin(default: (0, 0, 0)). scale: Sunpath scale(default: 1). sun_scale: Scale for the sun s...
[ "Create", "sunpath", "geometry", ".", "\\", "This", "method", "should", "only", "be", "used", "from", "the", "+", "libraries", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L512-L592
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath._analemma_position
def _analemma_position(self, hour): """Check what the analemma position is for an hour. This is useful for calculating hours of analemma curves. Returns: -1 if always night, 0 if both day and night, 1 if always day. """ # check for 21 dec and...
python
def _analemma_position(self, hour): """Check what the analemma position is for an hour. This is useful for calculating hours of analemma curves. Returns: -1 if always night, 0 if both day and night, 1 if always day. """ # check for 21 dec and...
[ "def", "_analemma_position", "(", "self", ",", "hour", ")", ":", "# check for 21 dec and 21 jun", "low", "=", "self", ".", "calculate_sun", "(", "12", ",", "21", ",", "hour", ")", ".", "is_during_day", "high", "=", "self", ".", "calculate_sun", "(", "6", "...
Check what the analemma position is for an hour. This is useful for calculating hours of analemma curves. Returns: -1 if always night, 0 if both day and night, 1 if always day.
[ "Check", "what", "the", "analemma", "position", "is", "for", "an", "hour", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L594-L613
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath._analemma_suns
def _analemma_suns(self): """Calculate times that should be used for drawing analemma_curves. Returns: A list of list of analemma suns. """ for h in xrange(0, 24): if self._analemma_position(h) < 0: continue elif self._analemma_positio...
python
def _analemma_suns(self): """Calculate times that should be used for drawing analemma_curves. Returns: A list of list of analemma suns. """ for h in xrange(0, 24): if self._analemma_position(h) < 0: continue elif self._analemma_positio...
[ "def", "_analemma_suns", "(", "self", ")", ":", "for", "h", "in", "xrange", "(", "0", ",", "24", ")", ":", "if", "self", ".", "_analemma_position", "(", "h", ")", "<", "0", ":", "continue", "elif", "self", ".", "_analemma_position", "(", "h", ")", ...
Calculate times that should be used for drawing analemma_curves. Returns: A list of list of analemma suns.
[ "Calculate", "times", "that", "should", "be", "used", "for", "drawing", "analemma_curves", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L615-L666
ladybug-tools/ladybug
ladybug/sunpath.py
Sunpath._daily_suns
def _daily_suns(self, datetimes): """Get sun curve for multiple days of the year.""" for dt in datetimes: # calculate sunrise sunset and noon nss = self.calculate_sunrise_sunset(dt.month, dt.day) dts = tuple(nss[k] for k in ('sunrise', 'noon', 'sunset')) i...
python
def _daily_suns(self, datetimes): """Get sun curve for multiple days of the year.""" for dt in datetimes: # calculate sunrise sunset and noon nss = self.calculate_sunrise_sunset(dt.month, dt.day) dts = tuple(nss[k] for k in ('sunrise', 'noon', 'sunset')) i...
[ "def", "_daily_suns", "(", "self", ",", "datetimes", ")", ":", "for", "dt", "in", "datetimes", ":", "# calculate sunrise sunset and noon", "nss", "=", "self", ".", "calculate_sunrise_sunset", "(", "dt", ".", "month", ",", "dt", ".", "day", ")", "dts", "=", ...
Get sun curve for multiple days of the year.
[ "Get", "sun", "curve", "for", "multiple", "days", "of", "the", "year", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L668-L681
ladybug-tools/ladybug
ladybug/sunpath.py
Sun._calculate_sun_vector
def _calculate_sun_vector(self): """Calculate sun vector for this sun.""" z_axis = Vector3(0., 0., -1.) x_axis = Vector3(1., 0., 0.) north_vector = Vector3(0., 1., 0.) # rotate north vector based on azimuth, altitude, and north _sun_vector = north_vector \ .r...
python
def _calculate_sun_vector(self): """Calculate sun vector for this sun.""" z_axis = Vector3(0., 0., -1.) x_axis = Vector3(1., 0., 0.) north_vector = Vector3(0., 1., 0.) # rotate north vector based on azimuth, altitude, and north _sun_vector = north_vector \ .r...
[ "def", "_calculate_sun_vector", "(", "self", ")", ":", "z_axis", "=", "Vector3", "(", "0.", ",", "0.", ",", "-", "1.", ")", "x_axis", "=", "Vector3", "(", "1.", ",", "0.", ",", "0.", ")", "north_vector", "=", "Vector3", "(", "0.", ",", "1.", ",", ...
Calculate sun vector for this sun.
[ "Calculate", "sun", "vector", "for", "this", "sun", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/sunpath.py#L798-L819
ladybug-tools/ladybug
ladybug/psychrometrics.py
saturated_vapor_pressure
def saturated_vapor_pressure(t_kelvin): """Saturated Vapor Pressure (Pa) at t_kelvin (K). This function accounts for the different behaviour above vs. below the freezing point of water. Note: [1] W. Wagner and A. Pru:" The IAPWS Formulation 1995 for the Thermodynamic Properties of Ordi...
python
def saturated_vapor_pressure(t_kelvin): """Saturated Vapor Pressure (Pa) at t_kelvin (K). This function accounts for the different behaviour above vs. below the freezing point of water. Note: [1] W. Wagner and A. Pru:" The IAPWS Formulation 1995 for the Thermodynamic Properties of Ordi...
[ "def", "saturated_vapor_pressure", "(", "t_kelvin", ")", ":", "if", "t_kelvin", ">=", "273.15", ":", "# Calculate saturation vapor pressure above freezing", "sig", "=", "1", "-", "(", "t_kelvin", "/", "647.096", ")", "sig_polynomial", "=", "(", "-", "7.85951783", ...
Saturated Vapor Pressure (Pa) at t_kelvin (K). This function accounts for the different behaviour above vs. below the freezing point of water. Note: [1] W. Wagner and A. Pru:" The IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific...
[ "Saturated", "Vapor", "Pressure", "(", "Pa", ")", "at", "t_kelvin", "(", "K", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L8-L40
ladybug-tools/ladybug
ladybug/psychrometrics.py
humid_ratio_from_db_rh
def humid_ratio_from_db_rh(db_temp, rel_humid, b_press=101325): """Humidity Ratio (kg water/kg air) at a db_temp (C), rel_humid (%) and Pressure b_press (Pa). Note: [1] Vaisala. (2013) Humidity Conversion Formulas: Calculation Formulas for Humidity. www.vaisala.com/Vaisala%20Documen...
python
def humid_ratio_from_db_rh(db_temp, rel_humid, b_press=101325): """Humidity Ratio (kg water/kg air) at a db_temp (C), rel_humid (%) and Pressure b_press (Pa). Note: [1] Vaisala. (2013) Humidity Conversion Formulas: Calculation Formulas for Humidity. www.vaisala.com/Vaisala%20Documen...
[ "def", "humid_ratio_from_db_rh", "(", "db_temp", ",", "rel_humid", ",", "b_press", "=", "101325", ")", ":", "# Find saturation pressure", "p_ws", "=", "saturated_vapor_pressure", "(", "db_temp", "+", "273.15", ")", "# Calculate partial pressure", "decrh", "=", "rel_hu...
Humidity Ratio (kg water/kg air) at a db_temp (C), rel_humid (%) and Pressure b_press (Pa). Note: [1] Vaisala. (2013) Humidity Conversion Formulas: Calculation Formulas for Humidity. www.vaisala.com/Vaisala%20Documents/Application%20notes/Humidity_Conversion_Formulas_B210973EN-F.pdf
[ "Humidity", "Ratio", "(", "kg", "water", "/", "kg", "air", ")", "at", "a", "db_temp", "(", "C", ")", "rel_humid", "(", "%", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L43-L61
ladybug-tools/ladybug
ladybug/psychrometrics.py
wet_bulb_from_db_rh
def wet_bulb_from_db_rh(db_temp, rh, b_press=101325): """Wet Bulb Temperature (C) at db_temp (C), Relative Humidity rh (%), and Pressure b_press (Pa). Note: [1] J. Sullivan and L. D. Sanders. "Method for obtaining wet-bulb temperatures by modifying the psychrometric formula." Center for Exp...
python
def wet_bulb_from_db_rh(db_temp, rh, b_press=101325): """Wet Bulb Temperature (C) at db_temp (C), Relative Humidity rh (%), and Pressure b_press (Pa). Note: [1] J. Sullivan and L. D. Sanders. "Method for obtaining wet-bulb temperatures by modifying the psychrometric formula." Center for Exp...
[ "def", "wet_bulb_from_db_rh", "(", "db_temp", ",", "rh", ",", "b_press", "=", "101325", ")", ":", "es", "=", "6.112", "*", "math", ".", "e", "**", "(", "(", "17.67", "*", "db_temp", ")", "/", "(", "db_temp", "+", "243.5", ")", ")", "e", "=", "(",...
Wet Bulb Temperature (C) at db_temp (C), Relative Humidity rh (%), and Pressure b_press (Pa). Note: [1] J. Sullivan and L. D. Sanders. "Method for obtaining wet-bulb temperatures by modifying the psychrometric formula." Center for Experiment Design and Data Analysis. NOAA - National Oce...
[ "Wet", "Bulb", "Temperature", "(", "C", ")", "at", "db_temp", "(", "C", ")", "Relative", "Humidity", "rh", "(", "%", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L76-L114
ladybug-tools/ladybug
ladybug/psychrometrics.py
dew_point_from_db_rh
def dew_point_from_db_rh(db_temp, rh): """Dew Point Temperature (C) at Dry Bulb Temperature db_temp (C) and Relative Humidity rh (%). Note: [1] J. Sullivan and L. D. Sanders. "Method for obtaining wet-bulb temperatures by modifying the psychrometric formula." Center for Experiment Design an...
python
def dew_point_from_db_rh(db_temp, rh): """Dew Point Temperature (C) at Dry Bulb Temperature db_temp (C) and Relative Humidity rh (%). Note: [1] J. Sullivan and L. D. Sanders. "Method for obtaining wet-bulb temperatures by modifying the psychrometric formula." Center for Experiment Design an...
[ "def", "dew_point_from_db_rh", "(", "db_temp", ",", "rh", ")", ":", "es", "=", "6.112", "*", "math", ".", "e", "**", "(", "(", "17.67", "*", "db_temp", ")", "/", "(", "db_temp", "+", "243.5", ")", ")", "e", "=", "(", "es", "*", "rh", ")", "/", ...
Dew Point Temperature (C) at Dry Bulb Temperature db_temp (C) and Relative Humidity rh (%). Note: [1] J. Sullivan and L. D. Sanders. "Method for obtaining wet-bulb temperatures by modifying the psychrometric formula." Center for Experiment Design and Data Analysis. NOAA - National Ocean...
[ "Dew", "Point", "Temperature", "(", "C", ")", "at", "Dry", "Bulb", "Temperature", "db_temp", "(", "C", ")", "and", "Relative", "Humidity", "rh", "(", "%", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L117-L130
ladybug-tools/ladybug
ladybug/psychrometrics.py
rel_humid_from_db_hr
def rel_humid_from_db_hr(db_temp, humid_ratio, b_press=101325): """Relative Humidity (%) at humid_ratio (kg water/kg air), db_temp (C), and Pressure b_press (Pa). """ pw = (humid_ratio * 1000 * b_press) / (621.9907 + (humid_ratio * 1000)) pws = saturated_vapor_pressure(db_temp + 273.15) rel_humi...
python
def rel_humid_from_db_hr(db_temp, humid_ratio, b_press=101325): """Relative Humidity (%) at humid_ratio (kg water/kg air), db_temp (C), and Pressure b_press (Pa). """ pw = (humid_ratio * 1000 * b_press) / (621.9907 + (humid_ratio * 1000)) pws = saturated_vapor_pressure(db_temp + 273.15) rel_humi...
[ "def", "rel_humid_from_db_hr", "(", "db_temp", ",", "humid_ratio", ",", "b_press", "=", "101325", ")", ":", "pw", "=", "(", "humid_ratio", "*", "1000", "*", "b_press", ")", "/", "(", "621.9907", "+", "(", "humid_ratio", "*", "1000", ")", ")", "pws", "=...
Relative Humidity (%) at humid_ratio (kg water/kg air), db_temp (C), and Pressure b_press (Pa).
[ "Relative", "Humidity", "(", "%", ")", "at", "humid_ratio", "(", "kg", "water", "/", "kg", "air", ")", "db_temp", "(", "C", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L133-L140
ladybug-tools/ladybug
ladybug/psychrometrics.py
rel_humid_from_db_enth
def rel_humid_from_db_enth(db_temp, enthalpy, b_press=101325): """Relative Humidity (%) at db_temp (C), enthalpy (kJ/kg) and Pressure b_press (Pa). """ assert enthalpy >= 0, 'enthalpy must be' \ 'greater than 0. Got {}'.format(str(enthalpy)) hr = (enthalpy - (1.006 * db_temp)) / ((1.84 * db_...
python
def rel_humid_from_db_enth(db_temp, enthalpy, b_press=101325): """Relative Humidity (%) at db_temp (C), enthalpy (kJ/kg) and Pressure b_press (Pa). """ assert enthalpy >= 0, 'enthalpy must be' \ 'greater than 0. Got {}'.format(str(enthalpy)) hr = (enthalpy - (1.006 * db_temp)) / ((1.84 * db_...
[ "def", "rel_humid_from_db_enth", "(", "db_temp", ",", "enthalpy", ",", "b_press", "=", "101325", ")", ":", "assert", "enthalpy", ">=", "0", ",", "'enthalpy must be'", "'greater than 0. Got {}'", ".", "format", "(", "str", "(", "enthalpy", ")", ")", "hr", "=", ...
Relative Humidity (%) at db_temp (C), enthalpy (kJ/kg) and Pressure b_press (Pa).
[ "Relative", "Humidity", "(", "%", ")", "at", "db_temp", "(", "C", ")", "enthalpy", "(", "kJ", "/", "kg", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L143-L151
ladybug-tools/ladybug
ladybug/psychrometrics.py
rel_humid_from_db_dpt
def rel_humid_from_db_dpt(db_temp, dew_pt): """Relative Humidity (%) at db_temp (C), and dew_pt (C). """ pws_ta = saturated_vapor_pressure(db_temp + 273.15) pws_td = saturated_vapor_pressure(dew_pt + 273.15) rh = 100 * (pws_td / pws_ta) return rh
python
def rel_humid_from_db_dpt(db_temp, dew_pt): """Relative Humidity (%) at db_temp (C), and dew_pt (C). """ pws_ta = saturated_vapor_pressure(db_temp + 273.15) pws_td = saturated_vapor_pressure(dew_pt + 273.15) rh = 100 * (pws_td / pws_ta) return rh
[ "def", "rel_humid_from_db_dpt", "(", "db_temp", ",", "dew_pt", ")", ":", "pws_ta", "=", "saturated_vapor_pressure", "(", "db_temp", "+", "273.15", ")", "pws_td", "=", "saturated_vapor_pressure", "(", "dew_pt", "+", "273.15", ")", "rh", "=", "100", "*", "(", ...
Relative Humidity (%) at db_temp (C), and dew_pt (C).
[ "Relative", "Humidity", "(", "%", ")", "at", "db_temp", "(", "C", ")", "and", "dew_pt", "(", "C", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L154-L160
ladybug-tools/ladybug
ladybug/psychrometrics.py
rel_humid_from_db_wb
def rel_humid_from_db_wb(db_temp, wet_bulb, b_press=101325): """Relative Humidity (%) at db_temp(C), wet_bulb (C), and Pressure b_press (Pa). """ # Calculate saturation pressure. p_ws = saturated_vapor_pressure(db_temp + 273.15) p_ws_wb = saturated_vapor_pressure(wet_bulb + 273.15) # calculate p...
python
def rel_humid_from_db_wb(db_temp, wet_bulb, b_press=101325): """Relative Humidity (%) at db_temp(C), wet_bulb (C), and Pressure b_press (Pa). """ # Calculate saturation pressure. p_ws = saturated_vapor_pressure(db_temp + 273.15) p_ws_wb = saturated_vapor_pressure(wet_bulb + 273.15) # calculate p...
[ "def", "rel_humid_from_db_wb", "(", "db_temp", ",", "wet_bulb", ",", "b_press", "=", "101325", ")", ":", "# Calculate saturation pressure.", "p_ws", "=", "saturated_vapor_pressure", "(", "db_temp", "+", "273.15", ")", "p_ws_wb", "=", "saturated_vapor_pressure", "(", ...
Relative Humidity (%) at db_temp(C), wet_bulb (C), and Pressure b_press (Pa).
[ "Relative", "Humidity", "(", "%", ")", "at", "db_temp", "(", "C", ")", "wet_bulb", "(", "C", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L163-L173
ladybug-tools/ladybug
ladybug/psychrometrics.py
dew_point_from_db_hr
def dew_point_from_db_hr(db_temp, hr, b_press=101325): """Dew Point Temperature (C) at Temperature db_temp (C), Humidity Ratio hr (kg water/kg air) and Pressure b_press (Pa). """ rh = rel_humid_from_db_hr(db_temp, hr, b_press) td = dew_point_from_db_rh(db_temp, rh) return td
python
def dew_point_from_db_hr(db_temp, hr, b_press=101325): """Dew Point Temperature (C) at Temperature db_temp (C), Humidity Ratio hr (kg water/kg air) and Pressure b_press (Pa). """ rh = rel_humid_from_db_hr(db_temp, hr, b_press) td = dew_point_from_db_rh(db_temp, rh) return td
[ "def", "dew_point_from_db_hr", "(", "db_temp", ",", "hr", ",", "b_press", "=", "101325", ")", ":", "rh", "=", "rel_humid_from_db_hr", "(", "db_temp", ",", "hr", ",", "b_press", ")", "td", "=", "dew_point_from_db_rh", "(", "db_temp", ",", "rh", ")", "return...
Dew Point Temperature (C) at Temperature db_temp (C), Humidity Ratio hr (kg water/kg air) and Pressure b_press (Pa).
[ "Dew", "Point", "Temperature", "(", "C", ")", "at", "Temperature", "db_temp", "(", "C", ")", "Humidity", "Ratio", "hr", "(", "kg", "water", "/", "kg", "air", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L176-L182
ladybug-tools/ladybug
ladybug/psychrometrics.py
dew_point_from_db_enth
def dew_point_from_db_enth(db_temp, enthlpy, b_press=101325): """Dew Point Temperature (C) at Temperature db_temp (C), enthalpy (kJ/kg) and Pressure b_press (Pa). """ rh = rel_humid_from_db_enth(db_temp, enthlpy, b_press) td = dew_point_from_db_rh(db_temp, rh) return td
python
def dew_point_from_db_enth(db_temp, enthlpy, b_press=101325): """Dew Point Temperature (C) at Temperature db_temp (C), enthalpy (kJ/kg) and Pressure b_press (Pa). """ rh = rel_humid_from_db_enth(db_temp, enthlpy, b_press) td = dew_point_from_db_rh(db_temp, rh) return td
[ "def", "dew_point_from_db_enth", "(", "db_temp", ",", "enthlpy", ",", "b_press", "=", "101325", ")", ":", "rh", "=", "rel_humid_from_db_enth", "(", "db_temp", ",", "enthlpy", ",", "b_press", ")", "td", "=", "dew_point_from_db_rh", "(", "db_temp", ",", "rh", ...
Dew Point Temperature (C) at Temperature db_temp (C), enthalpy (kJ/kg) and Pressure b_press (Pa).
[ "Dew", "Point", "Temperature", "(", "C", ")", "at", "Temperature", "db_temp", "(", "C", ")", "enthalpy", "(", "kJ", "/", "kg", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L185-L191
ladybug-tools/ladybug
ladybug/psychrometrics.py
dew_point_from_db_wb
def dew_point_from_db_wb(db_temp, wet_bulb, b_press=101325): """Dew Point Temperature (C) at Temperature db_temp (C), wet_bulb (C) and Pressure b_press (Pa). """ rh = rel_humid_from_db_wb(db_temp, wet_bulb, b_press) td = dew_point_from_db_rh(db_temp, rh) return td
python
def dew_point_from_db_wb(db_temp, wet_bulb, b_press=101325): """Dew Point Temperature (C) at Temperature db_temp (C), wet_bulb (C) and Pressure b_press (Pa). """ rh = rel_humid_from_db_wb(db_temp, wet_bulb, b_press) td = dew_point_from_db_rh(db_temp, rh) return td
[ "def", "dew_point_from_db_wb", "(", "db_temp", ",", "wet_bulb", ",", "b_press", "=", "101325", ")", ":", "rh", "=", "rel_humid_from_db_wb", "(", "db_temp", ",", "wet_bulb", ",", "b_press", ")", "td", "=", "dew_point_from_db_rh", "(", "db_temp", ",", "rh", ")...
Dew Point Temperature (C) at Temperature db_temp (C), wet_bulb (C) and Pressure b_press (Pa).
[ "Dew", "Point", "Temperature", "(", "C", ")", "at", "Temperature", "db_temp", "(", "C", ")", "wet_bulb", "(", "C", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L194-L200
ladybug-tools/ladybug
ladybug/psychrometrics.py
db_temp_from_wb_rh
def db_temp_from_wb_rh(wet_bulb, rel_humid, b_press=101325): """Dry Bulb Temperature (C) and humidity_ratio at at wet_bulb (C), rel_humid (%) and Pressure b_press (Pa). Formula is only valid for rel_humid == 0 or rel_humid == 100. """ assert rel_humid == 0 or rel_humid == 100, 'formula is only vali...
python
def db_temp_from_wb_rh(wet_bulb, rel_humid, b_press=101325): """Dry Bulb Temperature (C) and humidity_ratio at at wet_bulb (C), rel_humid (%) and Pressure b_press (Pa). Formula is only valid for rel_humid == 0 or rel_humid == 100. """ assert rel_humid == 0 or rel_humid == 100, 'formula is only vali...
[ "def", "db_temp_from_wb_rh", "(", "wet_bulb", ",", "rel_humid", ",", "b_press", "=", "101325", ")", ":", "assert", "rel_humid", "==", "0", "or", "rel_humid", "==", "100", ",", "'formula is only valid for'", "' rel_humid == 0 or rel_humid == 100'", "humidity_ratio", "=...
Dry Bulb Temperature (C) and humidity_ratio at at wet_bulb (C), rel_humid (%) and Pressure b_press (Pa). Formula is only valid for rel_humid == 0 or rel_humid == 100.
[ "Dry", "Bulb", "Temperature", "(", "C", ")", "and", "humidity_ratio", "at", "at", "wet_bulb", "(", "C", ")", "rel_humid", "(", "%", ")", "and", "Pressure", "b_press", "(", "Pa", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/psychrometrics.py#L212-L223
ladybug-tools/ladybug
ladybug/designday.py
DDY.from_json
def from_json(cls, data): """Create a DDY from a dictionary. Args: data = { "location": ladybug Location schema, "design_days": [] // list of ladybug DesignDay schemas} """ required_keys = ('location', 'design_days') for key in required_keys: ...
python
def from_json(cls, data): """Create a DDY from a dictionary. Args: data = { "location": ladybug Location schema, "design_days": [] // list of ladybug DesignDay schemas} """ required_keys = ('location', 'design_days') for key in required_keys: ...
[ "def", "from_json", "(", "cls", ",", "data", ")", ":", "required_keys", "=", "(", "'location'", ",", "'design_days'", ")", "for", "key", "in", "required_keys", ":", "assert", "key", "in", "data", ",", "'Required key \"{}\" is missing!'", ".", "format", "(", ...
Create a DDY from a dictionary. Args: data = { "location": ladybug Location schema, "design_days": [] // list of ladybug DesignDay schemas}
[ "Create", "a", "DDY", "from", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L48-L61
ladybug-tools/ladybug
ladybug/designday.py
DDY.from_ddy_file
def from_ddy_file(cls, file_path): """Initalize from a ddy file object from an existing ddy file. args: file_path: A string representing a complete path to the .ddy file. """ # check that the file is there if not os.path.isfile(file_path): raise ValueErro...
python
def from_ddy_file(cls, file_path): """Initalize from a ddy file object from an existing ddy file. args: file_path: A string representing a complete path to the .ddy file. """ # check that the file is there if not os.path.isfile(file_path): raise ValueErro...
[ "def", "from_ddy_file", "(", "cls", ",", "file_path", ")", ":", "# check that the file is there", "if", "not", "os", ".", "path", ".", "isfile", "(", "file_path", ")", ":", "raise", "ValueError", "(", "'Cannot find a .ddy file at {}'", ".", "format", "(", "file_...
Initalize from a ddy file object from an existing ddy file. args: file_path: A string representing a complete path to the .ddy file.
[ "Initalize", "from", "a", "ddy", "file", "object", "from", "an", "existing", "ddy", "file", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L64-L115
ladybug-tools/ladybug
ladybug/designday.py
DDY.save
def save(self, file_path): """Save ddy object as a .ddy file. args: file_path: A string representing the path to write the ddy file to. """ # write all data into the file # write the file data = self.location.ep_style_location_string + '\n\n' for d_da...
python
def save(self, file_path): """Save ddy object as a .ddy file. args: file_path: A string representing the path to write the ddy file to. """ # write all data into the file # write the file data = self.location.ep_style_location_string + '\n\n' for d_da...
[ "def", "save", "(", "self", ",", "file_path", ")", ":", "# write all data into the file", "# write the file", "data", "=", "self", ".", "location", ".", "ep_style_location_string", "+", "'\\n\\n'", "for", "d_day", "in", "self", ".", "design_days", ":", "data", "...
Save ddy object as a .ddy file. args: file_path: A string representing the path to write the ddy file to.
[ "Save", "ddy", "object", "as", "a", ".", "ddy", "file", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L126-L137
ladybug-tools/ladybug
ladybug/designday.py
DDY.filter_by_keyword
def filter_by_keyword(self, keyword): """Return a list of ddys that have a certain keyword in their name. This is useful for selecting out design days from a ddy file that are for a specific type of condition (for example, .4% cooling design days) """ filtered_days = [] ...
python
def filter_by_keyword(self, keyword): """Return a list of ddys that have a certain keyword in their name. This is useful for selecting out design days from a ddy file that are for a specific type of condition (for example, .4% cooling design days) """ filtered_days = [] ...
[ "def", "filter_by_keyword", "(", "self", ",", "keyword", ")", ":", "filtered_days", "=", "[", "]", "for", "des_day", "in", "self", ".", "design_days", ":", "if", "keyword", "in", "des_day", ".", "name", ":", "filtered_days", ".", "append", "(", "des_day", ...
Return a list of ddys that have a certain keyword in their name. This is useful for selecting out design days from a ddy file that are for a specific type of condition (for example, .4% cooling design days)
[ "Return", "a", "list", "of", "ddys", "that", "have", "a", "certain", "keyword", "in", "their", "name", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L139-L149
ladybug-tools/ladybug
ladybug/designday.py
DDY.to_json
def to_json(self): """Convert the Design Day to a dictionary.""" return { 'location': self.location.to_json(), 'design_days': [des_d.to_json() for des_d in self.design_days] }
python
def to_json(self): """Convert the Design Day to a dictionary.""" return { 'location': self.location.to_json(), 'design_days': [des_d.to_json() for des_d in self.design_days] }
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'location'", ":", "self", ".", "location", ".", "to_json", "(", ")", ",", "'design_days'", ":", "[", "des_d", ".", "to_json", "(", ")", "for", "des_d", "in", "self", ".", "design_days", "]", "}...
Convert the Design Day to a dictionary.
[ "Convert", "the", "Design", "Day", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L194-L199
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.from_json
def from_json(cls, data): """Create a Design Day from a dictionary. Args: data = { "name": string, "day_type": string, "location": ladybug Location schema, "dry_bulb_condition": ladybug DryBulbCondition schema, "humidity_condition"...
python
def from_json(cls, data): """Create a Design Day from a dictionary. Args: data = { "name": string, "day_type": string, "location": ladybug Location schema, "dry_bulb_condition": ladybug DryBulbCondition schema, "humidity_condition"...
[ "def", "from_json", "(", "cls", ",", "data", ")", ":", "required_keys", "=", "(", "'name'", ",", "'day_type'", ",", "'location'", ",", "'dry_bulb_condition'", ",", "'humidity_condition'", ",", "'wind_condition'", ",", "'sky_condition'", ")", "for", "key", "in", ...
Create a Design Day from a dictionary. Args: data = { "name": string, "day_type": string, "location": ladybug Location schema, "dry_bulb_condition": ladybug DryBulbCondition schema, "humidity_condition": ladybug HumidityCondition schema, ...
[ "Create", "a", "Design", "Day", "from", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L298-L320
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.from_ep_string
def from_ep_string(cls, ep_string, location): """Initalize from an EnergyPlus string of a SizingPeriod:DesignDay. args: ep_string: A full string representing a SizingPeriod:DesignDay. """ # format the object into a list of properties ep_string = ep_string.strip() ...
python
def from_ep_string(cls, ep_string, location): """Initalize from an EnergyPlus string of a SizingPeriod:DesignDay. args: ep_string: A full string representing a SizingPeriod:DesignDay. """ # format the object into a list of properties ep_string = ep_string.strip() ...
[ "def", "from_ep_string", "(", "cls", ",", "ep_string", ",", "location", ")", ":", "# format the object into a list of properties", "ep_string", "=", "ep_string", ".", "strip", "(", ")", "if", "'\\n'", "in", "ep_string", ":", "ep_lines", "=", "ep_string", ".", "s...
Initalize from an EnergyPlus string of a SizingPeriod:DesignDay. args: ep_string: A full string representing a SizingPeriod:DesignDay.
[ "Initalize", "from", "an", "EnergyPlus", "string", "of", "a", "SizingPeriod", ":", "DesignDay", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L323-L383
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.from_design_day_properties
def from_design_day_properties(cls, name, day_type, location, analysis_period, dry_bulb_max, dry_bulb_range, humidity_type, humidity_value, barometric_p, wind_speed, wind_dir, sky_model, sky_properties): """...
python
def from_design_day_properties(cls, name, day_type, location, analysis_period, dry_bulb_max, dry_bulb_range, humidity_type, humidity_value, barometric_p, wind_speed, wind_dir, sky_model, sky_properties): """...
[ "def", "from_design_day_properties", "(", "cls", ",", "name", ",", "day_type", ",", "location", ",", "analysis_period", ",", "dry_bulb_max", ",", "dry_bulb_range", ",", "humidity_type", ",", "humidity_value", ",", "barometric_p", ",", "wind_speed", ",", "wind_dir", ...
Create a design day object from various key properties. Args: name: A text string to set the name of the design day day_type: Choose from 'SummerDesignDay', 'WinterDesignDay' or other EnergyPlus days location: Location for the design day analysis_...
[ "Create", "a", "design", "day", "object", "from", "various", "key", "properties", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L386-L425
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.from_ashrae_dict_heating
def from_ashrae_dict_heating(cls, ashrae_dict, location, use_990=False, pressure=None): """Create a heating design day object from a ASHRAE HOF dictionary. Args: ashrae_dict: A dictionary with 15 keys that match those in the heating_keys prop...
python
def from_ashrae_dict_heating(cls, ashrae_dict, location, use_990=False, pressure=None): """Create a heating design day object from a ASHRAE HOF dictionary. Args: ashrae_dict: A dictionary with 15 keys that match those in the heating_keys prop...
[ "def", "from_ashrae_dict_heating", "(", "cls", ",", "ashrae_dict", ",", "location", ",", "use_990", "=", "False", ",", "pressure", "=", "None", ")", ":", "db_key", "=", "'DB996'", "if", "use_990", "is", "False", "else", "'DB990'", "perc_str", "=", "'99.6'", ...
Create a heating design day object from a ASHRAE HOF dictionary. Args: ashrae_dict: A dictionary with 15 keys that match those in the heating_keys property of this object. Each key should correspond to a value. location: Location object for the design day...
[ "Create", "a", "heating", "design", "day", "object", "from", "a", "ASHRAE", "HOF", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L428-L454
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.from_ashrae_dict_cooling
def from_ashrae_dict_cooling(cls, ashrae_dict, location, use_010=False, pressure=None, tau=None): """Create a heating design day object from a ASHRAE HOF dictionary. Args: ashrae_dict: A dictionary with 32 keys that match those in the cooling...
python
def from_ashrae_dict_cooling(cls, ashrae_dict, location, use_010=False, pressure=None, tau=None): """Create a heating design day object from a ASHRAE HOF dictionary. Args: ashrae_dict: A dictionary with 32 keys that match those in the cooling...
[ "def", "from_ashrae_dict_cooling", "(", "cls", ",", "ashrae_dict", ",", "location", ",", "use_010", "=", "False", ",", "pressure", "=", "None", ",", "tau", "=", "None", ")", ":", "db_key", "=", "'DB004'", "if", "use_010", "is", "False", "else", "'DB010'", ...
Create a heating design day object from a ASHRAE HOF dictionary. Args: ashrae_dict: A dictionary with 32 keys that match those in the cooling_keys property of this object. Each key should correspond to a value. location: Location object for the design day...
[ "Create", "a", "heating", "design", "day", "object", "from", "a", "ASHRAE", "HOF", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L457-L493
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.ep_style_string
def ep_style_string(self): """Serialize object to an EnerygPlus SizingPeriod:DesignDay. Returns: ep_string: A full string representing a SizingPeriod:DesignDay. """ # Put together the values in the order that they exist in the ddy file ep_vals = [self.name, ...
python
def ep_style_string(self): """Serialize object to an EnerygPlus SizingPeriod:DesignDay. Returns: ep_string: A full string representing a SizingPeriod:DesignDay. """ # Put together the values in the order that they exist in the ddy file ep_vals = [self.name, ...
[ "def", "ep_style_string", "(", "self", ")", ":", "# Put together the values in the order that they exist in the ddy file", "ep_vals", "=", "[", "self", ".", "name", ",", "self", ".", "sky_condition", ".", "month", ",", "self", ".", "sky_condition", ".", "day_of_month"...
Serialize object to an EnerygPlus SizingPeriod:DesignDay. Returns: ep_string: A full string representing a SizingPeriod:DesignDay.
[ "Serialize", "object", "to", "an", "EnerygPlus", "SizingPeriod", ":", "DesignDay", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L496-L549
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.analysis_period
def analysis_period(self): """The analysisperiod of the design day.""" return AnalysisPeriod( self.sky_condition.month, self.sky_condition.day_of_month, 0, self.sky_condition.month, self.sky_condition.day_of_month, 23)
python
def analysis_period(self): """The analysisperiod of the design day.""" return AnalysisPeriod( self.sky_condition.month, self.sky_condition.day_of_month, 0, self.sky_condition.month, self.sky_condition.day_of_month, 23)
[ "def", "analysis_period", "(", "self", ")", ":", "return", "AnalysisPeriod", "(", "self", ".", "sky_condition", ".", "month", ",", "self", ".", "sky_condition", ".", "day_of_month", ",", "0", ",", "self", ".", "sky_condition", ".", "month", ",", "self", "....
The analysisperiod of the design day.
[ "The", "analysisperiod", "of", "the", "design", "day", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L629-L637
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.hourly_dew_point
def hourly_dew_point(self): """A data collection containing hourly dew points over they day.""" dpt_data = self._humidity_condition.hourly_dew_point_values( self._dry_bulb_condition) return self._get_daily_data_collections( temperature.DewPointTemperature(), 'C', dpt_data...
python
def hourly_dew_point(self): """A data collection containing hourly dew points over they day.""" dpt_data = self._humidity_condition.hourly_dew_point_values( self._dry_bulb_condition) return self._get_daily_data_collections( temperature.DewPointTemperature(), 'C', dpt_data...
[ "def", "hourly_dew_point", "(", "self", ")", ":", "dpt_data", "=", "self", ".", "_humidity_condition", ".", "hourly_dew_point_values", "(", "self", ".", "_dry_bulb_condition", ")", "return", "self", ".", "_get_daily_data_collections", "(", "temperature", ".", "DewPo...
A data collection containing hourly dew points over they day.
[ "A", "data", "collection", "containing", "hourly", "dew", "points", "over", "they", "day", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L651-L656
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.hourly_relative_humidity
def hourly_relative_humidity(self): """A data collection containing hourly relative humidity over they day.""" dpt_data = self._humidity_condition.hourly_dew_point_values( self._dry_bulb_condition) rh_data = [rel_humid_from_db_dpt(x, y) for x, y in zip( self._dry_bulb_con...
python
def hourly_relative_humidity(self): """A data collection containing hourly relative humidity over they day.""" dpt_data = self._humidity_condition.hourly_dew_point_values( self._dry_bulb_condition) rh_data = [rel_humid_from_db_dpt(x, y) for x, y in zip( self._dry_bulb_con...
[ "def", "hourly_relative_humidity", "(", "self", ")", ":", "dpt_data", "=", "self", ".", "_humidity_condition", ".", "hourly_dew_point_values", "(", "self", ".", "_dry_bulb_condition", ")", "rh_data", "=", "[", "rel_humid_from_db_dpt", "(", "x", ",", "y", ")", "f...
A data collection containing hourly relative humidity over they day.
[ "A", "data", "collection", "containing", "hourly", "relative", "humidity", "over", "they", "day", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L659-L666
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.hourly_solar_radiation
def hourly_solar_radiation(self): """Three data collections containing hourly direct normal, diffuse horizontal, and global horizontal radiation. """ dir_norm, diff_horiz, glob_horiz = \ self._sky_condition.radiation_values(self._location) dir_norm_data = self._get_d...
python
def hourly_solar_radiation(self): """Three data collections containing hourly direct normal, diffuse horizontal, and global horizontal radiation. """ dir_norm, diff_horiz, glob_horiz = \ self._sky_condition.radiation_values(self._location) dir_norm_data = self._get_d...
[ "def", "hourly_solar_radiation", "(", "self", ")", ":", "dir_norm", ",", "diff_horiz", ",", "glob_horiz", "=", "self", ".", "_sky_condition", ".", "radiation_values", "(", "self", ".", "_location", ")", "dir_norm_data", "=", "self", ".", "_get_daily_data_collectio...
Three data collections containing hourly direct normal, diffuse horizontal, and global horizontal radiation.
[ "Three", "data", "collections", "containing", "hourly", "direct", "normal", "diffuse", "horizontal", "and", "global", "horizontal", "radiation", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L688-L702
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.hourly_horizontal_infrared
def hourly_horizontal_infrared(self): """A data collection containing hourly horizontal infrared intensity in W/m2. """ sky_cover = self._sky_condition.hourly_sky_cover db_temp = self._dry_bulb_condition.hourly_values dp_temp = self._humidity_condition.hourly_dew_point_values( ...
python
def hourly_horizontal_infrared(self): """A data collection containing hourly horizontal infrared intensity in W/m2. """ sky_cover = self._sky_condition.hourly_sky_cover db_temp = self._dry_bulb_condition.hourly_values dp_temp = self._humidity_condition.hourly_dew_point_values( ...
[ "def", "hourly_horizontal_infrared", "(", "self", ")", ":", "sky_cover", "=", "self", ".", "_sky_condition", ".", "hourly_sky_cover", "db_temp", "=", "self", ".", "_dry_bulb_condition", ".", "hourly_values", "dp_temp", "=", "self", ".", "_humidity_condition", ".", ...
A data collection containing hourly horizontal infrared intensity in W/m2.
[ "A", "data", "collection", "containing", "hourly", "horizontal", "infrared", "intensity", "in", "W", "/", "m2", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L711-L725
ladybug-tools/ladybug
ladybug/designday.py
DesignDay._get_daily_data_collections
def _get_daily_data_collections(self, data_type, unit, values): """Return an empty data collection.""" data_header = Header(data_type=data_type, unit=unit, analysis_period=self.analysis_period, metadata={'source': self._location.source, ...
python
def _get_daily_data_collections(self, data_type, unit, values): """Return an empty data collection.""" data_header = Header(data_type=data_type, unit=unit, analysis_period=self.analysis_period, metadata={'source': self._location.source, ...
[ "def", "_get_daily_data_collections", "(", "self", ",", "data_type", ",", "unit", ",", "values", ")", ":", "data_header", "=", "Header", "(", "data_type", "=", "data_type", ",", "unit", "=", "unit", ",", "analysis_period", "=", "self", ".", "analysis_period", ...
Return an empty data collection.
[ "Return", "an", "empty", "data", "collection", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L727-L734
ladybug-tools/ladybug
ladybug/designday.py
DesignDay.to_json
def to_json(self): """Convert the Design Day to a dictionary.""" return { 'name': self.name, 'day_type': self.day_type, 'location': self.location.to_json(), 'dry_bulb_condition': self.dry_bulb_condition.to_json(), 'humidity_condition': self.hum...
python
def to_json(self): """Convert the Design Day to a dictionary.""" return { 'name': self.name, 'day_type': self.day_type, 'location': self.location.to_json(), 'dry_bulb_condition': self.dry_bulb_condition.to_json(), 'humidity_condition': self.hum...
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'name'", ":", "self", ".", "name", ",", "'day_type'", ":", "self", ".", "day_type", ",", "'location'", ":", "self", ".", "location", ".", "to_json", "(", ")", ",", "'dry_bulb_condition'", ":", "s...
Convert the Design Day to a dictionary.
[ "Convert", "the", "Design", "Day", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L741-L751
ladybug-tools/ladybug
ladybug/designday.py
DryBulbCondition.hourly_values
def hourly_values(self): """A list of temperature values for each hour over the design day.""" return [self._dry_bulb_max - self._dry_bulb_range * x for x in self.temp_multipliers]
python
def hourly_values(self): """A list of temperature values for each hour over the design day.""" return [self._dry_bulb_max - self._dry_bulb_range * x for x in self.temp_multipliers]
[ "def", "hourly_values", "(", "self", ")", ":", "return", "[", "self", ".", "_dry_bulb_max", "-", "self", ".", "_dry_bulb_range", "*", "x", "for", "x", "in", "self", ".", "temp_multipliers", "]" ]
A list of temperature values for each hour over the design day.
[ "A", "list", "of", "temperature", "values", "for", "each", "hour", "over", "the", "design", "day", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L805-L808
ladybug-tools/ladybug
ladybug/designday.py
DryBulbCondition.to_json
def to_json(self): """Convert the Dry Bulb Condition to a dictionary.""" return { 'dry_bulb_max': self.dry_bulb_max, 'dry_bulb_range': self.dry_bulb_range, 'modifier_type': self.modifier_type, 'modifier_schedule': self.modifier_schedule }
python
def to_json(self): """Convert the Dry Bulb Condition to a dictionary.""" return { 'dry_bulb_max': self.dry_bulb_max, 'dry_bulb_range': self.dry_bulb_range, 'modifier_type': self.modifier_type, 'modifier_schedule': self.modifier_schedule }
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'dry_bulb_max'", ":", "self", ".", "dry_bulb_max", ",", "'dry_bulb_range'", ":", "self", ".", "dry_bulb_range", ",", "'modifier_type'", ":", "self", ".", "modifier_type", ",", "'modifier_schedule'", ":", ...
Convert the Dry Bulb Condition to a dictionary.
[ "Convert", "the", "Dry", "Bulb", "Condition", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L846-L853
ladybug-tools/ladybug
ladybug/designday.py
HumidityCondition.from_json
def from_json(cls, data): """Create a Humidity Condition from a dictionary. Args: data = { "hum_type": string, "hum_value": float, "barometric_pressure": float, "schedule": string, "wet_bulb_range": string} """ # Ch...
python
def from_json(cls, data): """Create a Humidity Condition from a dictionary. Args: data = { "hum_type": string, "hum_value": float, "barometric_pressure": float, "schedule": string, "wet_bulb_range": string} """ # Ch...
[ "def", "from_json", "(", "cls", ",", "data", ")", ":", "# Check required and optional keys", "required_keys", "=", "(", "'hum_type'", ",", "'hum_value'", ")", "optional_keys", "=", "{", "'barometric_pressure'", ":", "101325", ",", "'schedule'", ":", "''", ",", "...
Create a Humidity Condition from a dictionary. Args: data = { "hum_type": string, "hum_value": float, "barometric_pressure": float, "schedule": string, "wet_bulb_range": string}
[ "Create", "a", "Humidity", "Condition", "from", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L886-L908
ladybug-tools/ladybug
ladybug/designday.py
HumidityCondition.hourly_dew_point_values
def hourly_dew_point_values(self, dry_bulb_condition): """Get a list of dew points (C) at each hour over the design day. args: dry_bulb_condition: The dry bulb condition for the day. """ hourly_dew_point = [] max_dpt = self.dew_point(dry_bulb_condition.dry_bulb_max) ...
python
def hourly_dew_point_values(self, dry_bulb_condition): """Get a list of dew points (C) at each hour over the design day. args: dry_bulb_condition: The dry bulb condition for the day. """ hourly_dew_point = [] max_dpt = self.dew_point(dry_bulb_condition.dry_bulb_max) ...
[ "def", "hourly_dew_point_values", "(", "self", ",", "dry_bulb_condition", ")", ":", "hourly_dew_point", "=", "[", "]", "max_dpt", "=", "self", ".", "dew_point", "(", "dry_bulb_condition", ".", "dry_bulb_max", ")", "for", "db", "in", "dry_bulb_condition", ".", "h...
Get a list of dew points (C) at each hour over the design day. args: dry_bulb_condition: The dry bulb condition for the day.
[ "Get", "a", "list", "of", "dew", "points", "(", "C", ")", "at", "each", "hour", "over", "the", "design", "day", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L910-L923
ladybug-tools/ladybug
ladybug/designday.py
HumidityCondition.dew_point
def dew_point(self, db): """Get the dew point (C), which is constant throughout the day (except at saturation). args: db: The maximum dry bulb temperature over the day. """ if self._hum_type == 'Dewpoint': return self._hum_value elif self._hum_type == 'We...
python
def dew_point(self, db): """Get the dew point (C), which is constant throughout the day (except at saturation). args: db: The maximum dry bulb temperature over the day. """ if self._hum_type == 'Dewpoint': return self._hum_value elif self._hum_type == 'We...
[ "def", "dew_point", "(", "self", ",", "db", ")", ":", "if", "self", ".", "_hum_type", "==", "'Dewpoint'", ":", "return", "self", ".", "_hum_value", "elif", "self", ".", "_hum_type", "==", "'Wetbulb'", ":", "return", "dew_point_from_db_wb", "(", "db", ",", ...
Get the dew point (C), which is constant throughout the day (except at saturation). args: db: The maximum dry bulb temperature over the day.
[ "Get", "the", "dew", "point", "(", "C", ")", "which", "is", "constant", "throughout", "the", "day", "(", "except", "at", "saturation", ")", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L925-L941
ladybug-tools/ladybug
ladybug/designday.py
HumidityCondition.to_json
def to_json(self): """Convert the Humidity Condition to a dictionary.""" return { 'hum_type': self.hum_type, 'hum_value': self.hum_value, 'barometric_pressure': self.barometric_pressure, 'schedule': self.schedule, 'wet_bulb_range': self.wet_bul...
python
def to_json(self): """Convert the Humidity Condition to a dictionary.""" return { 'hum_type': self.hum_type, 'hum_value': self.hum_value, 'barometric_pressure': self.barometric_pressure, 'schedule': self.schedule, 'wet_bulb_range': self.wet_bul...
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'hum_type'", ":", "self", ".", "hum_type", ",", "'hum_value'", ":", "self", ".", "hum_value", ",", "'barometric_pressure'", ":", "self", ".", "barometric_pressure", ",", "'schedule'", ":", "self", ".",...
Convert the Humidity Condition to a dictionary.
[ "Convert", "the", "Humidity", "Condition", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L991-L999
ladybug-tools/ladybug
ladybug/designday.py
WindCondition.from_json
def from_json(cls, data): """Create a Wind Condition from a dictionary. Args: data = { "wind_speed": float, "wind_direction": float, "rain": bool, "snow_on_ground": bool} """ # Check required and optional keys optional_...
python
def from_json(cls, data): """Create a Wind Condition from a dictionary. Args: data = { "wind_speed": float, "wind_direction": float, "rain": bool, "snow_on_ground": bool} """ # Check required and optional keys optional_...
[ "def", "from_json", "(", "cls", ",", "data", ")", ":", "# Check required and optional keys", "optional_keys", "=", "{", "'wind_direction'", ":", "0", ",", "'rain'", ":", "False", ",", "'snow_on_ground'", ":", "False", "}", "assert", "'wind_speed'", "in", "data",...
Create a Wind Condition from a dictionary. Args: data = { "wind_speed": float, "wind_direction": float, "rain": bool, "snow_on_ground": bool}
[ "Create", "a", "Wind", "Condition", "from", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1029-L1047
ladybug-tools/ladybug
ladybug/designday.py
WindCondition.to_json
def to_json(self): """Convert the Wind Condition to a dictionary.""" return { 'wind_speed': self.wind_speed, 'wind_direction': self.wind_direction, 'rain': self.rain, 'snow_on_ground': self.snow_on_ground }
python
def to_json(self): """Convert the Wind Condition to a dictionary.""" return { 'wind_speed': self.wind_speed, 'wind_direction': self.wind_direction, 'rain': self.rain, 'snow_on_ground': self.snow_on_ground }
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'wind_speed'", ":", "self", ".", "wind_speed", ",", "'wind_direction'", ":", "self", ".", "wind_direction", ",", "'rain'", ":", "self", ".", "rain", ",", "'snow_on_ground'", ":", "self", ".", "snow_o...
Convert the Wind Condition to a dictionary.
[ "Convert", "the", "Wind", "Condition", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1116-L1123
ladybug-tools/ladybug
ladybug/designday.py
SkyCondition.from_json
def from_json(cls, data): """Create a Sky Condition from a dictionary. Args: data = { "solar_model": string, "month": int, "day_of_month": int, "daylight_savings_indicator": string // "Yes" or "No"} """ # Check required and opt...
python
def from_json(cls, data): """Create a Sky Condition from a dictionary. Args: data = { "solar_model": string, "month": int, "day_of_month": int, "daylight_savings_indicator": string // "Yes" or "No"} """ # Check required and opt...
[ "def", "from_json", "(", "cls", ",", "data", ")", ":", "# Check required and optional keys", "required_keys", "=", "(", "'solar_model'", ",", "'month'", ",", "'day_of_month'", ")", "for", "key", "in", "required_keys", ":", "assert", "key", "in", "data", ",", "...
Create a Sky Condition from a dictionary. Args: data = { "solar_model": string, "month": int, "day_of_month": int, "daylight_savings_indicator": string // "Yes" or "No"}
[ "Create", "a", "Sky", "Condition", "from", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1156-L1185
ladybug-tools/ladybug
ladybug/designday.py
SkyCondition._get_datetimes
def _get_datetimes(self, timestep=1): """List of datetimes based on design day date and timestep.""" start_moy = DateTime(self._month, self._day_of_month).moy if timestep == 1: start_moy = start_moy + 30 num_moys = 24 * timestep return tuple( DateTime.from...
python
def _get_datetimes(self, timestep=1): """List of datetimes based on design day date and timestep.""" start_moy = DateTime(self._month, self._day_of_month).moy if timestep == 1: start_moy = start_moy + 30 num_moys = 24 * timestep return tuple( DateTime.from...
[ "def", "_get_datetimes", "(", "self", ",", "timestep", "=", "1", ")", ":", "start_moy", "=", "DateTime", "(", "self", ".", "_month", ",", "self", ".", "_day_of_month", ")", ".", "moy", "if", "timestep", "==", "1", ":", "start_moy", "=", "start_moy", "+...
List of datetimes based on design day date and timestep.
[ "List", "of", "datetimes", "based", "on", "design", "day", "date", "and", "timestep", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1230-L1239
ladybug-tools/ladybug
ladybug/designday.py
SkyCondition.to_json
def to_json(self): """Convert the Sky Condition to a dictionary.""" return { 'solar_model': self.solar_model, 'month': self.month, 'day_of_month': self.day_of_month, 'daylight_savings_indicator': self.daylight_savings_indicator, 'beam_shced': s...
python
def to_json(self): """Convert the Sky Condition to a dictionary.""" return { 'solar_model': self.solar_model, 'month': self.month, 'day_of_month': self.day_of_month, 'daylight_savings_indicator': self.daylight_savings_indicator, 'beam_shced': s...
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'solar_model'", ":", "self", ".", "solar_model", ",", "'month'", ":", "self", ".", "month", ",", "'day_of_month'", ":", "self", ".", "day_of_month", ",", "'daylight_savings_indicator'", ":", "self", "....
Convert the Sky Condition to a dictionary.
[ "Convert", "the", "Sky", "Condition", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1251-L1260
ladybug-tools/ladybug
ladybug/designday.py
OriginalClearSkyCondition.from_analysis_period
def from_analysis_period(cls, analysis_period, clearness=1, daylight_savings_indicator='No'): """"Initialize a OriginalClearSkyCondition from an analysis_period""" _check_analysis_period(analysis_period) return cls(analysis_period.st_month, analysis_period.st_day, cl...
python
def from_analysis_period(cls, analysis_period, clearness=1, daylight_savings_indicator='No'): """"Initialize a OriginalClearSkyCondition from an analysis_period""" _check_analysis_period(analysis_period) return cls(analysis_period.st_month, analysis_period.st_day, cl...
[ "def", "from_analysis_period", "(", "cls", ",", "analysis_period", ",", "clearness", "=", "1", ",", "daylight_savings_indicator", "=", "'No'", ")", ":", "_check_analysis_period", "(", "analysis_period", ")", "return", "cls", "(", "analysis_period", ".", "st_month", ...
Initialize a OriginalClearSkyCondition from an analysis_period
[ "Initialize", "a", "OriginalClearSkyCondition", "from", "an", "analysis_period" ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1289-L1294
ladybug-tools/ladybug
ladybug/designday.py
OriginalClearSkyCondition.from_json
def from_json(cls, data): """Create a Sky Condition from a dictionary. Args: data = { "solar_model": string, "month": int, "day_of_month": int, "clearness": float, "daylight_savings_indicator": string // "Yes" or "No"} """ ...
python
def from_json(cls, data): """Create a Sky Condition from a dictionary. Args: data = { "solar_model": string, "month": int, "day_of_month": int, "clearness": float, "daylight_savings_indicator": string // "Yes" or "No"} """ ...
[ "def", "from_json", "(", "cls", ",", "data", ")", ":", "# Check required and optional keys", "required_keys", "=", "(", "'solar_model'", ",", "'month'", ",", "'day_of_month'", ",", "'clearness'", ")", "for", "key", "in", "required_keys", ":", "assert", "key", "i...
Create a Sky Condition from a dictionary. Args: data = { "solar_model": string, "month": int, "day_of_month": int, "clearness": float, "daylight_savings_indicator": string // "Yes" or "No"}
[ "Create", "a", "Sky", "Condition", "from", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1297-L1316
ladybug-tools/ladybug
ladybug/designday.py
OriginalClearSkyCondition.radiation_values
def radiation_values(self, location, timestep=1): """Lists of driect normal, diffuse horiz, and global horiz rad at each timestep. """ # create sunpath and get altitude at every timestep of the design day sp = Sunpath.from_location(location) altitudes = [] dates = self._g...
python
def radiation_values(self, location, timestep=1): """Lists of driect normal, diffuse horiz, and global horiz rad at each timestep. """ # create sunpath and get altitude at every timestep of the design day sp = Sunpath.from_location(location) altitudes = [] dates = self._g...
[ "def", "radiation_values", "(", "self", ",", "location", ",", "timestep", "=", "1", ")", ":", "# create sunpath and get altitude at every timestep of the design day", "sp", "=", "Sunpath", ".", "from_location", "(", "location", ")", "altitudes", "=", "[", "]", "date...
Lists of driect normal, diffuse horiz, and global horiz rad at each timestep.
[ "Lists", "of", "driect", "normal", "diffuse", "horiz", "and", "global", "horiz", "rad", "at", "each", "timestep", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1341-L1355
ladybug-tools/ladybug
ladybug/designday.py
OriginalClearSkyCondition.to_json
def to_json(self): """Convert the Sky Condition to a dictionary.""" return { 'solar_model': self.solar_model, 'month': self.month, 'day_of_month': self.day_of_month, 'clearness': self.clearness, 'daylight_savings_indicator': self.daylight_savin...
python
def to_json(self): """Convert the Sky Condition to a dictionary.""" return { 'solar_model': self.solar_model, 'month': self.month, 'day_of_month': self.day_of_month, 'clearness': self.clearness, 'daylight_savings_indicator': self.daylight_savin...
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'solar_model'", ":", "self", ".", "solar_model", ",", "'month'", ":", "self", ".", "month", ",", "'day_of_month'", ":", "self", ".", "day_of_month", ",", "'clearness'", ":", "self", ".", "clearness",...
Convert the Sky Condition to a dictionary.
[ "Convert", "the", "Sky", "Condition", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1357-L1365
ladybug-tools/ladybug
ladybug/designday.py
RevisedClearSkyCondition.from_analysis_period
def from_analysis_period(cls, analysis_period, tau_b, tau_d, daylight_savings_indicator='No'): """"Initialize a RevisedClearSkyCondition from an analysis_period""" _check_analysis_period(analysis_period) return cls(analysis_period.st_month, analysis_period.st_day, ta...
python
def from_analysis_period(cls, analysis_period, tau_b, tau_d, daylight_savings_indicator='No'): """"Initialize a RevisedClearSkyCondition from an analysis_period""" _check_analysis_period(analysis_period) return cls(analysis_period.st_month, analysis_period.st_day, ta...
[ "def", "from_analysis_period", "(", "cls", ",", "analysis_period", ",", "tau_b", ",", "tau_d", ",", "daylight_savings_indicator", "=", "'No'", ")", ":", "_check_analysis_period", "(", "analysis_period", ")", "return", "cls", "(", "analysis_period", ".", "st_month", ...
Initialize a RevisedClearSkyCondition from an analysis_period
[ "Initialize", "a", "RevisedClearSkyCondition", "from", "an", "analysis_period" ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1387-L1392
ladybug-tools/ladybug
ladybug/designday.py
RevisedClearSkyCondition.to_json
def to_json(self): """Convert the Sky Condition to a dictionary.""" return { 'solar_model': self.solar_model, 'month': self.month, 'day_of_month': self.day_of_month, 'tau_b': self.tau_b, 'tau_d': self.tau_d, 'daylight_savings_indica...
python
def to_json(self): """Convert the Sky Condition to a dictionary.""" return { 'solar_model': self.solar_model, 'month': self.month, 'day_of_month': self.day_of_month, 'tau_b': self.tau_b, 'tau_d': self.tau_d, 'daylight_savings_indica...
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'solar_model'", ":", "self", ".", "solar_model", ",", "'month'", ":", "self", ".", "month", ",", "'day_of_month'", ":", "self", ".", "day_of_month", ",", "'tau_b'", ":", "self", ".", "tau_b", ",", ...
Convert the Sky Condition to a dictionary.
[ "Convert", "the", "Sky", "Condition", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/designday.py#L1455-L1464
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.from_json
def from_json(cls, data): """Create a Data Collection from a dictionary. Args: { "header": A Ladybug Header, "values": An array of values, "datetimes": An array of datetimes, "validated_a_period": Boolean for whether header ana...
python
def from_json(cls, data): """Create a Data Collection from a dictionary. Args: { "header": A Ladybug Header, "values": An array of values, "datetimes": An array of datetimes, "validated_a_period": Boolean for whether header ana...
[ "def", "from_json", "(", "cls", ",", "data", ")", ":", "assert", "'header'", "in", "data", ",", "'Required keyword \"header\" is missing!'", "assert", "'values'", "in", "data", ",", "'Required keyword \"values\" is missing!'", "assert", "'datetimes'", "in", "data", ",...
Create a Data Collection from a dictionary. Args: { "header": A Ladybug Header, "values": An array of values, "datetimes": An array of datetimes, "validated_a_period": Boolean for whether header analysis_period is valid }
[ "Create", "a", "Data", "Collection", "from", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L49-L66
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.convert_to_unit
def convert_to_unit(self, unit): """Convert the Data Collection to the input unit.""" self._values = self._header.data_type.to_unit( self._values, unit, self._header.unit) self._header._unit = unit
python
def convert_to_unit(self, unit): """Convert the Data Collection to the input unit.""" self._values = self._header.data_type.to_unit( self._values, unit, self._header.unit) self._header._unit = unit
[ "def", "convert_to_unit", "(", "self", ",", "unit", ")", ":", "self", ".", "_values", "=", "self", ".", "_header", ".", "data_type", ".", "to_unit", "(", "self", ".", "_values", ",", "unit", ",", "self", ".", "_header", ".", "unit", ")", "self", ".",...
Convert the Data Collection to the input unit.
[ "Convert", "the", "Data", "Collection", "to", "the", "input", "unit", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L126-L130
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.convert_to_ip
def convert_to_ip(self): """Convert the Data Collection to IP units.""" self._values, self._header._unit = self._header.data_type.to_ip( self._values, self._header.unit)
python
def convert_to_ip(self): """Convert the Data Collection to IP units.""" self._values, self._header._unit = self._header.data_type.to_ip( self._values, self._header.unit)
[ "def", "convert_to_ip", "(", "self", ")", ":", "self", ".", "_values", ",", "self", ".", "_header", ".", "_unit", "=", "self", ".", "_header", ".", "data_type", ".", "to_ip", "(", "self", ".", "_values", ",", "self", ".", "_header", ".", "unit", ")" ...
Convert the Data Collection to IP units.
[ "Convert", "the", "Data", "Collection", "to", "IP", "units", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L132-L135
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.convert_to_si
def convert_to_si(self): """Convert the Data Collection to SI units.""" self._values, self._header._unit = self._header.data_type.to_si( self._values, self._header.unit)
python
def convert_to_si(self): """Convert the Data Collection to SI units.""" self._values, self._header._unit = self._header.data_type.to_si( self._values, self._header.unit)
[ "def", "convert_to_si", "(", "self", ")", ":", "self", ".", "_values", ",", "self", ".", "_header", ".", "_unit", "=", "self", ".", "_header", ".", "data_type", ".", "to_si", "(", "self", ".", "_values", ",", "self", ".", "_header", ".", "unit", ")" ...
Convert the Data Collection to SI units.
[ "Convert", "the", "Data", "Collection", "to", "SI", "units", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L137-L140
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.to_unit
def to_unit(self, unit): """Return a Data Collection in the input unit.""" new_data_c = self.duplicate() new_data_c.convert_to_unit(unit) return new_data_c
python
def to_unit(self, unit): """Return a Data Collection in the input unit.""" new_data_c = self.duplicate() new_data_c.convert_to_unit(unit) return new_data_c
[ "def", "to_unit", "(", "self", ",", "unit", ")", ":", "new_data_c", "=", "self", ".", "duplicate", "(", ")", "new_data_c", ".", "convert_to_unit", "(", "unit", ")", "return", "new_data_c" ]
Return a Data Collection in the input unit.
[ "Return", "a", "Data", "Collection", "in", "the", "input", "unit", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L142-L146
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.is_in_data_type_range
def is_in_data_type_range(self, raise_exception=True): """Check if collection values are in physically possible ranges for the data_type. If this method returns False, the Data Collection's data is physically or mathematically impossible for the data_type.""" return self._header.data_ty...
python
def is_in_data_type_range(self, raise_exception=True): """Check if collection values are in physically possible ranges for the data_type. If this method returns False, the Data Collection's data is physically or mathematically impossible for the data_type.""" return self._header.data_ty...
[ "def", "is_in_data_type_range", "(", "self", ",", "raise_exception", "=", "True", ")", ":", "return", "self", ".", "_header", ".", "data_type", ".", "is_in_range", "(", "self", ".", "_values", ",", "self", ".", "_header", ".", "unit", ",", "raise_exception",...
Check if collection values are in physically possible ranges for the data_type. If this method returns False, the Data Collection's data is physically or mathematically impossible for the data_type.
[ "Check", "if", "collection", "values", "are", "in", "physically", "possible", "ranges", "for", "the", "data_type", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L160-L166
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.get_highest_values
def get_highest_values(self, count): """Get a list of the the x highest values of the Data Collection and their indices. This is useful for situations where one needs to know the times of the year when the largest values of a data collection occur. For example, there is a European dayi...
python
def get_highest_values(self, count): """Get a list of the the x highest values of the Data Collection and their indices. This is useful for situations where one needs to know the times of the year when the largest values of a data collection occur. For example, there is a European dayi...
[ "def", "get_highest_values", "(", "self", ",", "count", ")", ":", "count", "=", "int", "(", "count", ")", "assert", "count", "<=", "len", "(", "self", ".", "_values", ")", ",", "'count must be smaller than or equal to values length. {} > {}.'", ".", "format", "(...
Get a list of the the x highest values of the Data Collection and their indices. This is useful for situations where one needs to know the times of the year when the largest values of a data collection occur. For example, there is a European dayight code that requires an analysis for the hours...
[ "Get", "a", "list", "of", "the", "the", "x", "highest", "values", "of", "the", "Data", "Collection", "and", "their", "indices", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L179-L207
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.get_lowest_values
def get_lowest_values(self, count): """Get a list of the the x lowest values of the Data Collection and their indices. This is useful for situations where one needs to know the times of the year when the smallest values of a data collection occur. Args: count: Integer repre...
python
def get_lowest_values(self, count): """Get a list of the the x lowest values of the Data Collection and their indices. This is useful for situations where one needs to know the times of the year when the smallest values of a data collection occur. Args: count: Integer repre...
[ "def", "get_lowest_values", "(", "self", ",", "count", ")", ":", "count", "=", "int", "(", "count", ")", "assert", "count", "<=", "len", "(", "self", ".", "_values", ")", ",", "'count must be <= to Data Collection len. {} > {}.'", ".", "format", "(", "count", ...
Get a list of the the x lowest values of the Data Collection and their indices. This is useful for situations where one needs to know the times of the year when the smallest values of a data collection occur. Args: count: Integer representing the number of lowest values to account ...
[ "Get", "a", "list", "of", "the", "the", "x", "lowest", "values", "of", "the", "Data", "Collection", "and", "their", "indices", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L209-L233
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.get_percentile
def get_percentile(self, percentile): """Get a value representing a the input percentile of the Data Collection. Args: percentile: A float value from 0 to 100 representing the requested percentile. Return: The Data Collection value at the input percentil...
python
def get_percentile(self, percentile): """Get a value representing a the input percentile of the Data Collection. Args: percentile: A float value from 0 to 100 representing the requested percentile. Return: The Data Collection value at the input percentil...
[ "def", "get_percentile", "(", "self", ",", "percentile", ")", ":", "assert", "0", "<=", "percentile", "<=", "100", ",", "'percentile must be between 0 and 100. Got {}'", ".", "format", "(", "percentile", ")", "return", "self", ".", "_percentile", "(", "self", "....
Get a value representing a the input percentile of the Data Collection. Args: percentile: A float value from 0 to 100 representing the requested percentile. Return: The Data Collection value at the input percentile
[ "Get", "a", "value", "representing", "a", "the", "input", "percentile", "of", "the", "Data", "Collection", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L235-L247
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.filter_by_conditional_statement
def filter_by_conditional_statement(self, statement): """Filter the Data Collection based on a conditional statement. Args: statement: A conditional statement as a string (e.g. a > 25 and a%5 == 0). The variable should always be named as 'a' (without quotations). Re...
python
def filter_by_conditional_statement(self, statement): """Filter the Data Collection based on a conditional statement. Args: statement: A conditional statement as a string (e.g. a > 25 and a%5 == 0). The variable should always be named as 'a' (without quotations). Re...
[ "def", "filter_by_conditional_statement", "(", "self", ",", "statement", ")", ":", "_filt_values", ",", "_filt_datetimes", "=", "self", ".", "_filter_by_statement", "(", "statement", ")", "if", "self", ".", "_enumeration", "is", "None", ":", "self", ".", "_get_m...
Filter the Data Collection based on a conditional statement. Args: statement: A conditional statement as a string (e.g. a > 25 and a%5 == 0). The variable should always be named as 'a' (without quotations). Return: A new Data Collection containing only the filte...
[ "Filter", "the", "Data", "Collection", "based", "on", "a", "conditional", "statement", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L249-L265
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.filter_by_pattern
def filter_by_pattern(self, pattern): """Filter the Data Collection based on a list of booleans. Args: pattern: A list of True/False values. Typically, this is a list with a length matching the length of the Data Collections values but it can also be a patte...
python
def filter_by_pattern(self, pattern): """Filter the Data Collection based on a list of booleans. Args: pattern: A list of True/False values. Typically, this is a list with a length matching the length of the Data Collections values but it can also be a patte...
[ "def", "filter_by_pattern", "(", "self", ",", "pattern", ")", ":", "_filt_values", ",", "_filt_datetimes", "=", "self", ".", "_filter_by_pattern", "(", "pattern", ")", "if", "self", ".", "_enumeration", "is", "None", ":", "self", ".", "_get_mutable_enumeration",...
Filter the Data Collection based on a list of booleans. Args: pattern: A list of True/False values. Typically, this is a list with a length matching the length of the Data Collections values but it can also be a pattern to be repeated over the Data Collection. ...
[ "Filter", "the", "Data", "Collection", "based", "on", "a", "list", "of", "booleans", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L267-L284
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.is_collection_aligned
def is_collection_aligned(self, data_collection): """Check if this Data Collection is aligned with another. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. Args: data_collection: The Data Collection...
python
def is_collection_aligned(self, data_collection): """Check if this Data Collection is aligned with another. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. Args: data_collection: The Data Collection...
[ "def", "is_collection_aligned", "(", "self", ",", "data_collection", ")", ":", "if", "self", ".", "_collection_type", "!=", "data_collection", ".", "_collection_type", ":", "return", "False", "elif", "len", "(", "self", ".", "values", ")", "!=", "len", "(", ...
Check if this Data Collection is aligned with another. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. Args: data_collection: The Data Collection which you want to test if this collection is...
[ "Check", "if", "this", "Data", "Collection", "is", "aligned", "with", "another", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L286-L306
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.get_aligned_collection
def get_aligned_collection(self, value=0, data_type=None, unit=None, mutable=None): """Return a Collection aligned with this one composed of one repeated value. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. A...
python
def get_aligned_collection(self, value=0, data_type=None, unit=None, mutable=None): """Return a Collection aligned with this one composed of one repeated value. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. A...
[ "def", "get_aligned_collection", "(", "self", ",", "value", "=", "0", ",", "data_type", "=", "None", ",", "unit", "=", "None", ",", "mutable", "=", "None", ")", ":", "# set up the header of the new collection", "header", "=", "self", ".", "_check_aligned_header"...
Return a Collection aligned with this one composed of one repeated value. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. Args: value: A value to be repeated in the aliged collection values or ...
[ "Return", "a", "Collection", "aligned", "with", "this", "one", "composed", "of", "one", "repeated", "value", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L308-L346
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.duplicate
def duplicate(self): """Return a copy of the current Data Collection.""" collection = self.__class__(self.header.duplicate(), self.values, self.datetimes) collection._validated_a_period = self._validated_a_period return collection
python
def duplicate(self): """Return a copy of the current Data Collection.""" collection = self.__class__(self.header.duplicate(), self.values, self.datetimes) collection._validated_a_period = self._validated_a_period return collection
[ "def", "duplicate", "(", "self", ")", ":", "collection", "=", "self", ".", "__class__", "(", "self", ".", "header", ".", "duplicate", "(", ")", ",", "self", ".", "values", ",", "self", ".", "datetimes", ")", "collection", ".", "_validated_a_period", "=",...
Return a copy of the current Data Collection.
[ "Return", "a", "copy", "of", "the", "current", "Data", "Collection", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L348-L352
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.to_json
def to_json(self): """Convert Data Collection to a dictionary.""" return { 'header': self.header.to_json(), 'values': self._values, 'datetimes': self.datetimes, 'validated_a_period': self._validated_a_period }
python
def to_json(self): """Convert Data Collection to a dictionary.""" return { 'header': self.header.to_json(), 'values': self._values, 'datetimes': self.datetimes, 'validated_a_period': self._validated_a_period }
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'header'", ":", "self", ".", "header", ".", "to_json", "(", ")", ",", "'values'", ":", "self", ".", "_values", ",", "'datetimes'", ":", "self", ".", "datetimes", ",", "'validated_a_period'", ":", ...
Convert Data Collection to a dictionary.
[ "Convert", "Data", "Collection", "to", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L354-L361
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.filter_collections_by_statement
def filter_collections_by_statement(data_collections, statement): """Generate a filtered data collections according to a conditional statement. Args: data_collections: A list of aligned Data Collections to be evaluated against the statement. statement: A conditio...
python
def filter_collections_by_statement(data_collections, statement): """Generate a filtered data collections according to a conditional statement. Args: data_collections: A list of aligned Data Collections to be evaluated against the statement. statement: A conditio...
[ "def", "filter_collections_by_statement", "(", "data_collections", ",", "statement", ")", ":", "pattern", "=", "BaseCollection", ".", "pattern_from_collections_and_statement", "(", "data_collections", ",", "statement", ")", "collections", "=", "[", "coll", ".", "filter_...
Generate a filtered data collections according to a conditional statement. Args: data_collections: A list of aligned Data Collections to be evaluated against the statement. statement: A conditional statement as a string (e.g. a>25 and a%5==0). The variabl...
[ "Generate", "a", "filtered", "data", "collections", "according", "to", "a", "conditional", "statement", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L364-L380
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.pattern_from_collections_and_statement
def pattern_from_collections_and_statement(data_collections, statement): """Generate a list of booleans from data collections and a conditional statement. Args: data_collections: A list of aligned Data Collections to be evaluated against the statement. statement:...
python
def pattern_from_collections_and_statement(data_collections, statement): """Generate a list of booleans from data collections and a conditional statement. Args: data_collections: A list of aligned Data Collections to be evaluated against the statement. statement:...
[ "def", "pattern_from_collections_and_statement", "(", "data_collections", ",", "statement", ")", ":", "BaseCollection", ".", "are_collections_aligned", "(", "data_collections", ")", "correct_var", "=", "BaseCollection", ".", "_check_conditional_statement", "(", "statement", ...
Generate a list of booleans from data collections and a conditional statement. Args: data_collections: A list of aligned Data Collections to be evaluated against the statement. statement: A conditional statement as a string (e.g. a>25 and a%5==0). The var...
[ "Generate", "a", "list", "of", "booleans", "from", "data", "collections", "and", "a", "conditional", "statement", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L383-L415
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.are_collections_aligned
def are_collections_aligned(data_collections, raise_exception=True): """Test if a series of Data Collections are aligned with one another. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. Args: data_...
python
def are_collections_aligned(data_collections, raise_exception=True): """Test if a series of Data Collections are aligned with one another. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. Args: data_...
[ "def", "are_collections_aligned", "(", "data_collections", ",", "raise_exception", "=", "True", ")", ":", "if", "len", "(", "data_collections", ")", ">", "1", ":", "first_coll", "=", "data_collections", "[", "0", "]", "for", "coll", "in", "data_collections", "...
Test if a series of Data Collections are aligned with one another. Aligned Data Collections are of the same Data Collection class, have the same number of values and have matching datetimes. Args: data_collections: A list of Data Collections for which you want to te...
[ "Test", "if", "a", "series", "of", "Data", "Collections", "are", "aligned", "with", "one", "another", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L418-L441
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection.compute_function_aligned
def compute_function_aligned(funct, data_collections, data_type, unit): """Compute a function with a list of aligned data collections or individual values. Args: funct: A function with a single numerical value as output and one or more numerical values as input. ...
python
def compute_function_aligned(funct, data_collections, data_type, unit): """Compute a function with a list of aligned data collections or individual values. Args: funct: A function with a single numerical value as output and one or more numerical values as input. ...
[ "def", "compute_function_aligned", "(", "funct", ",", "data_collections", ",", "data_type", ",", "unit", ")", ":", "# check that all inputs are either data collections or floats", "data_colls", "=", "[", "]", "for", "i", ",", "func_input", "in", "enumerate", "(", "dat...
Compute a function with a list of aligned data collections or individual values. Args: funct: A function with a single numerical value as output and one or more numerical values as input. data_collections: A list with a length equal to the number of arguments ...
[ "Compute", "a", "function", "with", "a", "list", "of", "aligned", "data", "collections", "or", "individual", "values", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L444-L500
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection._check_conditional_statement
def _check_conditional_statement(statement, num_collections): """Method to check conditional statements to be sure that they are valid. Args: statement: A conditional statement as a string (e.g. a>25 and a%5==0). The variable should always be named as 'a' (without quotations...
python
def _check_conditional_statement(statement, num_collections): """Method to check conditional statements to be sure that they are valid. Args: statement: A conditional statement as a string (e.g. a>25 and a%5==0). The variable should always be named as 'a' (without quotations...
[ "def", "_check_conditional_statement", "(", "statement", ",", "num_collections", ")", ":", "# Determine what the list of variables should be based on the num_collections", "correct_var", "=", "list", "(", "ascii_lowercase", ")", "[", ":", "num_collections", "]", "# Clean out th...
Method to check conditional statements to be sure that they are valid. Args: statement: A conditional statement as a string (e.g. a>25 and a%5==0). The variable should always be named as 'a' (without quotations). num_collections: An integer representing the number of dat...
[ "Method", "to", "check", "conditional", "statements", "to", "be", "sure", "that", "they", "are", "valid", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L503-L532
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection._filter_by_statement
def _filter_by_statement(self, statement): """Filter the data collection based on a conditional statement.""" self.__class__._check_conditional_statement(statement, 1) _filt_values, _filt_datetimes = [], [] for i, a in enumerate(self._values): if eval(statement, {'a': a}): ...
python
def _filter_by_statement(self, statement): """Filter the data collection based on a conditional statement.""" self.__class__._check_conditional_statement(statement, 1) _filt_values, _filt_datetimes = [], [] for i, a in enumerate(self._values): if eval(statement, {'a': a}): ...
[ "def", "_filter_by_statement", "(", "self", ",", "statement", ")", ":", "self", ".", "__class__", ".", "_check_conditional_statement", "(", "statement", ",", "1", ")", "_filt_values", ",", "_filt_datetimes", "=", "[", "]", ",", "[", "]", "for", "i", ",", "...
Filter the data collection based on a conditional statement.
[ "Filter", "the", "data", "collection", "based", "on", "a", "conditional", "statement", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L552-L560
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection._filter_by_pattern
def _filter_by_pattern(self, pattern): """Filter the Filter the Data Collection based on a list of booleans.""" try: _len = len(pattern) except TypeError: raise TypeError("pattern is not a list of Booleans. Got {}".format( type(pattern))) _filt_val...
python
def _filter_by_pattern(self, pattern): """Filter the Filter the Data Collection based on a list of booleans.""" try: _len = len(pattern) except TypeError: raise TypeError("pattern is not a list of Booleans. Got {}".format( type(pattern))) _filt_val...
[ "def", "_filter_by_pattern", "(", "self", ",", "pattern", ")", ":", "try", ":", "_len", "=", "len", "(", "pattern", ")", "except", "TypeError", ":", "raise", "TypeError", "(", "\"pattern is not a list of Booleans. Got {}\"", ".", "format", "(", "type", "(", "p...
Filter the Filter the Data Collection based on a list of booleans.
[ "Filter", "the", "Filter", "the", "Data", "Collection", "based", "on", "a", "list", "of", "booleans", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L562-L571
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection._check_values
def _check_values(self, values): """Check values whenever they come through the values setter.""" assert isinstance(values, Iterable) and not \ isinstance(values, (str, dict, bytes, bytearray)), \ 'values should be a list or tuple. Got {}'.format(type(values)) assert len(...
python
def _check_values(self, values): """Check values whenever they come through the values setter.""" assert isinstance(values, Iterable) and not \ isinstance(values, (str, dict, bytes, bytearray)), \ 'values should be a list or tuple. Got {}'.format(type(values)) assert len(...
[ "def", "_check_values", "(", "self", ",", "values", ")", ":", "assert", "isinstance", "(", "values", ",", "Iterable", ")", "and", "not", "isinstance", "(", "values", ",", "(", "str", ",", "dict", ",", "bytes", ",", "bytearray", ")", ")", ",", "'values ...
Check values whenever they come through the values setter.
[ "Check", "values", "whenever", "they", "come", "through", "the", "values", "setter", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L573-L581
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection._check_aligned_header
def _check_aligned_header(self, data_type, unit): """Check the header inputs whenever get_aligned_collection is called.""" if data_type is not None: assert isinstance(data_type, DataTypeBase), \ 'data_type must be a Ladybug DataType. Got {}'.format(type(data_type)) ...
python
def _check_aligned_header(self, data_type, unit): """Check the header inputs whenever get_aligned_collection is called.""" if data_type is not None: assert isinstance(data_type, DataTypeBase), \ 'data_type must be a Ladybug DataType. Got {}'.format(type(data_type)) ...
[ "def", "_check_aligned_header", "(", "self", ",", "data_type", ",", "unit", ")", ":", "if", "data_type", "is", "not", "None", ":", "assert", "isinstance", "(", "data_type", ",", "DataTypeBase", ")", ",", "'data_type must be a Ladybug DataType. Got {}'", ".", "form...
Check the header inputs whenever get_aligned_collection is called.
[ "Check", "the", "header", "inputs", "whenever", "get_aligned_collection", "is", "called", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L583-L593
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection._check_aligned_value
def _check_aligned_value(self, value): """Check the value input whenever get_aligned_collection is called.""" if isinstance(value, Iterable) and not isinstance( value, (str, dict, bytes, bytearray)): assert len(value) == len(self._values), "Length of value ({}) must match "\ ...
python
def _check_aligned_value(self, value): """Check the value input whenever get_aligned_collection is called.""" if isinstance(value, Iterable) and not isinstance( value, (str, dict, bytes, bytearray)): assert len(value) == len(self._values), "Length of value ({}) must match "\ ...
[ "def", "_check_aligned_value", "(", "self", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "Iterable", ")", "and", "not", "isinstance", "(", "value", ",", "(", "str", ",", "dict", ",", "bytes", ",", "bytearray", ")", ")", ":", "assert",...
Check the value input whenever get_aligned_collection is called.
[ "Check", "the", "value", "input", "whenever", "get_aligned_collection", "is", "called", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L595-L605
ladybug-tools/ladybug
ladybug/_datacollectionbase.py
BaseCollection._percentile
def _percentile(self, values, percent, key=lambda x: x): """Find the percentile of a list of values. Args: values: A list of values for which percentiles are desired percent: A float value from 0 to 100 representing the requested percentile. key: optional key functio...
python
def _percentile(self, values, percent, key=lambda x: x): """Find the percentile of a list of values. Args: values: A list of values for which percentiles are desired percent: A float value from 0 to 100 representing the requested percentile. key: optional key functio...
[ "def", "_percentile", "(", "self", ",", "values", ",", "percent", ",", "key", "=", "lambda", "x", ":", "x", ")", ":", "vals", "=", "sorted", "(", "values", ")", "k", "=", "(", "len", "(", "vals", ")", "-", "1", ")", "*", "(", "percent", "/", ...
Find the percentile of a list of values. Args: values: A list of values for which percentiles are desired percent: A float value from 0 to 100 representing the requested percentile. key: optional key function to compute value from each element of N. Return: ...
[ "Find", "the", "percentile", "of", "a", "list", "of", "values", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/_datacollectionbase.py#L607-L626
ladybug-tools/ladybug
ladybug/datatype/mass.py
Mass.to_ip
def to_ip(self, values, from_unit): """Return values in IP and the units to which the values have been converted.""" if from_unit in self.ip_units: return values, from_unit elif from_unit == 'tonne': return self.to_unit(values, 'ton', from_unit), 'ton' else: ...
python
def to_ip(self, values, from_unit): """Return values in IP and the units to which the values have been converted.""" if from_unit in self.ip_units: return values, from_unit elif from_unit == 'tonne': return self.to_unit(values, 'ton', from_unit), 'ton' else: ...
[ "def", "to_ip", "(", "self", ",", "values", ",", "from_unit", ")", ":", "if", "from_unit", "in", "self", ".", "ip_units", ":", "return", "values", ",", "from_unit", "elif", "from_unit", "==", "'tonne'", ":", "return", "self", ".", "to_unit", "(", "values...
Return values in IP and the units to which the values have been converted.
[ "Return", "values", "in", "IP", "and", "the", "units", "to", "which", "the", "values", "have", "been", "converted", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/datatype/mass.py#L50-L57
ladybug-tools/ladybug
ladybug/datatype/mass.py
Mass.to_si
def to_si(self, values, from_unit): """Return values in SI and the units to which the values have been converted.""" if from_unit in self.si_units: return values, from_unit elif from_unit == 'ton': return self.to_unit(values, 'tonne', from_unit), 'tonne' else: ...
python
def to_si(self, values, from_unit): """Return values in SI and the units to which the values have been converted.""" if from_unit in self.si_units: return values, from_unit elif from_unit == 'ton': return self.to_unit(values, 'tonne', from_unit), 'tonne' else: ...
[ "def", "to_si", "(", "self", ",", "values", ",", "from_unit", ")", ":", "if", "from_unit", "in", "self", ".", "si_units", ":", "return", "values", ",", "from_unit", "elif", "from_unit", "==", "'ton'", ":", "return", "self", ".", "to_unit", "(", "values",...
Return values in SI and the units to which the values have been converted.
[ "Return", "values", "in", "SI", "and", "the", "units", "to", "which", "the", "values", "have", "been", "converted", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/datatype/mass.py#L59-L66
ladybug-tools/ladybug
ladybug/dt.py
DateTime.from_json
def from_json(cls, data): """Creat datetime from a dictionary. Args: data: { 'month': A value for month between 1-12. (Defualt: 1) 'day': A value for day between 1-31. (Defualt: 1) 'hour': A value for hour between 0-23. (Defualt: 0) ...
python
def from_json(cls, data): """Creat datetime from a dictionary. Args: data: { 'month': A value for month between 1-12. (Defualt: 1) 'day': A value for day between 1-31. (Defualt: 1) 'hour': A value for hour between 0-23. (Defualt: 0) ...
[ "def", "from_json", "(", "cls", ",", "data", ")", ":", "if", "'month'", "not", "in", "data", ":", "data", "[", "'month'", "]", "=", "1", "if", "'day'", "not", "in", "data", ":", "data", "[", "'day'", "]", "=", "1", "if", "'hour'", "not", "in", ...
Creat datetime from a dictionary. Args: data: { 'month': A value for month between 1-12. (Defualt: 1) 'day': A value for day between 1-31. (Defualt: 1) 'hour': A value for hour between 0-23. (Defualt: 0) 'minute': A value for month bet...
[ "Creat", "datetime", "from", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/dt.py#L43-L70
ladybug-tools/ladybug
ladybug/dt.py
DateTime.from_hoy
def from_hoy(cls, hoy, leap_year=False): """Create Ladybug Datetime from an hour of the year. Args: hoy: A float value 0 <= and < 8760 """ return cls.from_moy(round(hoy * 60), leap_year)
python
def from_hoy(cls, hoy, leap_year=False): """Create Ladybug Datetime from an hour of the year. Args: hoy: A float value 0 <= and < 8760 """ return cls.from_moy(round(hoy * 60), leap_year)
[ "def", "from_hoy", "(", "cls", ",", "hoy", ",", "leap_year", "=", "False", ")", ":", "return", "cls", ".", "from_moy", "(", "round", "(", "hoy", "*", "60", ")", ",", "leap_year", ")" ]
Create Ladybug Datetime from an hour of the year. Args: hoy: A float value 0 <= and < 8760
[ "Create", "Ladybug", "Datetime", "from", "an", "hour", "of", "the", "year", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/dt.py#L73-L79
ladybug-tools/ladybug
ladybug/dt.py
DateTime.from_moy
def from_moy(cls, moy, leap_year=False): """Create Ladybug Datetime from a minute of the year. Args: moy: An integer value 0 <= and < 525600 """ if not leap_year: num_of_minutes_until_month = (0, 44640, 84960, 129600, 172800, 217440, ...
python
def from_moy(cls, moy, leap_year=False): """Create Ladybug Datetime from a minute of the year. Args: moy: An integer value 0 <= and < 525600 """ if not leap_year: num_of_minutes_until_month = (0, 44640, 84960, 129600, 172800, 217440, ...
[ "def", "from_moy", "(", "cls", ",", "moy", ",", "leap_year", "=", "False", ")", ":", "if", "not", "leap_year", ":", "num_of_minutes_until_month", "=", "(", "0", ",", "44640", ",", "84960", ",", "129600", ",", "172800", ",", "217440", ",", "260640", ","...
Create Ladybug Datetime from a minute of the year. Args: moy: An integer value 0 <= and < 525600
[ "Create", "Ladybug", "Datetime", "from", "a", "minute", "of", "the", "year", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/dt.py#L82-L112
ladybug-tools/ladybug
ladybug/dt.py
DateTime.from_date_time_string
def from_date_time_string(cls, datetime_string, leap_year=False): """Create Ladybug DateTime from a DateTime string. Usage: dt = DateTime.from_date_time_string("31 Dec 12:00") """ dt = datetime.strptime(datetime_string, '%d %b %H:%M') return cls(dt.month, dt.day, dt...
python
def from_date_time_string(cls, datetime_string, leap_year=False): """Create Ladybug DateTime from a DateTime string. Usage: dt = DateTime.from_date_time_string("31 Dec 12:00") """ dt = datetime.strptime(datetime_string, '%d %b %H:%M') return cls(dt.month, dt.day, dt...
[ "def", "from_date_time_string", "(", "cls", ",", "datetime_string", ",", "leap_year", "=", "False", ")", ":", "dt", "=", "datetime", ".", "strptime", "(", "datetime_string", ",", "'%d %b %H:%M'", ")", "return", "cls", "(", "dt", ".", "month", ",", "dt", "....
Create Ladybug DateTime from a DateTime string. Usage: dt = DateTime.from_date_time_string("31 Dec 12:00")
[ "Create", "Ladybug", "DateTime", "from", "a", "DateTime", "string", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/dt.py#L115-L123
ladybug-tools/ladybug
ladybug/dt.py
DateTime._calculate_hour_and_minute
def _calculate_hour_and_minute(float_hour): """Calculate hour and minutes as integers from a float hour.""" hour, minute = int(float_hour), int(round((float_hour - int(float_hour)) * 60)) if minute == 60: return hour + 1, 0 else: return hour, minute
python
def _calculate_hour_and_minute(float_hour): """Calculate hour and minutes as integers from a float hour.""" hour, minute = int(float_hour), int(round((float_hour - int(float_hour)) * 60)) if minute == 60: return hour + 1, 0 else: return hour, minute
[ "def", "_calculate_hour_and_minute", "(", "float_hour", ")", ":", "hour", ",", "minute", "=", "int", "(", "float_hour", ")", ",", "int", "(", "round", "(", "(", "float_hour", "-", "int", "(", "float_hour", ")", ")", "*", "60", ")", ")", "if", "minute",...
Calculate hour and minutes as integers from a float hour.
[ "Calculate", "hour", "and", "minutes", "as", "integers", "from", "a", "float", "hour", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/dt.py#L159-L165
ladybug-tools/ladybug
ladybug/dt.py
DateTime.add_minute
def add_minute(self, minute): """Create a new DateTime after the minutes are added. Args: minute: An integer value for minutes. """ _moy = self.moy + int(minute) return self.__class__.from_moy(_moy)
python
def add_minute(self, minute): """Create a new DateTime after the minutes are added. Args: minute: An integer value for minutes. """ _moy = self.moy + int(minute) return self.__class__.from_moy(_moy)
[ "def", "add_minute", "(", "self", ",", "minute", ")", ":", "_moy", "=", "self", ".", "moy", "+", "int", "(", "minute", ")", "return", "self", ".", "__class__", ".", "from_moy", "(", "_moy", ")" ]
Create a new DateTime after the minutes are added. Args: minute: An integer value for minutes.
[ "Create", "a", "new", "DateTime", "after", "the", "minutes", "are", "added", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/dt.py#L167-L174
ladybug-tools/ladybug
ladybug/dt.py
DateTime.to_json
def to_json(self): """Get date time as a dictionary.""" return {'year': self.year, 'month': self.month, 'day': self.day, 'hour': self.hour, 'minute': self.minute}
python
def to_json(self): """Get date time as a dictionary.""" return {'year': self.year, 'month': self.month, 'day': self.day, 'hour': self.hour, 'minute': self.minute}
[ "def", "to_json", "(", "self", ")", ":", "return", "{", "'year'", ":", "self", ".", "year", ",", "'month'", ":", "self", ".", "month", ",", "'day'", ":", "self", ".", "day", ",", "'hour'", ":", "self", ".", "hour", ",", "'minute'", ":", "self", "...
Get date time as a dictionary.
[ "Get", "date", "time", "as", "a", "dictionary", "." ]
train
https://github.com/ladybug-tools/ladybug/blob/c08b7308077a48d5612f644943f92d5b5dade583/ladybug/dt.py#L208-L214
Neurosim-lab/netpyne
netpyne/support/scalebar.py
add_scalebar
def add_scalebar(ax, matchx=True, matchy=True, hidex=True, hidey=True, unitsx='', unitsy='', scalex=1, scaley=1, **kwargs): """ Add scalebars to axes Adds a set of scale bars to *ax*, matching the size to the ticks of the plot and optionally hiding the x and y axes - ax : the axis to attach ticks to ...
python
def add_scalebar(ax, matchx=True, matchy=True, hidex=True, hidey=True, unitsx='', unitsy='', scalex=1, scaley=1, **kwargs): """ Add scalebars to axes Adds a set of scale bars to *ax*, matching the size to the ticks of the plot and optionally hiding the x and y axes - ax : the axis to attach ticks to ...
[ "def", "add_scalebar", "(", "ax", ",", "matchx", "=", "True", ",", "matchy", "=", "True", ",", "hidex", "=", "True", ",", "hidey", "=", "True", ",", "unitsx", "=", "''", ",", "unitsy", "=", "''", ",", "scalex", "=", "1", ",", "scaley", "=", "1", ...
Add scalebars to axes Adds a set of scale bars to *ax*, matching the size to the ticks of the plot and optionally hiding the x and y axes - ax : the axis to attach ticks to - matchx,matchy : if True, set size of scale bars to spacing between ticks if False, size should be set using s...
[ "Add", "scalebars", "to", "axes", "Adds", "a", "set", "of", "scale", "bars", "to", "*", "ax", "*", "matching", "the", "size", "to", "the", "ticks", "of", "the", "plot", "and", "optionally", "hiding", "the", "x", "and", "y", "axes", "-", "ax", ":", ...
train
https://github.com/Neurosim-lab/netpyne/blob/edb67b5098b2e7923d55010ded59ad1bf75c0f18/netpyne/support/scalebar.py#L47-L77