@classmethod<EOL><INDENT>def from_ddy_file(cls, file_path):<DEDENT>
<EOL>if not os.path.isfile(file_path):<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'.format(file_path))<EOL><DEDENT>if not file_path.lower().endswith('<STR_LIT>'):<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>iron_python = True if platform.python_implementation() == '<STR_LIT>'else False<EOL><DEDENT>except Exception:<EOL><INDENT>iron_python = True<EOL><DEDENT>if iron_python:<EOL><INDENT>ddywin = codecs.open(file_path, '<STR_LIT:r>')<EOL><DEDENT>else:<EOL><INDENT>ddywin = codecs.open(file_path, '<STR_LIT:r>', encoding='<STR_LIT:utf-8>', errors='<STR_LIT:ignore>')<EOL><DEDENT>try:<EOL><INDENT>ddytxt = ddywin.read()<EOL>location_format = re.compile(<EOL>r"<STR_LIT>")<EOL>design_day_format = re.compile(<EOL>r"<STR_LIT>")<EOL>location_matches = location_format.findall(ddytxt)<EOL>des_day_matches = design_day_format.findall(ddytxt)<EOL><DEDENT>except Exception as e:<EOL><INDENT>import traceback<EOL>raise Exception('<STR_LIT>'.format(e, traceback.format_exc()))<EOL><DEDENT>else:<EOL><INDENT>assert len(location_matches) > <NUM_LIT:0>, '<STR_LIT>''<STR_LIT>'<EOL>location = Location.from_location(location_matches[<NUM_LIT:0>][<NUM_LIT:0>])<EOL>design_days = [DesignDay.from_ep_string(<EOL>match[<NUM_LIT:0>], location) for match in des_day_matches]<EOL><DEDENT>finally:<EOL><INDENT>ddywin.close()<EOL><DEDENT>cls_ = cls(location, design_days)<EOL>cls_._file_path = os.path.normpath(file_path)<EOL>return cls_<EOL>
Initalize from a ddy file object from an existing ddy file.

        args:
            file_path: A string representing a complete path to the .ddy file.