@classmethod<EOL><INDENT>def from_json(cls, data):<DEDENT>
<EOL>epw_obj = cls(None)<EOL>epw_obj._is_header_loaded = True<EOL>epw_obj._is_data_loaded = True<EOL>required_keys = ('<STR_LIT:location>', '<STR_LIT>')<EOL>option_keys_dict = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>')<EOL>for key in required_keys:<EOL><INDENT>assert key in data, '<STR_LIT>'.format(key)<EOL><DEDENT>assert len(data['<STR_LIT>']) == epw_obj._num_of_fields,'<STR_LIT>'.format(<EOL>epw_obj._num_of_fields, len(data['<STR_LIT>']))<EOL>for key in option_keys_dict:<EOL><INDENT>if key not in data:<EOL><INDENT>data[key] = {}<EOL><DEDENT><DEDENT>epw_obj._location = Location.from_json(data['<STR_LIT:location>'])<EOL>epw_obj._data = [HourlyContinuousCollection.from_json(dc)<EOL>for dc in data['<STR_LIT>']]<EOL>if '<STR_LIT>' in data:<EOL><INDENT>epw_obj._is_leap_year = data['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in data:<EOL><INDENT>epw_obj._is_ip = data['<STR_LIT>']<EOL><DEDENT>for dc in epw_obj._data:<EOL><INDENT>assert isinstance(dc, HourlyContinuousCollection), '<STR_LIT>''<STR_LIT>'.format(type(dc))<EOL>assert dc.header.analysis_period.is_annual, '<STR_LIT>''<STR_LIT>'<EOL>assert dc.header.analysis_period.is_leap_year == epw_obj._is_leap_year,'<STR_LIT>'<EOL><DEDENT>epw_obj._metadata = data['<STR_LIT>']<EOL>epw_obj.heating_design_condition_dictionary = data['<STR_LIT>']<EOL>epw_obj.cooling_design_condition_dictionary = data['<STR_LIT>']<EOL>epw_obj.extreme_design_condition_dictionary = data['<STR_LIT>']<EOL>def _dejson(parent_dict, obj):<EOL><INDENT>new_dict = {}<EOL>for key, val in parent_dict.items():<EOL><INDENT>new_dict[key] = obj.from_json(val)<EOL><DEDENT>return new_dict<EOL><DEDENT>epw_obj.extreme_hot_weeks = _dejson(data['<STR_LIT>'], AnalysisPeriod)<EOL>epw_obj.extreme_cold_weeks = _dejson(data['<STR_LIT>'], AnalysisPeriod)<EOL>epw_obj.typical_weeks = _dejson(data['<STR_LIT>'], AnalysisPeriod)<EOL>epw_obj.monthly_ground_temperature = _dejson(<EOL>data['<STR_LIT>'], MonthlyCollection)<EOL>if '<STR_LIT>' in data:<EOL><INDENT>epw_obj.daylight_savings_start = data['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in data:<EOL><INDENT>epw_obj.daylight_savings_end = data['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in data:<EOL><INDENT>epw_obj.comments_1 = data['<STR_LIT>']<EOL><DEDENT>if '<STR_LIT>' in data:<EOL><INDENT>epw_obj.comments_2 = data['<STR_LIT>']<EOL><DEDENT>return epw_obj<EOL>
Create EPW from json dictionary.

            Args:
                data: {
                "location": {} , // ladybug location schema
                "data_collections": [], // list of hourly annual hourly data collection
                    schemas for each of the 35 fields within the EPW file.
                "metadata": {},  // dict of metadata assigned to all data collections
                "heating_dict": {}, // dict containing heating design conditions
                "cooling_dict": {}, // dict containing cooling design conditions
                "extremes_dict": {}, // dict containing extreme design conditions
                "extreme_hot_weeks": {}, // dict with values of week-long ladybug
                    analysis period schemas signifying extreme hot weeks.
                "extreme_cold_weeks": {}, // dict with values of week-long ladybug
                    analysis period schemas signifying extreme cold weeks.
                "typical_weeks": {}, // dict with values of week-long ladybug
                    analysis period schemas signifying typical weeks.
                "monthly_ground_temps": {}, // dict with keys as floats signifying
                    depths in meters below ground and values of monthly collection schema
                "is_ip": Boolean // denote whether the data is in IP units
                "is_leap_year": Boolean, // denote whether data is for a leap year
                "daylight_savings_start": 0, // signify when daylight savings starts
                    or 0 for no daylight savings
                "daylight_savings_end" 0, // signify when daylight savings ends
                    or 0 for no daylight savings
                "comments_1": String, // epw comments
                "comments_2": String // epw comments
            }