Skip to content

Commit c636f51

Browse files
committed
Fixing xray -> xarray
1 parent 3e7a49c commit c636f51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+767
-766
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[run]
2-
omit = xray/test/*
2+
omit = xarray/test/*

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ nosetests.xml
3939
.idea
4040
*.swp
4141

42-
# xray specific
42+
# xarray specific
4343
doc/_build
4444
doc/generated
4545
doc/_static/*.png
46-
xray/version.py
46+
xarray/version.py
4747

4848
.ipynb_checkpoints

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ install:
6464
- python setup.py install
6565

6666
script:
67-
- py.test xray --cov=xray --cov-report term-missing
67+
- py.test xarray --cov=xarray --cov-report term-missing
6868

6969
after_success:
7070
- coveralls

README.rst

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
xray: N-D labeled arrays and datasets
2-
=====================================
1+
xarray: N-D labeled arrays and datasets
2+
=======================================
33

4-
.. image:: https://travis-ci.org/xray/xray.svg?branch=master
5-
:target: https://travis-ci.org/xray/xray
6-
.. image:: https://ci.appveyor.com/api/projects/status/github/xray/xray?svg=true&passingText=passing&failingText=failing&pendingText=pending
4+
.. image:: https://travis-ci.org/pydata/xarray.svg?branch=master
5+
:target: https://travis-ci.org/pydata/xarray
6+
.. image:: https://ci.appveyor.com/api/projects/status/github/pydata/xarray?svg=true&passingText=passing&failingText=failing&pendingText=pending
77
:target: https://ci.appveyor.com/project/shoyer/xray
8-
.. image:: https://coveralls.io/repos/xray/xray/badge.svg
9-
:target: https://coveralls.io/r/xray/xray
10-
.. image:: https://landscape.io/github/xray/xray/master/landscape.svg?style=flat
11-
:target: https://landscape.io/github/xray/xray/master
12-
.. image:: https://img.shields.io/pypi/v/xray.svg
13-
:target: https://pypi.python.org/pypi/xray/
8+
.. image:: https://coveralls.io/repos/pydata/xarray/badge.svg
9+
:target: https://coveralls.io/r/pydata/xarray
10+
.. image:: https://landscape.io/github/pydata/xarray/master/landscape.svg?style=flat
11+
:target: https://landscape.io/github/pydata/xarray/master
12+
.. image:: https://img.shields.io/pypi/v/xarray.svg
13+
:target: https://pypi.python.org/pypi/xarray/
1414
.. image:: https://badges.gitter.im/Join%20Chat.svg
15-
:target: https://gitter.im/xray/xray
15+
:target: https://gitter.im/pydata/xarray
1616

17-
**xray** is an open source project and Python package that aims to bring the
17+
**xarray** (formerly "xray") is an open source project and Python package that aims to bring the
1818
labeled data power of pandas_ to the physical sciences, by providing
1919
N-dimensional variants of the core pandas data structures.
2020

2121
Our goal is to provide a pandas-like and pandas-compatible toolkit for
2222
analytics on multi-dimensional arrays, rather than the tabular data for which
2323
pandas excels. Our approach adopts the `Common Data Model`_ for self-
2424
describing scientific data in widespread use in the Earth sciences:
25-
``xray.Dataset`` is an in-memory representation of a netCDF file.
25+
``xarray.Dataset`` is an in-memory representation of a netCDF file.
2626

2727
.. _pandas: http://pandas.pydata.org
2828
.. _Common Data Model: http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/CDM
2929
.. _netCDF: http://www.unidata.ucar.edu/software/netcdf
3030
.. _OPeNDAP: http://www.opendap.org/
3131

32-
Why xray?
33-
---------
32+
Why xarray?
33+
-----------
3434

3535
Adding dimensions names and coordinate indexes to numpy's ndarray_ makes many
3636
powerful array operations possible:
@@ -43,7 +43,7 @@ powerful array operations possible:
4343
- Flexible split-apply-combine operations with groupby:
4444
``x.groupby('time.dayofyear').mean()``.
4545
- Database like alignment based on coordinate labels that smoothly
46-
handles missing values: ``x, y = xray.align(x, y, join='outer')``.
46+
handles missing values: ``x, y = xr.align(x, y, join='outer')``.
4747
- Keep track of arbitrary metadata in the form of a Python dictionary:
4848
``x.attrs``.
4949

@@ -55,19 +55,19 @@ Why isn't pandas enough?
5555

5656
pandas_ excels at working with tabular data. That suffices for many statistical
5757
analyses, but physical scientists rely on N-dimensional arrays -- which is
58-
where xray comes in.
58+
where xarray comes in.
5959

60-
xray aims to provide a data analysis toolkit as powerful as pandas_ but
60+
xarray aims to provide a data analysis toolkit as powerful as pandas_ but
6161
designed for working with homogeneous N-dimensional arrays
6262
instead of tabular data. When possible, we copy the pandas API and rely on
6363
pandas's highly optimized internals (in particular, for fast indexing).
6464

6565
Why netCDF?
6666
-----------
6767

68-
Because xray implements the same data model as the netCDF_ file format,
69-
xray datasets have a natural and portable serialization format. But it is also
70-
easy to robustly convert an xray ``DataArray`` to and from a numpy ``ndarray``
68+
Because xarray implements the same data model as the netCDF_ file format,
69+
xarray datasets have a natural and portable serialization format. But it is also
70+
easy to robustly convert an xarray ``DataArray`` to and from a numpy ``ndarray``
7171
or a pandas ``DataFrame`` or ``Series``, providing compatibility with the full
7272
`PyData ecosystem <http://pydata.org/>`__.
7373

@@ -82,28 +82,28 @@ especially geoscientists who already know and love netCDF_.
8282
Documentation
8383
-------------
8484

85-
The official documentation is hosted on ReadTheDocs: http://xray.readthedocs.org/
85+
The official documentation is hosted on ReadTheDocs at http://xarray.pydata.org/
8686

8787
Get in touch
8888
------------
8989

90-
- GitHub issue tracker: https://github.com/xray/xray/issues/
91-
- Mailing list: https://groups.google.com/forum/#!forum/xray-dev
92-
- Twitter: http://twitter.com/shoyer
90+
- GitHub issue tracker: https://github.com/pydata/xarray/issues/
91+
- Mailing list: https://groups.google.com/forum/#!forum/xarray
9392

9493
History
9594
-------
9695

97-
xray is an evolution of an internal tool developed at `The Climate
98-
Corporation`__, and was originally written by current and former Climate Corp
99-
researchers Stephan Hoyer, Alex Kleeman and Eugene Brevdo.
96+
xarray is an evolution of an internal tool developed at `The Climate
97+
Corporation`__. It was originally written by Climate Corp researchers Stephan
98+
Hoyer, Alex Kleeman and Eugene Brevdo and was released as open source in
99+
May 2014. The project was renamed from "xray" in January 2016.
100100

101101
__ http://climate.com/
102102

103103
License
104104
-------
105105

106-
Copyright 2014, xray Developers
106+
Copyright 2014-2016, xarray Developers
107107

108108
Licensed under the Apache License, Version 2.0 (the "License");
109109
you may not use this file except in compliance with the License.
@@ -117,5 +117,5 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
117117
See the License for the specific language governing permissions and
118118
limitations under the License.
119119

120-
xray includes portions of pandas, NumPy and Seaborn. Their licenses are
120+
xarray includes portions of pandas, NumPy and Seaborn. Their licenses are
121121
included in the licenses directory.

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ install:
2525
- "python --version"
2626
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
2727

28-
# install xray and depenencies
28+
# install xarray and depenencies
2929
- "conda install --yes --quiet pip pytest numpy pandas scipy netCDF4 matplotlib dask"
3030
- "python setup.py install"
3131

3232
build: false
3333

3434
test_script:
35-
- "py.test xray"
35+
- "py.test xarray"

doc/api-hidden.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.. This extra page is a work around for sphinx not having any support for
33
.. hiding an autosummary table.
44
5-
.. currentmodule:: xray
5+
.. currentmodule:: xarray
66

77
.. autosummary::
88
:toctree: generated/

doc/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
.. currentmodule:: xray
1+
.. currentmodule:: xarray
22

33
#############
44
API reference
55
#############
66

7-
This page provides an auto-generated summary of xray's API. For more details
7+
This page provides an auto-generated summary of xarray's API. For more details
88
and examples, refer to the relevant chapters in the main part of the
99
documentation.
1010

@@ -308,7 +308,7 @@ Universal functions
308308
===================
309309

310310
This functions are copied from NumPy, but extended to work on NumPy arrays,
311-
dask arrays and all xray objects. You can find them in the ``xray.ufuncs``
311+
dask arrays and all xarray objects. You can find them in the ``xarray.ufuncs``
312312
module:
313313

314314
:py:attr:`~ufuncs.angle`

doc/combining.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Combining data
88
99
import numpy as np
1010
import pandas as pd
11-
import xray
11+
import xarray as xr
1212
np.random.seed(123456)
1313
1414
* For combining datasets or data arrays along a dimension, see concatenate_.
@@ -20,17 +20,17 @@ Concatenate
2020
~~~~~~~~~~~
2121

2222
To combine arrays along existing or new dimension into a larger array, you
23-
can use :py:func:`~xray.concat`. ``concat`` takes an iterable of ``DataArray``
23+
can use :py:func:`~xarray.concat`. ``concat`` takes an iterable of ``DataArray``
2424
or ``Dataset`` objects, as well as a dimension name, and concatenates along
2525
that dimension:
2626

2727
.. ipython:: python
2828
29-
arr = xray.DataArray(np.random.randn(2, 3),
30-
[('x', ['a', 'b']), ('y', [10, 20, 30])])
29+
arr = xr.DataArray(np.random.randn(2, 3),
30+
[('x', ['a', 'b']), ('y', [10, 20, 30])])
3131
arr[:, :1]
3232
# this resembles how you would use np.concatenate
33-
xray.concat([arr[:, :1], arr[:, 1:]], dim='y')
33+
xr.concat([arr[:, :1], arr[:, 1:]], dim='y')
3434
3535
In addition to combining along an existing dimension, ``concat`` can create a
3636
new dimension by stacking lower dimensional arrays together:
@@ -39,34 +39,34 @@ new dimension by stacking lower dimensional arrays together:
3939
4040
arr[0]
4141
# to combine these 1d arrays into a 2d array in numpy, you would use np.array
42-
xray.concat([arr[0], arr[1]], 'x')
42+
xr.concat([arr[0], arr[1]], 'x')
4343
4444
If the second argument to ``concat`` is a new dimension name, the arrays will
4545
be concatenated along that new dimension, which is always inserted as the first
4646
dimension:
4747

4848
.. ipython:: python
4949
50-
xray.concat([arr[0], arr[1]], 'new_dim')
50+
xr.concat([arr[0], arr[1]], 'new_dim')
5151
5252
The second argument to ``concat`` can also be an :py:class:`~pandas.Index` or
53-
:py:class:`~xray.DataArray` object as well as a string, in which case it is
53+
:py:class:`~xarray.DataArray` object as well as a string, in which case it is
5454
used to label the values along the new dimension:
5555

5656
.. ipython:: python
5757
58-
xray.concat([arr[0], arr[1]], pd.Index([-90, -100], name='new_dim'))
58+
xr.concat([arr[0], arr[1]], pd.Index([-90, -100], name='new_dim'))
5959
6060
Of course, ``concat`` also works on ``Dataset`` objects:
6161

6262
.. ipython:: python
6363
6464
ds = arr.to_dataset(name='foo')
65-
xray.concat([ds.sel(x='a'), ds.sel(x='b')], 'x')
65+
xr.concat([ds.sel(x='a'), ds.sel(x='b')], 'x')
6666
67-
:py:func:`~xray.concat` has a number of options which provide deeper control
67+
:py:func:`~xarray.concat` has a number of options which provide deeper control
6868
over which variables are concatenated and how it handles conflicting variables
69-
between datasets. With the default parameters, xray will load some coordinate
69+
between datasets. With the default parameters, xarray will load some coordinate
7070
variables into memory to compare them between datasets. This may be prohibitively
7171
expensive if you are manipulating your dataset lazily using :ref:`dask`.
7272

@@ -76,7 +76,7 @@ Merge
7676
~~~~~
7777

7878
To combine variables and coordinates between multiple Datasets, you can use the
79-
:py:meth:`~xray.Dataset.merge` and :py:meth:`~xray.Dataset.update` methods.
79+
:py:meth:`~xarray.Dataset.merge` and :py:meth:`~xarray.Dataset.update` methods.
8080
Merge checks for conflicting variables before merging and by default it returns
8181
a new Dataset:
8282

@@ -90,17 +90,17 @@ coordinates:
9090

9191
.. ipython:: python
9292
93-
other = xray.Dataset({'bar': ('x', [1, 2, 3, 4]), 'x': list('abcd')})
93+
other = xr.Dataset({'bar': ('x', [1, 2, 3, 4]), 'x': list('abcd')})
9494
ds.merge(other)
9595
9696
This ensures that the ``merge`` is non-destructive.
9797

9898
The same non-destructive merging between ``DataArray`` index coordinates is
99-
used in the :py:class:`~xray.Dataset` constructor:
99+
used in the :py:class:`~xarray.Dataset` constructor:
100100

101101
.. ipython:: python
102102
103-
xray.Dataset({'a': arr[:-1], 'b': arr[1:]})
103+
xr.Dataset({'a': arr[:-1], 'b': arr[1:]})
104104
105105
.. _update:
106106

@@ -131,42 +131,42 @@ syntax:
131131

132132
.. ipython:: python
133133
134-
ds['baz'] = xray.DataArray([9, 9, 9, 9, 9], coords=[('x', list('abcde'))])
134+
ds['baz'] = xr.DataArray([9, 9, 9, 9, 9], coords=[('x', list('abcde'))])
135135
ds.baz
136136
137137
Equals and identical
138138
~~~~~~~~~~~~~~~~~~~~
139139

140-
xray objects can be compared by using the :py:meth:`~xray.Dataset.equals`,
141-
:py:meth:`~xray.Dataset.identical` and
142-
:py:meth:`~xray.Dataset.broadcast_equals` methods. These methods are used by
140+
xarray objects can be compared by using the :py:meth:`~xarray.Dataset.equals`,
141+
:py:meth:`~xarray.Dataset.identical` and
142+
:py:meth:`~xarray.Dataset.broadcast_equals` methods. These methods are used by
143143
the optional ``compat`` argument on ``concat`` and ``merge``.
144144

145-
:py:attr:`~xray.Dataset.equals` checks dimension names, indexes and array
145+
:py:attr:`~xarray.Dataset.equals` checks dimension names, indexes and array
146146
values:
147147

148148
.. ipython:: python
149149
150150
arr.equals(arr.copy())
151151
152-
:py:attr:`~xray.Dataset.identical` also checks attributes, and the name of each
152+
:py:attr:`~xarray.Dataset.identical` also checks attributes, and the name of each
153153
object:
154154

155155
.. ipython:: python
156156
157157
arr.identical(arr.rename('bar'))
158158
159-
:py:attr:`~xray.Dataset.broadcast_equals` does a more relaxed form of equality
159+
:py:attr:`~xarray.Dataset.broadcast_equals` does a more relaxed form of equality
160160
check that allows variables to have different dimensions, as long as values
161161
are constant along those new dimensions:
162162

163163
.. ipython:: python
164164
165-
left = xray.Dataset(coords={'x': 0})
166-
right = xray.Dataset({'x': [0, 0, 0]})
165+
left = xr.Dataset(coords={'x': 0})
166+
right = xr.Dataset({'x': [0, 0, 0]})
167167
left.broadcast_equals(right)
168168
169-
Like pandas objects, two xray objects are still equal or identical if they have
169+
Like pandas objects, two xarray objects are still equal or identical if they have
170170
missing values marked by ``NaN`` in the same locations.
171171

172172
In contrast, the ``==`` operation performs element-wise comparison (like

0 commit comments

Comments
 (0)