%load_ext autoreload
%autoreload 2
2022-02-02
Node features that have None
values are written incorrectly to disk.
They should be written to disk as if the values were absent.
We test the fix.
from tf.app import use
A = use('annotation/banks:clone', checkout='clone', hoist=globals())
This is Text-Fabric 9.2.3 Api reference : https://annotation.github.io/text-fabric/tf/cheatsheet.html 10 features found and 0 ignored
meta = dict(
valueType="str",
)
absent = {
1: "aap",
3: "mies",
}
none = {
1: "aap",
2: None,
3: "mies",
}
absentnr = {
1: "aap",
2: "aap",
5: "mies",
6: "mies",
}
nonenr = {
1: "aap",
2: "aap",
3: None,
4: None,
5: "mies",
6: "mies",
}
TF.save(
nodeFeatures=dict(absent=absent, none=none, absentnr=absentnr, nonenr=nonenr),
metaData=dict(absent=meta, none=meta, absentnr=meta, nonenr=meta),
location="~/github/annotation/banks/test",
)
A = use('annotation/banks:clone', checkout='clone', mod="annotation/banks/test:clone", hoist=globals())
for feat in ("absentnr", "nonenr"):
TF.features[feat].save(overwrite=True, nodeRanges=True)
0.00s Exporting 4 node and 0 edge and 0 config features to ~/github/annotation/banks/test/0.2: | 0.00s T absent to ~/github/annotation/banks/test/0.2 | 0.00s T absentnr to ~/github/annotation/banks/test/0.2 | 0.00s T none to ~/github/annotation/banks/test/0.2 | 0.00s T nonenr to ~/github/annotation/banks/test/0.2 0.01s Exported 4 node features and 0 edge features and 0 config features to ~/github/annotation/banks/test/0.2
This is Text-Fabric 9.2.3 Api reference : https://annotation.github.io/text-fabric/tf/cheatsheet.html 14 features found and 0 ignored | 0.00s T absent from ~/github/annotation/banks/test/0.2 | 0.00s T absentnr from ~/github/annotation/banks/test/0.2 | 0.00s T none from ~/github/annotation/banks/test/0.2 | 0.00s T nonenr from ~/github/annotation/banks/test/0.2
sets={'aap': [1, 2], 'mies': [5, 6]} | 0.00s T absentnr to ~/github/annotation/banks/test/0.2 sets={'aap': [1, 2], 'mies': [5, 6]} | 0.00s T nonenr to ~/github/annotation/banks/test/0.2
F.absent.items()
dict_items([(1, 'aap'), (3, 'mies')])
F.none.items()
dict_items([(1, 'aap'), (3, 'mies')])
F.absentnr.items()
dict_items([(1, 'aap'), (2, 'aap'), (5, 'mies'), (6, 'mies')])
F.nonenr.items()
dict_items([(1, 'aap'), (2, 'aap'), (5, 'mies'), (6, 'mies')])