Skip to content

Commit

Permalink
Renamed package from 'scidata' to 'xray'
Browse files Browse the repository at this point in the history
  • Loading branch information
shoyer committed Feb 14, 2014
1 parent ad9a913 commit f08e2eb
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 36 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# scidata: objects for working with scientific data in Python
# xray: transparently manipulate scientific datasets in Python

**scidata** is a Python package for working with aligned sets of homogeneous,
**xray** is a Python package for working with aligned sets of homogeneous,
n-dimensional arrays. It implements flexible array operations and dataset
manipulation for in-memory datasets within the [Common Data Model][cdm] widely
used for self-describing scientific data (netCDF, OpenDAP, etc.).

***Warning: xray is still in its early development phase. Expect the API to
change.***

## Main Feaures

- A `DatasetArray` object that is compatible with NumPy's ndarray and ufuncs
Expand Down Expand Up @@ -34,14 +37,14 @@ used for self-describing scientific data (netCDF, OpenDAP, etc.).

- [Iris][iris] (supported by the UK Met office) is a similar package
designed for working with geophysical datasets in Python. Iris provided
much of the inspiration for scidata (e.g., scidata's `DatasetArray` is
largely based on the Iris `Cube`), but it has several limitations that led
us to build scidata instead of extending Iris:
much of the inspiration for xray (e.g., xray's `DatasetArray` is largely
based on the Iris `Cube`), but it has several limitations that led us to
build xray instead of extending Iris:
1. Iris has essentially one first-class object (the `Cube`) on which it
attempts to build all functionality (`Coord` supports a much more
limited set of functionality). scidata has its equivalent of the Cube
limited set of functionality). xray has its equivalent of the Cube
(the `DatasetArray` object), but it is only a thin wrapper on the more
primitive building blocks of Dataset and Variable objects.
primitive building blocks of Dataset and Array objects.
2. Iris has a strict interpretation of [CF conventions][cf], which,
although a principled choice, we have found to be impractical for
everyday uses. With Iris, every quantity has physical (SI) units, all
Expand All @@ -55,14 +58,14 @@ used for self-describing scientific data (netCDF, OpenDAP, etc.).
models of how Iris functions work. Moreover, it means that a lot of
logic (e.g., constraint handling) uses non-vectorized operations. For
example, extracting all times within a range can be surprisingly slow
(e.g., 0.3 seconds vs 3 milliseconds in scidata to select along a time
(e.g., 0.3 seconds vs 3 milliseconds in xray to select along a time
dimension with 10000 elements).
- [pandas][pandas] is fast and powerful but oriented around working with
tabular datasets. pandas has experimental N-dimensional panels, but they
don't support aligned math with other objects. We believe the
`DatasetArray`/ `Cube` model is better suited to working with scientific
datasets. We use pandas internally in scidata to support fast indexing.
- [netCDF4-python][nc4] provides scidata's primary interface for working with
datasets. We use pandas internally in xray to support fast indexing.
- [netCDF4-python][nc4] provides xray's primary interface for working with
netCDF and OpenDAP datasets.

[pandas]: http://pandas.pydata.org/
Expand Down
14 changes: 7 additions & 7 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# scidata documentation build configuration file, created by
# xray documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 6 18:57:54 2014.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -53,7 +53,7 @@
master_doc = 'index'

# General information about the project.
project = u'scidata'
project = u'xray'
copyright = u'2014, Stephan Hoyer and Alex Kleeman'

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -186,7 +186,7 @@
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'scidatadoc'
htmlhelp_basename = 'xraydoc'


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -206,7 +206,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'scidata.tex', u'scidata Documentation',
('index', 'xray.tex', u'xray Documentation',
u'Stephan Hoyer and Alex Kleeman', 'manual'),
]

Expand Down Expand Up @@ -236,7 +236,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'scidata', u'scidata Documentation',
('index', 'xray', u'xray Documentation',
[u'Stephan Hoyer and Alex Kleeman'], 1)
]

