text_prompt
stringlengths
157
13.1k
code_prompt
stringlengths
7
19.8k
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def db_dp004(self, value=None): """ Corresponds to IDD Field `db_dp004` mean coincident dry-bulb temperature to Dew-point temperature corresponding to 0.4% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `db_dp004` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `db_dp004`'.format(value)) self._db_dp004 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dp010(self, value=None): """ Corresponds to IDD Field `dp010` Dew-point temperature corresponding to 1.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `dp010` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dp010`'.format(value)) self._dp010 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def hr_dp010(self, value=None): """ Corresponds to IDD Field `hr_dp010` humidity ratio corresponding to Dew-point temperature corresponding to 1.0,% annual cumulative frequency of occurrence calculated at the standard atmospheric pressure at elevation of station Args: value (float): value for IDD Field `hr_dp010` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `hr_dp010`'.format(value)) self._hr_dp010 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def db_dp010(self, value=None): """ Corresponds to IDD Field `db_dp010` mean coincident dry-bulb temperature to Dew-point temperature corresponding to 1.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `db_dp010` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `db_dp010`'.format(value)) self._db_dp010 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dp020(self, value=None): """ Corresponds to IDD Field `dp020` Dew-point temperature corresponding to 2.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `dp020` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dp020`'.format(value)) self._dp020 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def hr_dp020(self, value=None): """ Corresponds to IDD Field `hr_dp020` humidity ratio corresponding to Dew-point temperature corresponding to 2.0% annual cumulative frequency of occurrence calculated at the standard atmospheric pressure at elevation of station Args: value (float): value for IDD Field `hr_dp020` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `hr_dp020`'.format(value)) self._hr_dp020 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def db_dp020(self, value=None): """ Corresponds to IDD Field `db_dp020` mean coincident dry-bulb temperature to Dew-point temperature corresponding to 2.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `db_dp020` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `db_dp020`'.format(value)) self._db_dp020 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def en004(self, value=None): """ Corresponds to IDD Field `en004` mean coincident dry-bulb temperature to Enthalpy corresponding to 0.4% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `en004` Unit: kJ/kg if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `en004`'.format(value)) self._en004 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def db_en004(self, value=None): """ Corresponds to IDD Field `db_en004` mean coincident dry-bulb temperature to Enthalpy corresponding to 0.4% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `db_en004` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `db_en004`'.format(value)) self._db_en004 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def en010(self, value=None): """ Corresponds to IDD Field `en010` mean coincident dry-bulb temperature to Enthalpy corresponding to 1.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `en010` Unit: kJ/kg if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `en010`'.format(value)) self._en010 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def db_en010(self, value=None): """ Corresponds to IDD Field `db_en010` mean coincident dry-bulb temperature to Enthalpy corresponding to 1.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `db_en010` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `db_en010`'.format(value)) self._db_en010 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def en020(self, value=None): """ Corresponds to IDD Field `en020` mean coincident dry-bulb temperature to Enthalpy corresponding to 2.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `en020` Unit: kJ/kg if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `en020`'.format(value)) self._en020 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def db_en020(self, value=None): """ Corresponds to IDD Field `db_en020` mean coincident dry-bulb temperature to Enthalpy corresponding to 2.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `db_en020` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `db_en020`'.format(value)) self._db_en020 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def design_stat_extremes(self, value="Extremes"): """Corresponds to IDD Field `design_stat_extremes` Args: value (str): value for IDD Field `design_stat_extremes` Accepted values are: - Extremes Default value: Extremes if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `design_stat_extremes`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `design_stat_extremes`') vals = set() vals.add("Extremes") if value not in vals: raise ValueError('value {} is not an accepted value for ' 'field `design_stat_extremes`'.format(value)) self._design_stat_extremes = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def ws010(self, value=None): """ Corresponds to IDD Field `ws010` Wind speed corresponding to 1.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `ws010` Unit: m/s if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `ws010`'.format(value)) self._ws010 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def ws025(self, value=None): """ Corresponds to IDD Field `ws025` Wind speed corresponding to 2.5% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `ws025` Unit: m/s if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `ws025`'.format(value)) self._ws025 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def ws050(self, value=None): """ Corresponds to IDD Field `ws050` Wind speed corresponding 5.0% annual cumulative frequency of occurrence Args: value (float): value for IDD Field `ws050` Unit: m/s if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `ws050`'.format(value)) self._ws050 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def wbmax(self, value=None): """ Corresponds to IDD Field `wbmax` Extreme maximum wet-bulb temperature Args: value (float): value for IDD Field `wbmax` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `wbmax`'.format(value)) self._wbmax = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmin_mean(self, value=None): """ Corresponds to IDD Field `dbmin_mean` Mean of extreme annual minimum dry-bulb temperature Args: value (float): value for IDD Field `dbmin_mean` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmin_mean`'.format(value)) self._dbmin_mean = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmax_mean(self, value=None): """ Corresponds to IDD Field `dbmax_mean` Mean of extreme annual maximum dry-bulb temperature Args: value (float): value for IDD Field `dbmax_mean` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmax_mean`'.format(value)) self._dbmax_mean = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmin_stddev(self, value=None): """ Corresponds to IDD Field `dbmin_stddev` Standard deviation of extreme annual minimum dry-bulb temperature Args: value (float): value for IDD Field `dbmin_stddev` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmin_stddev`'.format(value)) self._dbmin_stddev = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmax_stddev(self, value=None): """ Corresponds to IDD Field `dbmax_stddev` Standard deviation of extreme annual maximum dry-bulb temperature Args: value (float): value for IDD Field `dbmax_stddev` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmax_stddev`'.format(value)) self._dbmax_stddev = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmin05years(self, value=None): """ Corresponds to IDD Field `dbmin05years` 5-year return period values for minimum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmin05years` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmin05years`'.format(value)) self._dbmin05years = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmax05years(self, value=None): """ Corresponds to IDD Field `dbmax05years` 5-year return period values for maximum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmax05years` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmax05years`'.format(value)) self._dbmax05years = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmin10years(self, value=None): """ Corresponds to IDD Field `dbmin10years` 10-year return period values for minimum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmin10years` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmin10years`'.format(value)) self._dbmin10years = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmax10years(self, value=None): """ Corresponds to IDD Field `dbmax10years` 10-year return period values for maximum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmax10years` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmax10years`'.format(value)) self._dbmax10years = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmin20years(self, value=None): """ Corresponds to IDD Field `dbmin20years` 20-year return period values for minimum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmin20years` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmin20years`'.format(value)) self._dbmin20years = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmax20years(self, value=None): """ Corresponds to IDD Field `dbmax20years` 20-year return period values for maximum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmax20years` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmax20years`'.format(value)) self._dbmax20years = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmin50years(self, value=None): """ Corresponds to IDD Field `dbmin50years` 50-year return period values for minimum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmin50years` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmin50years`'.format(value)) self._dbmin50years = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dbmax50years(self, value=None): """ Corresponds to IDD Field `dbmax50years` 50-year return period values for maximum extreme dry-bulb temperature Args: value (float): value for IDD Field `dbmax50years` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `dbmax50years`'.format(value)) self._dbmax50years = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def typical_or_extreme_period_name(self, value=None): """Corresponds to IDD Field `typical_or_extreme_period_name` Args: value (str): value for IDD Field `typical_or_extreme_period_name` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `typical_or_extreme_period_name`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `typical_or_extreme_period_name`') self._typical_or_extreme_period_name = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def typical_or_extreme_period_type(self, value=None): """Corresponds to IDD Field `typical_or_extreme_period_type` Args: value (str): value for IDD Field `typical_or_extreme_period_type` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `typical_or_extreme_period_type`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `typical_or_extreme_period_type`') self._typical_or_extreme_period_type = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def period_start_day(self, value=None): """Corresponds to IDD Field `period_start_day` Args: value (str): value for IDD Field `period_start_day` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError('value {} need to be of type str ' 'for field `period_start_day`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `period_start_day`') self._period_start_day = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def period_end_day(self, value=None): """Corresponds to IDD Field `period_end_day` Args: value (str): value for IDD Field `period_end_day` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError('value {} need to be of type str ' 'for field `period_end_day`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `period_end_day`') self._period_end_day = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def ground_temperature_depth(self, value=None): """Corresponds to IDD Field `ground_temperature_depth` Args: value (float): value for IDD Field `ground_temperature_depth` Unit: m if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `ground_temperature_depth`'.format(value)) self._ground_temperature_depth = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_soil_conductivity(self, value=None): """Corresponds to IDD Field `depth_soil_conductivity` Args: value (float): value for IDD Field `depth_soil_conductivity` Unit: W/m-K, if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_soil_conductivity`'.format(value)) self._depth_soil_conductivity = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_soil_density(self, value=None): """Corresponds to IDD Field `depth_soil_density` Args: value (float): value for IDD Field `depth_soil_density` Unit: kg/m3 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_soil_density`'.format(value)) self._depth_soil_density = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_soil_specific_heat(self, value=None): """Corresponds to IDD Field `depth_soil_specific_heat` Args: value (float): value for IDD Field `depth_soil_specific_heat` Unit: J/kg-K, if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_soil_specific_heat`'.format(value)) self._depth_soil_specific_heat = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_january_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_january_average_ground_temperature` Args: value (float): value for IDD Field `depth_january_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_january_average_ground_temperature`'.format(value)) self._depth_january_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_february_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_february_average_ground_temperature` Args: value (float): value for IDD Field `depth_february_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_february_average_ground_temperature`'.format(value)) self._depth_february_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_march_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_march_average_ground_temperature` Args: value (float): value for IDD Field `depth_march_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_march_average_ground_temperature`'.format(value)) self._depth_march_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_april_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_april_average_ground_temperature` Args: value (float): value for IDD Field `depth_april_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_april_average_ground_temperature`'.format(value)) self._depth_april_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_may_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_may_average_ground_temperature` Args: value (float): value for IDD Field `depth_may_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_may_average_ground_temperature`'.format(value)) self._depth_may_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_june_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_june_average_ground_temperature` Args: value (float): value for IDD Field `depth_june_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_june_average_ground_temperature`'.format(value)) self._depth_june_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_july_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_july_average_ground_temperature` Args: value (float): value for IDD Field `depth_july_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_july_average_ground_temperature`'.format(value)) self._depth_july_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_august_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_august_average_ground_temperature` Args: value (float): value for IDD Field `depth_august_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_august_average_ground_temperature`'.format(value)) self._depth_august_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_september_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_september_average_ground_temperature` Args: value (float): value for IDD Field `depth_september_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_september_average_ground_temperature`'.format(value)) self._depth_september_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_october_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_october_average_ground_temperature` Args: value (float): value for IDD Field `depth_october_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_october_average_ground_temperature`'.format(value)) self._depth_october_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_november_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_november_average_ground_temperature` Args: value (float): value for IDD Field `depth_november_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_november_average_ground_temperature`'.format(value)) self._depth_november_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def depth_december_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_december_average_ground_temperature` Args: value (float): value for IDD Field `depth_december_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `depth_december_average_ground_temperature`'.format(value)) self._depth_december_average_ground_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def holiday_name(self, value=None): """Corresponds to IDD Field `holiday_name` Args: value (str): value for IDD Field `holiday_name` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError('value {} need to be of type str ' 'for field `holiday_name`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `holiday_name`') self._holiday_name = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def holiday_day(self, value=None): """Corresponds to IDD Field `holiday_day` Args: value (str): value for IDD Field `holiday_day` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError('value {} need to be of type str ' 'for field `holiday_day`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `holiday_day`') self._holiday_day = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def daylight_saving_start_day(self, value=None): """Corresponds to IDD Field `daylight_saving_start_day` Args: value (str): value for IDD Field `daylight_saving_start_day` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `daylight_saving_start_day`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `daylight_saving_start_day`') self._daylight_saving_start_day = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def daylight_saving_end_day(self, value=None): """Corresponds to IDD Field `daylight_saving_end_day` Args: value (str): value for IDD Field `daylight_saving_end_day` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `daylight_saving_end_day`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `daylight_saving_end_day`') self._daylight_saving_end_day = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def comments_1(self, value=None): """Corresponds to IDD Field `comments_1` Args: value (str): value for IDD Field `comments_1` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError('value {} need to be of type str ' 'for field `comments_1`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `comments_1`') self._comments_1 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def comments_2(self, value=None): """Corresponds to IDD Field `comments_2` Args: value (str): value for IDD Field `comments_2` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError('value {} need to be of type str ' 'for field `comments_2`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `comments_2`') self._comments_2 = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def number_of_records_per_hour(self, value=None): """Corresponds to IDD Field `number_of_records_per_hour` Args: value (int): value for IDD Field `number_of_records_per_hour` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError( 'value {} need to be of type int ' 'for field `number_of_records_per_hour`'.format(value)) self._number_of_records_per_hour = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def data_period_name_or_description(self, value=None): """Corresponds to IDD Field `data_period_name_or_description` Args: value (str): value for IDD Field `data_period_name_or_description` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `data_period_name_or_description`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `data_period_name_or_description`') self._data_period_name_or_description = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def data_period_start_day_of_week(self, value=None): """Corresponds to IDD Field `data_period_start_day_of_week` Args: value (str): value for IDD Field `data_period_start_day_of_week` Accepted values are: - Sunday - Monday - Tuesday - Wednesday - Thursday - Friday - Saturday if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `data_period_start_day_of_week`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `data_period_start_day_of_week`') vals = set() vals.add("Sunday") vals.add("Monday") vals.add("Tuesday") vals.add("Wednesday") vals.add("Thursday") vals.add("Friday") vals.add("Saturday") if value not in vals: raise ValueError( 'value {} is not an accepted value for ' 'field `data_period_start_day_of_week`'.format(value)) self._data_period_start_day_of_week = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def data_period_start_day(self, value=None): """Corresponds to IDD Field `data_period_start_day` Args: value (str): value for IDD Field `data_period_start_day` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `data_period_start_day`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `data_period_start_day`') self._data_period_start_day = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def data_period_end_day(self, value=None): """Corresponds to IDD Field `data_period_end_day` Args: value (str): value for IDD Field `data_period_end_day` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = str(value) except ValueError: raise ValueError( 'value {} need to be of type str ' 'for field `data_period_end_day`'.format(value)) if ',' in value: raise ValueError('value should not contain a comma ' 'for field `data_period_end_day`') self._data_period_end_day = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def year(self, value=None): """Corresponds to IDD Field `year` Args: value (int): value for IDD Field `year` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError('value {} need to be of type int ' 'for field `year`'.format(value)) self._year = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def month(self, value=None): """Corresponds to IDD Field `month` Args: value (int): value for IDD Field `month` value >= 1 value <= 12 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError('value {} need to be of type int ' 'for field `month`'.format(value)) if value < 1: raise ValueError('value need to be greater or equal 1 ' 'for field `month`') if value > 12: raise ValueError('value need to be smaller 12 ' 'for field `month`') self._month = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def day(self, value=None): """Corresponds to IDD Field `day` Args: value (int): value for IDD Field `day` value >= 1 value <= 31 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError('value {} need to be of type int ' 'for field `day`'.format(value)) if value < 1: raise ValueError('value need to be greater or equal 1 ' 'for field `day`') if value > 31: raise ValueError('value need to be smaller 31 ' 'for field `day`') self._day = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def hour(self, value=None): """Corresponds to IDD Field `hour` Args: value (int): value for IDD Field `hour` value >= 1 value <= 24 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError('value {} need to be of type int ' 'for field `hour`'.format(value)) if value < 1: raise ValueError('value need to be greater or equal 1 ' 'for field `hour`') if value > 24: raise ValueError('value need to be smaller 24 ' 'for field `hour`') self._hour = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def minute(self, value=None): """Corresponds to IDD Field `minute` Args: value (int): value for IDD Field `minute` value >= 0 value <= 60 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError('value {} need to be of type int ' 'for field `minute`'.format(value)) if value < 0: raise ValueError('value need to be greater or equal 0 ' 'for field `minute`') if value > 60: raise ValueError('value need to be smaller 60 ' 'for field `minute`') self._minute = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dry_bulb_temperature(self, value=99.9): """Corresponds to IDD Field `dry_bulb_temperature` Args: value (float): value for IDD Field `dry_bulb_temperature` Unit: C value > -70.0 value < 70.0 Missing value: 99.9 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `dry_bulb_temperature`'.format(value)) if value <= -70.0: raise ValueError('value need to be greater -70.0 ' 'for field `dry_bulb_temperature`') if value >= 70.0: raise ValueError('value need to be smaller 70.0 ' 'for field `dry_bulb_temperature`') self._dry_bulb_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def dew_point_temperature(self, value=99.9): """Corresponds to IDD Field `dew_point_temperature` Args: value (float): value for IDD Field `dew_point_temperature` Unit: C value > -70.0 value < 70.0 Missing value: 99.9 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `dew_point_temperature`'.format(value)) if value <= -70.0: raise ValueError('value need to be greater -70.0 ' 'for field `dew_point_temperature`') if value >= 70.0: raise ValueError('value need to be smaller 70.0 ' 'for field `dew_point_temperature`') self._dew_point_temperature = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def relative_humidity(self, value=999): """Corresponds to IDD Field `relative_humidity` Args: value (int): value for IDD Field `relative_humidity` value >= 0 value <= 110 Missing value: 999 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError('value {} need to be of type int ' 'for field `relative_humidity`'.format(value)) if value < 0: raise ValueError('value need to be greater or equal 0 ' 'for field `relative_humidity`') if value > 110: raise ValueError('value need to be smaller 110 ' 'for field `relative_humidity`') self._relative_humidity = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def atmospheric_station_pressure(self, value=999999): """Corresponds to IDD Field `atmospheric_station_pressure` Args: value (int): value for IDD Field `atmospheric_station_pressure` Unit: Pa value > 31000 value < 120000 Missing value: 999999 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError( 'value {} need to be of type int ' 'for field `atmospheric_station_pressure`'.format(value)) if value <= 31000: raise ValueError('value need to be greater 31000 ' 'for field `atmospheric_station_pressure`') if value >= 120000: raise ValueError('value need to be smaller 120000 ' 'for field `atmospheric_station_pressure`') self._atmospheric_station_pressure = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def extraterrestrial_horizontal_radiation(self, value=9999.0): """Corresponds to IDD Field `extraterrestrial_horizontal_radiation` Args: value (float): value for IDD Field `extraterrestrial_horizontal_radiation` Unit: Wh/m2 value >= 0.0 Missing value: 9999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `extraterrestrial_horizontal_radiation`'.format(value)) if value < 0.0: raise ValueError( 'value need to be greater or equal 0.0 ' 'for field `extraterrestrial_horizontal_radiation`') self._extraterrestrial_horizontal_radiation = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def extraterrestrial_direct_normal_radiation(self, value=9999.0): """Corresponds to IDD Field `extraterrestrial_direct_normal_radiation` Args: value (float): value for IDD Field `extraterrestrial_direct_normal_radiation` Unit: Wh/m2 value >= 0.0 Missing value: 9999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `extraterrestrial_direct_normal_radiation`'.format(value)) if value < 0.0: raise ValueError( 'value need to be greater or equal 0.0 ' 'for field `extraterrestrial_direct_normal_radiation`') self._extraterrestrial_direct_normal_radiation = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def horizontal_infrared_radiation_intensity(self, value=9999.0): """Corresponds to IDD Field `horizontal_infrared_radiation_intensity` Args: value (float): value for IDD Field `horizontal_infrared_radiation_intensity` Unit: Wh/m2 value >= 0.0 Missing value: 9999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `horizontal_infrared_radiation_intensity`'.format(value)) if value < 0.0: raise ValueError( 'value need to be greater or equal 0.0 ' 'for field `horizontal_infrared_radiation_intensity`') self._horizontal_infrared_radiation_intensity = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def global_horizontal_radiation(self, value=9999.0): """Corresponds to IDD Field `global_horizontal_radiation` Args: value (float): value for IDD Field `global_horizontal_radiation` Unit: Wh/m2 value >= 0.0 Missing value: 9999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `global_horizontal_radiation`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `global_horizontal_radiation`') self._global_horizontal_radiation = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def direct_normal_radiation(self, value=9999.0): """Corresponds to IDD Field `direct_normal_radiation` Args: value (float): value for IDD Field `direct_normal_radiation` Unit: Wh/m2 value >= 0.0 Missing value: 9999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `direct_normal_radiation`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `direct_normal_radiation`') self._direct_normal_radiation = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def diffuse_horizontal_radiation(self, value=9999.0): """Corresponds to IDD Field `diffuse_horizontal_radiation` Args: value (float): value for IDD Field `diffuse_horizontal_radiation` Unit: Wh/m2 value >= 0.0 Missing value: 9999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `diffuse_horizontal_radiation`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `diffuse_horizontal_radiation`') self._diffuse_horizontal_radiation = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def global_horizontal_illuminance(self, value=999999.0): """ Corresponds to IDD Field `global_horizontal_illuminance` will be missing if >= 999900 Args: value (float): value for IDD Field `global_horizontal_illuminance` Unit: lux value >= 0.0 Missing value: 999999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `global_horizontal_illuminance`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `global_horizontal_illuminance`') self._global_horizontal_illuminance = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def direct_normal_illuminance(self, value=999999.0): """ Corresponds to IDD Field `direct_normal_illuminance` will be missing if >= 999900 Args: value (float): value for IDD Field `direct_normal_illuminance` Unit: lux value >= 0.0 Missing value: 999999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `direct_normal_illuminance`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `direct_normal_illuminance`') self._direct_normal_illuminance = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def diffuse_horizontal_illuminance(self, value=999999.0): """ Corresponds to IDD Field `diffuse_horizontal_illuminance` will be missing if >= 999900 Args: value (float): value for IDD Field `diffuse_horizontal_illuminance` Unit: lux value >= 0.0 Missing value: 999999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `diffuse_horizontal_illuminance`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `diffuse_horizontal_illuminance`') self._diffuse_horizontal_illuminance = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def zenith_luminance(self, value=9999.0): """ Corresponds to IDD Field `zenith_luminance` will be missing if >= 9999 Args: value (float): value for IDD Field `zenith_luminance` Unit: Cd/m2 value >= 0.0 Missing value: 9999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `zenith_luminance`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `zenith_luminance`') self._zenith_luminance = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def wind_direction(self, value=999.0): """Corresponds to IDD Field `wind_direction` Args: value (float): value for IDD Field `wind_direction` Unit: degrees value >= 0.0 value <= 360.0 Missing value: 999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `wind_direction`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `wind_direction`') if value > 360.0: raise ValueError('value need to be smaller 360.0 ' 'for field `wind_direction`') self._wind_direction = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def wind_speed(self, value=999.0): """Corresponds to IDD Field `wind_speed` Args: value (float): value for IDD Field `wind_speed` Unit: m/s value >= 0.0 value <= 40.0 Missing value: 999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `wind_speed`'.format(value)) if value < 0.0: raise ValueError('value need to be greater or equal 0.0 ' 'for field `wind_speed`') if value > 40.0: raise ValueError('value need to be smaller 40.0 ' 'for field `wind_speed`') self._wind_speed = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def present_weather_codes(self, value=None): """Corresponds to IDD Field `present_weather_codes` Args: value (int): value for IDD Field `present_weather_codes` if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError( 'value {} need to be of type int ' 'for field `present_weather_codes`'.format(value)) self._present_weather_codes = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def precipitable_water(self, value=999.0): """Corresponds to IDD Field `precipitable_water` Args: value (float): value for IDD Field `precipitable_water` Unit: mm Missing value: 999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `precipitable_water`'.format(value)) self._precipitable_water = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def aerosol_optical_depth(self, value=0.999): """Corresponds to IDD Field `aerosol_optical_depth` Args: value (float): value for IDD Field `aerosol_optical_depth` Unit: thousandths Missing value: 0.999 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `aerosol_optical_depth`'.format(value)) self._aerosol_optical_depth = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def snow_depth(self, value=999.0): """Corresponds to IDD Field `snow_depth` Args: value (float): value for IDD Field `snow_depth` Unit: cm Missing value: 999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `snow_depth`'.format(value)) self._snow_depth = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def days_since_last_snowfall(self, value=99): """Corresponds to IDD Field `days_since_last_snowfall` Args: value (int): value for IDD Field `days_since_last_snowfall` Missing value: 99 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = int(value) except ValueError: raise ValueError( 'value {} need to be of type int ' 'for field `days_since_last_snowfall`'.format(value)) self._days_since_last_snowfall = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def albedo(self, value=999.0): """Corresponds to IDD Field `albedo` Args: value (float): value for IDD Field `albedo` Missing value: 999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError('value {} need to be of type float ' 'for field `albedo`'.format(value)) self._albedo = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def liquid_precipitation_depth(self, value=999.0): """Corresponds to IDD Field `liquid_precipitation_depth` Args: value (float): value for IDD Field `liquid_precipitation_depth` Unit: mm Missing value: 999.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `liquid_precipitation_depth`'.format(value)) self._liquid_precipitation_depth = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def liquid_precipitation_quantity(self, value=99.0): """Corresponds to IDD Field `liquid_precipitation_quantity` Args: value (float): value for IDD Field `liquid_precipitation_quantity` Unit: hr Missing value: 99.0 if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises: ValueError: if `value` is not a valid value """
if value is not None: try: value = float(value) except ValueError: raise ValueError( 'value {} need to be of type float ' 'for field `liquid_precipitation_quantity`'.format(value)) self._liquid_precipitation_quantity = value
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def add_weatherdata(self, data): """Appends weather data. Args: data (WeatherData): weather data object """
if not isinstance(data, WeatherData): raise ValueError('Weather data need to be of type WeatherData') self._data["WEATHER DATA"].append(data)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def _create_datadict(cls, internal_name): """Creates an object depending on `internal_name` Args: internal_name (str): IDD name Raises: ValueError: if `internal_name` cannot be matched to a data dictionary object """
if internal_name == "LOCATION": return Location() if internal_name == "DESIGN CONDITIONS": return DesignConditions() if internal_name == "TYPICAL/EXTREME PERIODS": return TypicalOrExtremePeriods() if internal_name == "GROUND TEMPERATURES": return GroundTemperatures() if internal_name == "HOLIDAYS/DAYLIGHT SAVINGS": return HolidaysOrDaylightSavings() if internal_name == "COMMENTS 1": return Comments1() if internal_name == "COMMENTS 2": return Comments2() if internal_name == "DATA PERIODS": return DataPeriods() raise ValueError( "No DataDictionary known for {}".format(internal_name))
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def read(self, path): """Read EPW weather data from path. Args: path (str): path to read weather data from """
with open(path, "r") as f: for line in f: line = line.strip() match_obj_name = re.search(r"^([A-Z][A-Z/ \d]+),", line) if match_obj_name is not None: internal_name = match_obj_name.group(1) if internal_name in self._data: self._data[internal_name] = self._create_datadict( internal_name) data_line = line[len(internal_name) + 1:] vals = data_line.strip().split(',') self._data[internal_name].read(vals) else: wd = WeatherData() wd.read(line.strip().split(',')) self.add_weatherdata(wd)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def display_plots(filebase, directory=None, width=700, height=500, **kwargs): """Display a series of plots controlled by sliders. The function relies on Python string format functionality to index through a series of plots."""
def show_figure(filebase, directory, **kwargs): """Helper function to load in the relevant plot for display.""" filename = filebase.format(**kwargs) if directory is not None: filename = directory + '/' + filename display(HTML("<img src='{filename}'>".format(filename=filename))) interact(show_figure, filebase=fixed(filebase), directory=fixed(directory), **kwargs)
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def answer(part, module='mlai2014.json'): """Returns the answers to the lab classes."""
marks = json.load(open(os.path.join(data_directory, module), 'rb')) return marks['Lab ' + str(part+1)]
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def latex(self): """Gives a latex representation of the assessment."""
output = self.latex_preamble output += self._repr_latex_() output += self.latex_post return output
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def html(self): """Gives an html representation of the assessment."""
output = self.html_preamble output += self._repr_html_() output += self.html_post return output
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def marksheet(self): """Returns an pandas empty dataframe object containing rows and columns for marking. This can then be passed to a google doc that is distributed to markers for editing with the mark for each section."""
columns=['Number', 'Question', 'Correct (a fraction)', 'Max Mark', 'Comments'] mark_sheet = pd.DataFrame() for qu_number, question in enumerate(self.answers): part_no = 0 for number, part in enumerate(question): if number>0: if part[2] > 0: part_no += 1 index = str(qu_number+1) +'_'+str(part_no) frame = pd.DataFrame(columns=columns, index=[index]) frame.loc[index]['Number'] = index frame.loc[index]['Question'] = part[0] frame.loc[index]['Max Mark'] = part[2] mark_sheet = mark_sheet.append(frame) return mark_sheet.sort(columns='Number')
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description: def total_marks(self): """Compute the total mark for the assessment."""
total = 0 for answer in self.answers: for number, part in enumerate(answer): if number>0: if part[2]>0: total+=part[2] return total
<SYSTEM_TASK:> Solve the following problem using Python, implementing the functions described below, one line at a time <END_TASK> <USER_TASK:> Description:
def permute(num): "Permutation for randomizing data order." if permute_data: return np.random.permutation(num) else: logging.warning("Warning not permuting data") return np.arange(num)