Repository: quantopian/zipline
File: zipline/lib/adjusted_array.py (Python)

Code before:
    """
    __slots__ = (
        '_data',
        '_view_kwargs',
        'adjustments',
        'missing_value',
        '__weakref__',
    )

    def __init__(self, data, adjustments, missing_value):
        self._data, self._view_kwargs = _normalize_array(data, missing_value)

        self.adjustments = adjustments
        self.missing_value = missing_value

    def update_adjustments(self, adjustments, method):
        """
        Merge ``adjustments`` with existing adjustments, handling index
        collisions according to ``method``.

        Parameters
        ----------
        adjustments : dict[int -> list[Adjustment]]
            The mapping of row indices to lists of adjustments that should be
            appended to existing adjustments.
        method : str
            Specifies how to handle index collisions.
        """
        try:
            merge_func = _merge_methods[method]
        except KeyError:
            raise ValueError(
                "Invalid merge method %s\n"
                "Valid methods are: %s" % (
                    method,
                    ', '.join(_merge_methods.keys())
                )
            )

        self.adjustments = merge_with(
            merge_func,
            self.adjustments,
            adjustments,
        )

    @property
    def data(self):
        """
        The data stored in this array.
        """
        return self._data.view(**self._view_kwargs)

Review comment (suggestion):
This should provide a description of what the different methods are, e.g.:

```
method : {'append', 'prepend'}
    How to handle index collisions. If 'append', new adjustments will be applied after 
    previously-existing adjustments. If 'prepend', new adjustments will be applied before
    previously-existing adjustments.
```

Code after:
        '_data',
        '_view_kwargs',
        'adjustments',
        'missing_value',
        '__weakref__',
    )

    def __init__(self, data, adjustments, missing_value):
        self._data, self._view_kwargs = _normalize_array(data, missing_value)

        self.adjustments = adjustments
        self.missing_value = missing_value

    def update_adjustments(self, adjustments, method):
        """
        Merge ``adjustments`` with existing adjustments, handling index
        collisions according to ``method``.

        Parameters
        ----------
        adjustments : dict[int -> list[Adjustment]]
            The mapping of row indices to lists of adjustments that should be
            appended to existing adjustments.
        method : {'append', 'prepend'}
            How to handle index collisions. If 'append', new adjustments will
            be applied after previously-existing adjustments. If 'prepend', new
            adjustments will be applied before previously-existing adjustments.
        """
        try:
            merge_func = _merge_methods[method]
        except KeyError:
            raise ValueError(
                "Invalid merge method %s\n"
                "Valid methods are: %s" % (method, ', '.join(_merge_methods))
            )

        self.adjustments = merge_with(
            merge_func,
            self.adjustments,
            adjustments,
        )

    @property
    def data(self):
        """
        The data stored in this array.
        """
        return self._data.view(**self._view_kwargs)

    @lazyval
    def dtype(self):