<commit_before>Migrating to Rasterio 1.0
=========================


I/O Operations
--------------

Methods related to reading band data and dataset masks have changed in 1.0.


Deprecated: ``rasterio.drivers()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Previously users could register GDAL's drivers and open a datasource with:

.. code-block:: python

    import rasterio

    with rasterio.drivers():

        with rasterio.open('tests/data/RGB.byte.tif') as src:
            pass

but Rasterio 1.0 contains more interactions with GDAL's environment, so
``rasterio.drivers()`` has been replaced with:

.. code-block:: python

    import rasterio
    import rasterio.env

    with rasterio.env.Env():

        with rasterio.open('tests/data/RGB.byte.tif') as src:
            pass

Tickets
```````

* `#665 <https://github.com/mapbox/rasterio/pull/665>`__ - Deprecation of
  ``rasterio.drivers()`` and introduction of ``rasterio.env.Env()``.

Removed: ``src.read_band()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``read_band()`` method has been replaced by ``read()``, which allows for
faster I/O and reading multiple bands into a single ``numpy.ndarray()``.

For example:

.. code-block:: python

    import numpy as np
    import rasterio

    with rasterio.open('tests/data/RGB.byte.tif') as src:
        data = np.array(map(src.read_band, (1, 2, 3)))
        band1 = src.read_band(1)

is now:
<commit_msg>Use rasterio.Env() instead of rasterio.env.Env()<commit_after>Migrating to Rasterio 1.0
=========================


I/O Operations
--------------

Methods related to reading band data and dataset masks have changed in 1.0.


Deprecated: ``rasterio.drivers()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Previously users could register GDAL's drivers and open a datasource with:

.. code-block:: python

    import rasterio

    with rasterio.drivers():

        with rasterio.open('tests/data/RGB.byte.tif') as src:
            pass

but Rasterio 1.0 contains more interactions with GDAL's environment, so
``rasterio.drivers()`` has been replaced with:

.. code-block:: python

    import rasterio
    import rasterio.env

    with rasterio.Env():

        with rasterio.open('tests/data/RGB.byte.tif') as src:
            pass

Tickets
```````

* `#665 <https://github.com/mapbox/rasterio/pull/665>`__ - Deprecation of
  ``rasterio.drivers()`` and introduction of ``rasterio.Env()``.

Removed: ``src.read_band()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The ``read_band()`` method has been replaced by ``read()``, which allows for
faster I/O and reading multiple bands into a single ``numpy.ndarray()``.

For example:

.. code-block:: python

    import numpy as np
    import rasterio

    with rasterio.open('tests/data/RGB.byte.tif') as src:
        data = np.array(map(src.read_band, (1, 2, 3)))
        band1 = src.read_band(1)

is now:

{'fraction_non_alphanumeric': 0.1929203539823009, 'fraction_numerical': 0.012035398230088496, 'mean_word_length': 3.361111111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5252264', 'n_tokens_mistral': 957, 'n_tokens_neox': 876, 'n_words': 258}