def to_json(self):
def jsonify_dict(base_dict):<EOL><INDENT>new_dict = {}<EOL>for key, val in base_dict.items():<EOL><INDENT>if isinstance(val, list):<EOL><INDENT>new_dict[key] = [v.to_json() for v in val]<EOL><DEDENT>else:<EOL><INDENT>new_dict[key] = val.to_json()<EOL><DEDENT><DEDENT>return new_dict<EOL><DEDENT>return {<EOL>'<STR_LIT:location>': self.location.to_json(),<EOL>'<STR_LIT>': self.ashrae_climate_zone,<EOL>'<STR_LIT>': self.koppen_climate_zone,<EOL>'<STR_LIT>': self.extreme_cold_week.to_json()<EOL>if self.extreme_cold_week else None,<EOL>'<STR_LIT>': self.extreme_hot_week.to_json()<EOL>if self.extreme_cold_week else None,<EOL>'<STR_LIT>': jsonify_dict(self._typical_weeks),<EOL>'<STR_LIT>': self._winter_des_day_dict,<EOL>'<STR_LIT>': self._summer_des_day_dict,<EOL>"<STR_LIT>": self._monthly_db_50,<EOL>"<STR_LIT>": self._monthly_wb_50,<EOL>"<STR_LIT>": self._monthly_db_range_50,<EOL>"<STR_LIT>": self._monthly_wb_range_50,<EOL>"<STR_LIT>": self._monthly_db_100,<EOL>"<STR_LIT>": self._monthly_wb_100,<EOL>"<STR_LIT>": self._monthly_db_20,<EOL>"<STR_LIT>": self._monthly_wb_20,<EOL>"<STR_LIT>": self._monthly_db_04,<EOL>"<STR_LIT>": self._monthly_wb_04,<EOL>"<STR_LIT>": self._monthly_wind,<EOL>"<STR_LIT>": self._monthly_wind_dirs,<EOL>"<STR_LIT>": self.standard_pressure_at_elev,<EOL>"<STR_LIT>": self.monthly_tau_beam,<EOL>"<STR_LIT>": self.monthly_tau_diffuse<EOL>}<EOL>
Convert the STAT object to a dictionary.