-
-
Notifications
You must be signed in to change notification settings - Fork 73
Row IDs #412
Row IDs #412
Changes from all commits
3065280
773d0dd
572cdf1
edd86e9
6bb24ad
c48ea44
b1f2a39
e203497
76b59a9
35dc91d
45928b0
8be7509
397b914
8f01c25
1c69cfb
3e31a7f
7738a3a
1490265
196416f
b6a5f55
2ed6728
5cec33f
9420590
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import collections | ||
import inspect | ||
import sys | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dunno why, but locally There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Running the same versions? I've found that the default rules are updated frequently.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh actually There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. stricter linting -> 8f01c25 |
||
|
||
|
||
def get_named_tuple(name, dict): | ||
|
@@ -26,23 +24,23 @@ def get_named_tuple(name, dict): | |
}) | ||
|
||
Prefix = get_named_tuple('prefix', { | ||
'yocto': 10**-24, | ||
'zepto': 10**-21, | ||
'atto': 10**-18, | ||
'femto': 10**-15, | ||
'pico': 10**-12, | ||
'nano': 10**-9, | ||
'micro': 10**-6, | ||
'milli': 10**-3, | ||
'yocto': 10 ** -24, | ||
'zepto': 10 ** -21, | ||
'atto': 10 ** -18, | ||
'femto': 10 ** -15, | ||
'pico': 10 ** -12, | ||
'nano': 10 ** -9, | ||
'micro': 10 ** -6, | ||
'milli': 10 ** -3, | ||
'none': None, | ||
'kilo': 10**3, | ||
'mega': 10**6, | ||
'giga': 10**9, | ||
'tera': 10**12, | ||
'peta': 10**15, | ||
'exa': 10**18, | ||
'zetta': 10**21, | ||
'yotta': 10**24 | ||
'kilo': 10 ** 3, | ||
'mega': 10 ** 6, | ||
'giga': 10 ** 9, | ||
'tera': 10 ** 12, | ||
'peta': 10 ** 15, | ||
'exa': 10 ** 18, | ||
'zetta': 10 ** 21, | ||
'yotta': 10 ** 24 | ||
}) | ||
|
||
Scheme = get_named_tuple('scheme', { | ||
|
@@ -102,11 +100,17 @@ def __init__(self, **kwargs): | |
'type': Scheme.default | ||
} | ||
|
||
valid_methods = [m for m in dir(self.__class__) if m[0] != '_' and m != 'to_plotly_json'] | ||
valid_methods = [ | ||
m for m in dir(self.__class__) | ||
if m[0] != '_' and m != 'to_plotly_json' | ||
] | ||
|
||
for kw, val in kwargs.items(): | ||
if kw not in valid_methods: | ||
raise TypeError('{0} is not a format method. Expected one of'.format(kw), str(list(valid_methods))) | ||
raise TypeError( | ||
'{0} is not a format method. Expected one of'.format(kw), | ||
str(list(valid_methods)) | ||
) | ||
|
||
getattr(self, kw)(val) | ||
|
||
|
@@ -128,7 +132,8 @@ def _validate_non_negative_integer_or_none(self, value): | |
|
||
def _validate_named(self, value, named_values): | ||
if value not in named_values: | ||
raise TypeError('expected value to be one of', str(list(named_values))) | ||
raise TypeError('expected value to be one of', | ||
str(list(named_values))) | ||
|
||
def _validate_string(self, value): | ||
if not isinstance(value, (str, u''.__class__)): | ||
|
@@ -174,7 +179,9 @@ def padding_width(self, value): | |
def precision(self, value): | ||
self._validate_non_negative_integer_or_none(value) | ||
|
||
self._specifier['precision'] = '.{0}'.format(value) if value is not None else '' | ||
self._specifier['precision'] = ( | ||
'.{0}'.format(value) if value is not None else '' | ||
) | ||
return self | ||
|
||
def scheme(self, value): | ||
|
@@ -238,13 +245,20 @@ def group_delimiter(self, value): | |
return self | ||
|
||
def groups(self, groups): | ||
groups = groups if isinstance(groups, list) else [groups] if isinstance(groups, int) else None | ||
groups = ( | ||
groups if isinstance(groups, list) else | ||
[groups] if isinstance(groups, int) else None | ||
) | ||
|
||
if not isinstance(groups, list): | ||
raise TypeError('expected groups to be an integer or a list of integers') | ||
|
||
raise TypeError( | ||
'expected groups to be an integer or a list of integers' | ||
) | ||
if len(groups) == 0: | ||
raise ValueError('expected groups to be an integer or a list of one or more integers') | ||
raise ValueError( | ||
'expected groups to be an integer or a list of ' | ||
'one or more integers' | ||
) | ||
|
||
for group in groups: | ||
if not isinstance(group, int): | ||
|
@@ -273,8 +287,9 @@ def to_plotly_json(self): | |
f['locale'] = self._locale.copy() | ||
f['nully'] = self._nully | ||
f['prefix'] = self._prefix | ||
aligned = self._specifier['align'] != Align.default | ||
f['specifier'] = '{}{}{}{}{}{}{}{}{}{}'.format( | ||
self._specifier['fill'] if self._specifier['align'] != Align.default else '', | ||
self._specifier['fill'] if aligned else '', | ||
self._specifier['align'], | ||
self._specifier['sign'], | ||
self._specifier['symbol'], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from enum import Enum | ||
from .Format import Format, Group, Scheme, Sign, Symbol | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
"private::host_dash8083": "python tests/cypress/dash/v_fe_page.py", | ||
"private::host_js": "http-server ./dash_table -c-1 --silent", | ||
"private::lint:ts": "tslint '{src,demo,tests}/**/*.{js,ts,tsx}' --exclude '**/@Types/*.*'", | ||
"private::lint:py": "flake8 --exclude=DataTable.py,__init__.py,_imports_.py --ignore=E501,F401,F841,F811,F821 dash_table", | ||
"private::lint:py": "flake8 --exclude=DataTable.py,__init__.py,_imports_.py dash_table", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for cleaning that up / removing the exceptions |
||
"private::wait_dash8081": "wait-on http://localhost:8081", | ||
"private::wait_dash8082": "wait-on http://localhost:8082", | ||
"private::wait_dash8083": "wait-on http://localhost:8083", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this wasn't done in this PR, but should there be some symmetry with
sorting_settings
->sort
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Used the filtering breaking changes as an opportunity to rename the props but limited myself to those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now does seem like a good time to change this, but I might vote for
sort_by
-sort
could be interpreted to mean "only sort these columns," rather than the actual "sort all columns based on these ones"