Skip to content

Commit

Permalink
journalism is now known as agate. Closes #179.
Browse files Browse the repository at this point in the history
  • Loading branch information
onyxfish committed Aug 28, 2015
1 parent f0fc951 commit 90b9888
Show file tree
Hide file tree
Showing 56 changed files with 211 additions and 225 deletions.
5 changes: 1 addition & 4 deletions ARCHITECTURE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
A few notes regarding journalism's internal architecture. (Users should not care about any of these things.)
A few notes regarding agate's internal architecture. (Users should not care about any of these things.)

* Operations on Tables return new Tables.

Expand All @@ -11,6 +11,3 @@ A few notes regarding journalism's internal architecture. (Users should not care
* ColumnMapping, RowSequence, Column, and Row have **read only** access to a Table's private variables. They are purely a formal abstraction and for purposes of encapsulation they can be treated as a single unit.

* Columns lazily construct a copy of their data from their parent Table and then cache it.

* Operations accept functional arguments wherever possible for maximum flexibility.

2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The following individuals have contributed code to journalism:
The following individuals have contributed code to agate:

* Mick O'Brien
* Christopher Groskopf
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0.5.0
-----

* Renamed the library to agate. (#179)
* Results of common column operations are now cached using a common memoize decorator. (#162)
* Deprecated support for Python version 3.2.
* Added support for Python wheel packaging. (#127)
Expand Down
10 changes: 5 additions & 5 deletions README
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
journalism is a Python data analysis library designed for humans working in the real world. It is an alternative to numpy and pandas that is optimized for making humans faster at working with normal-sized datasets.
agate is a Python data analysis library designed for humans working in the real world. It is an alternative to numpy and pandas that is optimized for making humans faster at working with normal-sized datasets.

It is inspired by underscore.js and all the other libraries that know how to get the hell out of the way and let us do Journalism.
agate was previously known as journalism.

Important links:

* Repository: https://github.com/onyxfish/journalism
* Issues: https://github.com/onyxfish/journalism/issues
* Documentation: http://journalism.rtfd.org
* Repository: https://github.com/onyxfish/agate
* Issues: https://github.com/onyxfish/agate/issues
* Documentation: http://agate.rtfd.org
12 changes: 12 additions & 0 deletions agate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python

from agate.aggregators import *
from agate.columns import *
from agate.column_types import *
from agate.computations import *
from agate.exceptions import *
from agate.table import Table
from agate.tableset import TableSet

def save():
raise NotImplementedError
6 changes: 3 additions & 3 deletions journalism/aggregators.py → agate/aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from collections import defaultdict
import datetime

from journalism.column_types import BooleanType, NumberType
from journalism.columns import BooleanColumn, DateColumn, DateTimeColumn, NumberColumn, TextColumn
from journalism.exceptions import NullComputationError, UnsupportedAggregationError
from agate.column_types import BooleanType, NumberType
from agate.columns import BooleanColumn, DateColumn, DateTimeColumn, NumberColumn, TextColumn
from agate.exceptions import NullComputationError, UnsupportedAggregationError

class Aggregation(object): #pragma: no cover
"""
Expand Down
12 changes: 6 additions & 6 deletions journalism/column_types.py → agate/column_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from dateutil.parser import parse
import six

from journalism.exceptions import CastError
from agate.exceptions import CastError

#: String values which will be automatically cast to :code:`None`.
NULL_VALUES = ('', 'na', 'n/a', 'none', 'null', '.')
Expand Down Expand Up @@ -59,7 +59,7 @@ def cast(self, d):
raise CastError('Can not convert value %s to bool for BooleanColumn.' % d)

def _create_column(self, table, index):
from journalism.columns import BooleanColumn
from agate.columns import BooleanColumn

return BooleanColumn(table, index)

Expand Down Expand Up @@ -93,7 +93,7 @@ def cast(self, d):
return parse(d).date()

def _create_column(self, table, index):
from journalism.columns import DateColumn
from agate.columns import DateColumn

return DateColumn(table, index)

Expand Down Expand Up @@ -127,7 +127,7 @@ def cast(self, d):
return parse(d)

def _create_column(self, table, index):
from journalism.columns import DateTimeColumn
from agate.columns import DateTimeColumn

return DateTimeColumn(table, index)

Expand Down Expand Up @@ -160,7 +160,7 @@ def cast(self, d):
raise CastError('Can not convert value "%s" to Decimal for NumberColumn.' % d)

def _create_column(self, table, index):
from journalism.columns import NumberColumn
from agate.columns import NumberColumn

return NumberColumn(table, index)

Expand All @@ -187,6 +187,6 @@ def cast(self, d):
return six.text_type(d)

def _create_column(self, table, index):
from journalism.columns import TextColumn
from agate.columns import TextColumn

return TextColumn(table, index)
7 changes: 7 additions & 0 deletions agate/columns/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python

from agate.columns.boolean import BooleanColumn
from agate.columns.date import DateColumn
from agate.columns.date_time import DateTimeColumn
from agate.columns.number import NumberColumn
from agate.columns.text import TextColumn
6 changes: 3 additions & 3 deletions journalism/columns/base.py → agate/columns/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import six

from journalism.exceptions import ColumnDoesNotExistError
from journalism.utils import memoize
from agate.exceptions import ColumnDoesNotExistError
from agate.utils import memoize

class ColumnMapping(Mapping):
"""
Expand Down Expand Up @@ -81,7 +81,7 @@ def __unicode__(self):

sample = '(%s)' % sample

return '<journalism.columns.%s: %s>' % (self.__class__.__name__, sample)
return '<agate.columns.%s: %s>' % (self.__class__.__name__, sample)

def __str__(self):
return str(self.__unicode__())
Expand Down
2 changes: 1 addition & 1 deletion journalism/columns/boolean.py → agate/columns/boolean.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

from journalism.columns.base import Column
from agate.columns.base import Column

class BooleanColumn(Column):
"""
Expand Down
2 changes: 1 addition & 1 deletion journalism/columns/date.py → agate/columns/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import datetime

from journalism.columns.base import Column
from agate.columns.base import Column

class DateColumn(Column):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from dateutil.parser import parse

from journalism.columns.base import Column
from agate.columns.base import Column

class DateTimeColumn(Column):
"""
Expand Down
6 changes: 3 additions & 3 deletions journalism/columns/number.py → agate/columns/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import six

from journalism.columns.base import Column
from journalism.exceptions import NullComputationError
from journalism.utils import memoize
from agate.columns.base import Column
from agate.exceptions import NullComputationError
from agate.utils import memoize

class NumberColumn(Column):
"""
Expand Down
2 changes: 1 addition & 1 deletion journalism/columns/text.py → agate/columns/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import six

from journalism.columns.base import Column
from agate.columns.base import Column

class TextColumn(Column):
"""
Expand Down
12 changes: 6 additions & 6 deletions journalism/computations.py → agate/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
columns.
"""

from journalism.aggregators import Mean, StDev
from journalism.columns import NumberColumn
from journalism.column_types import NumberType
from journalism.exceptions import UnsupportedComputationError
from journalism.utils import NullOrder
from agate.aggregators import Mean, StDev
from agate.columns import NumberColumn
from agate.column_types import NumberType
from agate.exceptions import UnsupportedComputationError
from agate.utils import NullOrder

class Computation(object): #pragma: no cover
"""
Base class for row-wise computations on :class:`.Table`s.
Base class for row-wise computations on a :class:`.Table`.
"""
def get_computed_column_type(self):
"""
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions journalism/rows.py → agate/rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
if six.PY3:
xrange = range

from journalism.exceptions import ColumnDoesNotExistError, RowDoesNotExistError
from journalism.utils import memoize
from agate.exceptions import ColumnDoesNotExistError, RowDoesNotExistError
from agate.utils import memoize

class RowSequence(Sequence):
"""
Expand Down Expand Up @@ -61,7 +61,7 @@ def __unicode__(self):

sample = '(%s)' % sample

return '<journalism.rows.Row: %s>' % sample
return '<agate.rows.Row: %s>' % sample

def __str__(self):
return str(self.__unicode__())
Expand Down
16 changes: 8 additions & 8 deletions journalism/table.py → agate/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""
This module contains the :class:`Table` object, which is the central data
structure in :code:`journalism`.
structure in :code:`agate`.
"""

from copy import copy
Expand All @@ -14,13 +14,13 @@

import six

from journalism.aggregators import Sum, Mean, Median, StDev, MAD
from journalism.columns.base import ColumnMapping
from journalism.computations import Computation
from journalism.exceptions import ColumnDoesNotExistError, RowDoesNotExistError
from journalism.rows import RowSequence, Row
from journalism.tableset import TableSet
from journalism.utils import NullOrder, memoize
from agate.aggregators import Sum, Mean, Median, StDev, MAD
from agate.columns.base import ColumnMapping
from agate.computations import Computation
from agate.exceptions import ColumnDoesNotExistError, RowDoesNotExistError
from agate.rows import RowSequence, Row
from agate.tableset import TableSet
from agate.utils import NullOrder, memoize

class Table(object):
"""
Expand Down
8 changes: 4 additions & 4 deletions journalism/tableset.py → agate/tableset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
except ImportError: # pragma: no cover
from ordereddict import OrderedDict

from journalism.aggregators import Aggregation
from journalism.column_types import TextType, NumberType
from journalism.exceptions import ColumnDoesNotExistError
from journalism.rows import RowSequence
from agate.aggregators import Aggregation
from agate.column_types import TextType, NumberType
from agate.exceptions import ColumnDoesNotExistError
from agate.rows import RowSequence

class TableMethodProxy(object):
"""
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/journalism.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/agate.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/journalism.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/agate.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/journalism"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/journalism"
@echo "# mkdir -p $$HOME/.local/share/devhelp/agate"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/agate"
@echo "# devhelp"

epub:
Expand Down
4 changes: 2 additions & 2 deletions docs/api/aggregators.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
======================
journalism.aggregators
agate.aggregators
======================

.. automodule:: journalism.aggregators
.. automodule:: agate.aggregators
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/api/column_types.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=======================
journalism.column_types
agate.column_types
=======================

.. automodule:: journalism.column_types
.. automodule:: agate.column_types
:members:
:undoc-members:
14 changes: 7 additions & 7 deletions docs/api/columns.rst
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
==================
journalism.columns
agate.columns
==================

.. automodule:: journalism.columns.base
.. automodule:: agate.columns.base
:members:
:undoc-members:
:show-inheritance:

.. automodule:: journalism.columns.boolean
.. automodule:: agate.columns.boolean
:members:
:undoc-members:
:show-inheritance:

.. automodule:: journalism.columns.date
.. automodule:: agate.columns.date
:members:
:undoc-members:
:show-inheritance:

.. automodule:: journalism.columns.date_time
.. automodule:: agate.columns.date_time
:members:
:undoc-members:
:show-inheritance:

.. automodule:: journalism.columns.number
.. automodule:: agate.columns.number
:members:
:undoc-members:
:show-inheritance:

.. automodule:: journalism.columns.text
.. automodule:: agate.columns.text
:members:
:undoc-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/api/computations.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=======================
journalism.computations
agate.computations
=======================

.. automodule:: journalism.computations
.. automodule:: agate.computations
:members:
:undoc-members:
:show-inheritance:
5 changes: 2 additions & 3 deletions docs/api/exceptions.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
=====================
journalism.exceptions
agate.exceptions
=====================

.. automodule:: journalism.exceptions
.. automodule:: agate.exceptions
:members:
:undoc-members:

0 comments on commit 90b9888

Please sign in to comment.