oplus/weather_data/weather_data.py
def to_epw(self, buffer_or_path=None):
        """
        Parameters
        ----------
        buffer_or_path: buffer or path, default None
            Buffer or path to write into. If None, will return a string containing epw info.

        Returns
        -------
        None or a string if buffer_or_path is None.
        """
        # copy and change hours convention [0, 23] -> [1, 24]
        df = self._weather_series.copy()
        df["hour"] += 1
        epw_content = self._headers_to_epw() + df.to_csv(header=False, index=False, line_terminator="\n")
        return multi_mode_write(
            lambda buffer: buffer.write(epw_content),
            lambda: epw_content,
            buffer_or_path=buffer_or_path
        )
def to_epw(self, buffer_or_path=None):
        """
        Parameters
        ----------
        buffer_or_path: buffer or path, default None
            Buffer or path to write into. If None, will return a string containing epw info.

        Returns
        -------
        None or a string if buffer_or_path is None.
        """
        # copy and change hours convention [0, 23] -> [1, 24]
        df = self._weather_series.copy()
        df["hour"] += 1
        epw_content = self._headers_to_epw() + df.to_csv(header=False, index=False, line_terminator="\n")
        return multi_mode_write(
            lambda buffer: buffer.write(epw_content),
            lambda: epw_content,
            buffer_or_path=buffer_or_path
        )
Parameters
        ----------
        buffer_or_path: buffer or path, default None
            Buffer or path to write into. If None, will return a string containing epw info.

        Returns
        -------
        None or a string if buffer_or_path is None.