Skip to content
Snippets Groups Projects
Commit 00d7520e authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

use a SortedList

parent 4430059b
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ import six ...@@ -5,6 +5,7 @@ import six
from firanka.exceptions import NotInDomainError from firanka.exceptions import NotInDomainError
from firanka.ranges import Range, EMPTY_SET from firanka.ranges import Range, EMPTY_SET
from sortedcontainers import SortedList
class Series(object): class Series(object):
...@@ -117,6 +118,9 @@ class Series(object): ...@@ -117,6 +118,9 @@ class Series(object):
class DiscreteSeries(Series): class DiscreteSeries(Series):
def __init__(self, data, domain=None, *args, **kwargs): def __init__(self, data, domain=None, *args, **kwargs):
data = SortedList(data)
if len(data) == 0: if len(data) == 0:
domain = EMPTY_SET domain = EMPTY_SET
elif domain is None: elif domain is None:
......
...@@ -20,7 +20,7 @@ author_email = piotrm@dms-serwis.pl ...@@ -20,7 +20,7 @@ author_email = piotrm@dms-serwis.pl
url = https://github.com/smok-serwis/firanka url = https://github.com/smok-serwis/firanka
[pycodestyle] [pycodestyle]
max-line-length=80 max-line-length=100
[bdist_wheel] [bdist_wheel]
universal=1 universal=1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment