def save(self, file_path):
<EOL>if not self.is_data_loaded:<EOL><INDENT>self._import_data()<EOL><DEDENT>originally_ip = False<EOL>if self.is_ip is True:<EOL><INDENT>self.convert_to_si()<EOL>originally_ip = True<EOL><DEDENT>lines = self.header<EOL>try:<EOL><INDENT>for field in xrange(<NUM_LIT:0>, self._num_of_fields):<EOL><INDENT>point_in_time = self._data[field].header.data_type.point_in_time<EOL>if point_in_time is True:<EOL><INDENT>first_hour = self._data[field]._values.pop(<NUM_LIT:0>)<EOL>self._data[field]._values.append(first_hour)<EOL><DEDENT><DEDENT>annual_a_per = AnalysisPeriod(is_leap_year=self.is_leap_year)<EOL>for hour in xrange(<NUM_LIT:0>, len(annual_a_per.datetimes)):<EOL><INDENT>line = []<EOL>for field in xrange(<NUM_LIT:0>, self._num_of_fields):<EOL><INDENT>line.append(str(self._data[field]._values[hour]))<EOL><DEDENT>lines.append("<STR_LIT:U+002C>".join(line) + "<STR_LIT:\n>")<EOL><DEDENT><DEDENT>except IndexError:<EOL><INDENT>length_error_msg = '<STR_LIT>' +'<STR_LIT>'<EOL>raise ValueError(length_error_msg)<EOL><DEDENT>else:<EOL><INDENT>file_data = '<STR_LIT>'.join(lines)<EOL>write_to_file(file_path, file_data, True)<EOL><DEDENT>finally:<EOL><INDENT>del(lines)<EOL>for field in xrange(<NUM_LIT:0>, self._num_of_fields):<EOL><INDENT>point_in_time = self._data[field].header.data_type.point_in_time<EOL>if point_in_time is True:<EOL><INDENT>last_hour = self._data[field]._values.pop()<EOL>self._data[field]._values.insert(<NUM_LIT:0>, last_hour)<EOL><DEDENT><DEDENT><DEDENT>if originally_ip is True:<EOL><INDENT>self.convert_to_ip()<EOL><DEDENT>return file_path<EOL>
Save epw object as an epw file.

        args:
            file_path: A string representing the path to write the epw file to.