Skip to content

Commit 3cffe8c

Browse files
committed
Update for compatibility with attrs v19.2
The deprecated `convert` argument is replaced by `converter`.
1 parent 393defb commit 3cffe8c

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

floweaver/ordering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def _convert_layers(layers):
1515

1616
@attr.s(slots=True, frozen=True, repr=False)
1717
class Ordering(object):
18-
layers = attr.ib(convert=_convert_layers)
18+
layers = attr.ib(converter=_convert_layers)
1919

2020
def __repr__(self):
2121
def format_layer(layer):

floweaver/partition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ def _validate_query(instance, attribute, value):
99

1010
@attr.s(slots=True, frozen=True)
1111
class Group(object):
12-
label = attr.ib(convert=str)
13-
query = attr.ib(convert=tuple, validator=_validate_query)
12+
label = attr.ib(converter=str)
13+
query = attr.ib(converter=tuple, validator=_validate_query)
1414

1515

1616
@attr.s(slots=True, frozen=True)
1717
class Partition(object):
18-
groups = attr.ib(default=attr.Factory(tuple), convert=tuple)
18+
groups = attr.ib(default=attr.Factory(tuple), converter=tuple)
1919

2020
@property
2121
def labels(self):

floweaver/sankey_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SankeyData(object):
2626
nodes = attr.ib()
2727
links = attr.ib()
2828
groups = attr.ib(default=attr.Factory(list))
29-
ordering = attr.ib(convert=_convert_ordering, default=Ordering([[]]))
29+
ordering = attr.ib(converter=_convert_ordering, default=Ordering([[]]))
3030
dataset = attr.ib(default=None)
3131

3232
def to_json(self, filename=None, format=None):
@@ -152,7 +152,7 @@ class SankeyLink(object):
152152
value = attr.ib(default=0.0)
153153
title = attr.ib(default=None, validator=_validate_opt_str)
154154
color = attr.ib(default=None, validator=_validate_opt_str)
155-
opacity = attr.ib(default=1.0, convert=float, validator=_validate_opacity)
155+
opacity = attr.ib(default=1.0, converter=float, validator=_validate_opacity)
156156
original_flows = attr.ib(default=attr.Factory(list))
157157

158158
def to_json(self, format=None):

floweaver/sankey_definition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ def _validate_ordering(instance, attribute, ordering):
5757
@attr.s(slots=True, frozen=True)
5858
class SankeyDefinition(object):
5959
nodes = attr.ib()
60-
bundles = attr.ib(convert=_convert_bundles_to_dict,
60+
bundles = attr.ib(converter=_convert_bundles_to_dict,
6161
validator=_validate_bundles)
62-
ordering = attr.ib(convert=_convert_ordering, validator=_validate_ordering)
62+
ordering = attr.ib(converter=_convert_ordering, validator=_validate_ordering)
6363
flow_selection = attr.ib(default=None)
6464
flow_partition = attr.ib(default=None)
6565
time_partition = attr.ib(default=None)
@@ -169,7 +169,7 @@ class Bundle(object):
169169
"""
170170
source = attr.ib()
171171
target = attr.ib()
172-
waypoints = attr.ib(default=attr.Factory(tuple), convert=tuple)
172+
waypoints = attr.ib(default=attr.Factory(tuple), converter=tuple)
173173
flow_selection = attr.ib(default=None, validator=_validate_flow_selection)
174174
flow_partition = attr.ib(default=None)
175175
default_partition = attr.ib(default=None)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def find_version(*file_paths):
6161
install_requires=[
6262
'numpy',
6363
'pandas',
64-
'attrs',
6564
'networkx >=2.1',
65+
'attrs >=17.4',
6666
'palettable',
6767
],
6868
extras_require={

0 commit comments

Comments
 (0)