Repository: quantopian/zipline
File: zipline/data/minute_bars.py (Python)

Code before:
                )

            return cls(
                ohlc_ratio,
                calendar,
                start_session,
                end_session,
                minutes_per_day,
                version,
            )

    def __init__(
        self,
        ohlc_ratio,
        calendar,
        start_session,
        end_session,
        minutes_per_day,
        version,
    ):
        self.calendar = calendar
        self.start_session = start_session
        self.end_session = end_session
        self.ohlc_ratio = ohlc_ratio
        self.minutes_per_day = minutes_per_day
        self.version = version

    def write(self, rootdir):
        """
        Write the metadata to a JSON file in the rootdir.

        Values contained in the metadata are:

        version : int
            The value of FORMAT_VERSION of this class.
        ohlc_ratio : int
             The factor by which the pricing data is multiplied so that the
             float data can be stored as an integer.
        minutes_per_day : int
            The number of minutes per each period.
        calendar_name : str
            The name of the TradingCalendar on which the minute bars are
            based.
        start_session : datetime
            'YYYY-MM-DD' formatted representation of the first trading
            session in the data set.
        end_session : datetime
            'YYYY-MM-DD' formatted representation of the last trading
            session in the data set.

        Deprecated, but included for backwards compatibility:

Review comment (suggestion):
Aha, I see - the writer specifies the latest.  That makes sense now, though it was surprising to me that the caller passes that attribute of `BcolzMinuteBarMetadata` to its own constructor - maybe a default value would make sense.


Code after:
                )

            return cls(
                ohlc_ratio,
                calendar,
                start_session,
                end_session,
                minutes_per_day,
                version=version,
            )

    def __init__(
        self,
        ohlc_ratio,
        calendar,
        start_session,
        end_session,
        minutes_per_day,
        version=FORMAT_VERSION,
    ):
        self.calendar = calendar
        self.start_session = start_session
        self.end_session = end_session
        self.ohlc_ratio = ohlc_ratio
        self.minutes_per_day = minutes_per_day
        self.version = version

    def write(self, rootdir):
        """
        Write the metadata to a JSON file in the rootdir.

        Values contained in the metadata are:

        version : int
            The value of FORMAT_VERSION of this class.
        ohlc_ratio : int
             The factor by which the pricing data is multiplied so that the
             float data can be stored as an integer.
        minutes_per_day : int
            The number of minutes per each period.
        calendar_name : str
            The name of the TradingCalendar on which the minute bars are
            based.
        start_session : datetime
            'YYYY-MM-DD' formatted representation of the first trading
            session in the data set.
        end_session : datetime
            'YYYY-MM-DD' formatted representation of the last trading
            session in the data set.

        Deprecated, but included for backwards compatibility: