Skip to content

Commit

Permalink
Added highcharts transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
twheys committed Jan 23, 2018
1 parent 2430f79 commit d13ed5d
Show file tree
Hide file tree
Showing 18 changed files with 1,458 additions and 585 deletions.
2 changes: 1 addition & 1 deletion fireant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
Pandas,
)

__version__ = '{major}.{minor}.{patch}'.format(major=1, minor=0, patch=0)
__version__ = '1.0.0'
21 changes: 16 additions & 5 deletions fireant/slicer/dimensions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from fireant.utils import immutable

from .base import SlicerElement
from .exceptions import QueryException
from .filters import (
Expand Down Expand Up @@ -30,7 +31,9 @@ class BooleanDimension(Dimension):
"""

def __init__(self, key, label=None, definition=None):
super(BooleanDimension, self).__init__(key=key, label=label, definition=definition)
super(BooleanDimension, self).__init__(key=key,
label=label,
definition=definition)

def is_(self, value):
return BooleanFilter(self.definition, value)
Expand All @@ -43,7 +46,9 @@ class CategoricalDimension(Dimension):
"""

def __init__(self, key, label=None, definition=None, display_values=()):
super(CategoricalDimension, self).__init__(key=key, label=label, definition=definition)
super(CategoricalDimension, self).__init__(key=key,
label=label,
definition=definition)
self.display_values = dict(display_values)

def isin(self, values):
Expand Down Expand Up @@ -89,17 +94,23 @@ class ContinuousDimension(Dimension):
"""

def __init__(self, key, label=None, definition=None, default_interval=NumericInterval(1, 0)):
super(ContinuousDimension, self).__init__(key=key, label=label, definition=definition)
super(ContinuousDimension, self).__init__(key=key,
label=label,
definition=definition)
self.interval = default_interval


class DatetimeDimension(ContinuousDimension):
"""
WRITEME
A subclass of ContinuousDimension which reflects a date/time data type. Intervals are replaced with time intervals
such as daily, weekly, annually, etc. A reference can be used to show a comparison over time such as
week-over-week or month-over-month.
"""

def __init__(self, key, label=None, definition=None, default_interval=daily):
super(DatetimeDimension, self).__init__(key=key, label=label, definition=definition,
super(DatetimeDimension, self).__init__(key=key,
label=label,
definition=definition,
default_interval=default_interval)
self.references = []

Expand Down
4 changes: 2 additions & 2 deletions fireant/slicer/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ def __init__(self, element_key, value):
class ContainsFilter(DimensionFilter):
def __init__(self, dimension_definition, values):
definition = dimension_definition.isin(values)
super(DimensionFilter, self).__init__(definition)
super(ContainsFilter, self).__init__(definition)


class ExcludesFilter(DimensionFilter):
def __init__(self, dimension_definition, values):
definition = dimension_definition.notin(values)
super(DimensionFilter, self).__init__(definition)
super(ExcludesFilter, self).__init__(definition)


class RangeFilter(DimensionFilter):
Expand Down
Loading

0 comments on commit d13ed5d

Please sign in to comment.