Expand All @@ -250,8 +250,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'scidata', u'scidata Documentation',
u'Stephan Hoyer and Alex Kleeman', 'scidata', 'One line description of project.',
('index', 'xray', u'xray Documentation',
u'Stephan Hoyer and Alex Kleeman', 'xray', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
SciData reference
=================
xray reference
==============

Contents:

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
except:
from distutils.core import setup

setup(name='scidata',
setup(name='xray',
version='0.1-dev',
description='Objects for holding self describing scientific data in python',
author='Stephan Hoyer, Alex Kleeman',
Expand All @@ -15,5 +15,5 @@
tests_require=['nose >= 1.0'],
url='https://github.com/akleeman/scidata',
test_suite='nose.collector',
packages=['scidata'],
packages=['xray'],
package_dir={'': 'src'})
File renamed without changes.
4 changes: 2 additions & 2 deletions src/scidata/array_.py → src/xray/array_.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __repr__(self):
contents = ' (%s): %s' % (dim_summary, self.dtype)
else:
contents = ': %s' % self.data
return '<scidata.%s%s>' % (type(self).__name__, contents)
return '<xray.%s%s>' % (type(self).__name__, contents)

def indexed_by(self, **indexers):
"""Return a new variable indexed along the specified dimension(s)
Expand Down Expand Up @@ -591,7 +591,7 @@ def _broadcast_variable_data(self, other):
if isinstance(other, dataset.Dataset):
raise TypeError('datasets do not support mathematical operations')
elif all(hasattr(other, attr) for attr in ['dimensions', 'data', 'shape']):
# `other` satisfies the scidata.Array API
# `other` satisfies the xray.Array API
new_self, new_other = broadcast_variables(self, other)
self_data = new_self.data
other_data = new_other.data
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions src/scidata/dataset.py → src/xray/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __repr__(self):
(k, str(v).replace(
'\n', '\n' + ' ' * (len(k) + 4)))
for k, v in self.items())
return ("<class 'scidata.data.%s' (dict-like)>\n%s"
return ("<class 'xray.data.%s' (dict-like)>\n%s"
% (type(self).__name__, contents))


Expand Down Expand Up @@ -432,9 +432,8 @@ def __str__(self):
def __repr__(self):
dim_summary = ', '.join('%s%s: %s' % ('@' if k in self else '', k, v)
for k, v in self.dimensions.iteritems())
return '<scidata.%s (%s): %s>' % (type(self).__name__,
dim_summary,
' '.join(self.noncoordinates))
return '<xray.%s (%s): %s>' % (type(self).__name__, dim_summary,
' '.join(self.noncoordinates))

def create_variable(self, name, dims, data, attributes=None):
"""Create a new variable and add it to this dataset
Expand Down
4 changes: 2 additions & 2 deletions src/scidata/dataset_array.py → src/xray/dataset_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, dataset, focus):
"""
Parameters
----------
dataset : scidata.Dataset
dataset : xray.Dataset
The dataset on which to build this data view.
focus : str
The name of the "focus variable" in `dataset` on which this object
Expand Down Expand Up @@ -155,7 +155,7 @@ def __repr__(self):
contents = ' (%s): %s' % (dim_summary, self.dtype)
else:
contents = ': %s' % self.data
return '<scidata.%s %r%s>' % (type(self).__name__, self.focus, contents)
return '<xray.%s %r%s>' % (type(self).__name__, self.focus, contents)

def indexed_by(self, **indexers):
"""Return a new dataset array whose dataset is given by indexing along
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from numpy.testing import assert_array_equal

from scidata import utils
from xray import utils


class TestCase(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions test/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np

from scidata import Array, Dataset
from xray import Array, Dataset
from . import TestCase


Expand Down Expand Up @@ -41,7 +41,7 @@ def test_properties(self):

def test_repr(self):
v = Array(['time', 'x'], self.d)
self.assertEqual('<scidata.Array (time: 10, x: 3): float64>',
self.assertEqual('<xray.Array (time: 10, x: 3): float64>',
repr(v))

def test_items(self):
Expand Down
4 changes: 2 additions & 2 deletions test/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import numpy as np
import pandas as pd

from scidata import Dataset, DatasetArray, Array, backends, open_dataset
from xray import Dataset, DatasetArray, Array, backends, open_dataset
from . import TestCase


Expand Down Expand Up @@ -42,7 +42,7 @@ def get_store(self):

def test_repr(self):
data = create_test_data(self.get_store())
self.assertEqual('<scidata.Dataset (time: 1000, @dim1: 100, '
self.assertEqual('<xray.Dataset (time: 1000, @dim1: 100, '
'@dim2: 50, @dim3: 10): var1 var2 var3>', repr(data))

def test_init(self):
Expand Down
2 changes: 1 addition & 1 deletion test/test_dataset_array.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from scidata import Dataset, DatasetArray, Array, intersection
from xray import Dataset, DatasetArray, Array, intersection
from . import TestCase, ReturnItem


Expand Down
2 changes: 1 addition & 1 deletion test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np
import pandas as pd

from scidata import utils
from xray import utils
from . import TestCase, ReturnItem


Expand Down

0 comments on commit f08e2eb

Please sign in to comment.