NetworkX 2.4#
发布日期:2019年10月16日
支持 Python 3.5、3.6、3.7 和 3.8。这是最后一个支持 Python 3.5 的版本。
NetworkX 是一个用于创建、操作和研究复杂网络结构、动力学和功能的 Python 软件包。
有关更多信息,请访问我们的网站和我们的示例图库。请将意见和问题发送至networkx-discuss 邮件列表。
亮点#
此版本是 67 位贡献者经过 6 个月工作、超过 200 次提交的成果。亮点包括:
移除 1.x 中已废弃的代码
支持 Python 3.8
切换到 pytest 进行测试
最后一个支持 Python 3.5 的版本
新函数
barycenter 函数
Bethe Hessian 矩阵函数
Eulerian Path 方法
群中心性度量
子图单态同构
k-truss 算法
洋葱分解
电阻距离
小行星三元组
非随机性度量
线性 Prufer 编码
二分图最小权重匹配
增量紧密度中心性
ISMAGS 子图同构算法
创建图的弦图
新生成器
二项树生成器
有向联合度生成器
随机互联网 AS 图生成器
布局新特性
螺旋节点布局例程
支持 3d 布局
改进#
允许平均最短路径使用 Floyd-Warshall 方法
改进 GML、GEXF、GraphML 的读写
允许字符串或 json 对象作为 jit_graph 的输入
尝试在更多地方允许 numpy.array 输入代替列表
更快地计算强连通分量
更快地优化 Floyd-Warshall
更快地计算全局效率
更快地计算传递闭包
修复 unionfind;betweenness_subset;lexico-topo-sort;A*;inverse_line_graph;async label propagation;edgelist reading;Gomory-Hu flow method;label_propagation;partial_duplication;shell_layout 在 shell 中有 1 个节点时的错误;from_pandas_edgelist
文档改进和修复
API 变更#
工具函数 is_list_of_ints 改名为 is_bunch_of_ints,现在测试 int(item)==item 而不是 isinstance(_, int)。这允许例如值为整数的浮点数。
添加了工具函数 make_list_of_ints,用于将整数值容器转换为整数列表
废弃#
移除的函数(在 NetworkX 2.1 中标记为废弃)
attracting_component_subgraphs
connected_component_subgraphs
weakly_connected_component_subgraphs
strongly_connected_component_subgraphs
biconnected_component_subgraphs
关于如何获取子图,请参阅组件函数的文档。
移除的图对象方法(在 2.1 中标记为废弃)
G.add_path
G.add_cycle
G.add_star
G.nodes_with_selfloops
G.number_of_selfloops
G.selfloop_edges
这些现在是 NetworkX 函数,例如 nx.add_star(G, 5)
G.node –> 使用 G.nodes
G.fresh_copy –> 使用 G.__class__
移除 graphview 函数的旧名称。
ReverseView
SubGraph
SubMultiGraph
SubMultiDiGraph
SubDiGraph
GraphView
DiGraphView
MultiGraphView
MultiDiGraphView
MultiReverseView
使用 reverse_view、subgraph_view 和 generic_graph_view。
合并的 PR#
总共有 205 次更改已提交。
提升发布版本号
algorithms/traversal/edgebfs 名称修复 (#3397)
添加“另请参阅”链接 (#3403)
添加 Harary 图生成器的参考资料 (#3407)
typo: 交换源和目标 (#3413)
修复 spring_layout 在固定节点上的 bug (#3415)
将 LFR_benchmark 移到 generators (#3411)
添加 barycenter 算法 (#2939)
添加 Bethe Hessian 矩阵 (#3401)
二项树生成器 (#3409)
修复 edge_color 与 node_color 的不一致性及描述错误。 (#3395)
添加用于群中心性度量的模块 (#3421)
改进 edgelist 的“另请参阅” (#3423)
修复拼写错误 (#3424)
为 adamic_adar_index 添加关于自环的文档警告 (#3427)
修复 UnionFind 集合提取 (#3224)
在
write_graphml
示例中添加 required 参数 (#3429)修复 centrality betweenness subset (#3425)
添加两种版本的 Simrank 相似性 (#3222)
修复拼写错误
合并拉取请求 #3436 来自 nandahkrishna/fix-typo-betweenness-centrality-subset-test
重新排序并完善文档 (#3438)
为依赖 topological_sort 的函数添加 topo_order 参数 (#3447)
实现子图单态同构 (#3435)
在 random_degree_sequence_graph 文档字符串测试中设置种子 (#3451)
用 np.iterable 替换 cb.iterable (#3458)
不移除其他 pyplot axes 的刻度 (#3476)
修复 “G>raph Modelling Language” 中的拼写错误 (#3468)
朴素的 k-truss 算法实现。 (#3462)
添加洋葱分解 (#3461)
新特性 - 电阻距离 (#3385)
betweenness 不支持多重图 (#3454)
轮子只支持 Python 3
修复 Python 3.7 的废弃警告 (#3487)
修复 dfs_preorder_nodes 文档字符串将“nodes”说成“edges”的问题 (#3484)
添加群紧密度和群度中心性 (#3437)
修复不正确的文档 (#3495)
修复 Issue #3493 - lexicographical_topological_sort() 中的 Bug (#3494)
AT-自由图识别 (#3377)
更新 introduction.rst (#3504)
全连接操作和 cograph 生成器 (#3503)
优化强连通分量算法。 (#3516)
添加图的非随机性度量 (#3515)
为非随机性度量添加保护措施 (输入图 G) (#3526)
优化强连通分量算法 - 第二次尝试 (#3519)
修复在 Issue #3524 发现的 bug 的小改动 (#3529)
恢复检查 PyPy3 (#3514)
线性 Prufer 编码 (#3535)
修复 inverse_line_graph。 (#3507)
修复 A* 返回错误解的问题 (#3508)
实现二分图的最小权重全匹配 (#3527)
获取 #1054 的弦图 (#3353)
更快地计算 DAG 的传递闭包 (#3445)
在 write_graphml_lxml 中正确写入混合类型属性 (#3536)
修复 inverse_line_graph() 的一些边缘情况。 (#3538)
在 to_numpy_array 中明确说明 i.j 约定
增量紧密度中心性 (无向、无权图) (#3444)
实现 ISMAGS 子图同构算法 (#3312)
修复 networkx.algorithms.community.label_propagation.asyn_lpa_communities 中的 bug (#3545)
导出到 GML 时,将非 32 位数字写为字符串。 (#3540)
尝试修复 bug #3552 (#3554)
添加有向联合度图生成器 (#3551)
拼写错误 (#3557)
修复二分算法参考文档的一些问题 (#3555)
相关函数中邻接矩阵 i/o 的 i,j 约定
合并拉取请求 #3542 来自 malch2/doc/update
向 travis 添加 3.8-dev
修复 Py3.8 的字典迭代
暂时忽略其他失败
修复 get_edge_data 文档字符串中的拼写错误 (#3564)
修复错误的标题 (#3566)
修复文档字符串中的拼写错误 (#3568)
修复和改进 graph.py 中的文档字符串 (#3569)
改进图类选择表 (#3570)
为图绘制添加螺旋布局 (#3534)
#3575 返回 3d 布局的坐标 (#3576)
处理 Watts-Strogatz 图生成器中 k==n 的情况 (#3579)
Floyd-Warshall 优化 (#3400)
使用 Sphinx 2.2
添加 asteroidal 文档的缺失链接
修复 Sphinx 警告
修复 Sphinx latexpdf 构建
更新贡献者列表 (#3592)
将 Prim 从列表改为集合 (#3512)
修复 issue 3491 (#3588)
在 Python 3.8 失败时使 Travis 失败
修复 test_gexf 以处理 XML 属性的默认序列化顺序
移除 Py2 所需的 future imports
添加 internet_as_graph 生成器 (#3574)
移除 OutEdgeDataView 中的循环引用 (#3598)
为 draw_networkx_edges 添加最小源和目标边距。 (#3390)
修复 to_directed 函数 (#3599)
修复 #3573: GEXF 输出问题 (#3606)
全局效率提速尝试 (#3604)
Bug 修复:增加了读取标签和 ID 值的灵活性 (#3603)
为 average_shortest_path_length 添加 floyd-warshall 方法 (#3267)
将 is 替换为 == 并进行 minor pycodestyle 修复 (#3608)
修复许多基于文档的问题 (#3609)
解决许多文档问题 (#3611)
修复 #3187 transitive_closure 现在在存在环时返回自环 (#3613)
添加初始化 pagerank_scipy 的支持 (#3183)
添加 Gomory-hu 算法的最后 7 行 修复 #3293 (#3614)
实现 Euler Path 函数 (#3399)
修复 label_propagation.py 中边的方向 (#3619)
移除未使用的 random 模块导入 (#3620)
修复 partial_duplication_graph 中的操作顺序 (#3626)
在 shell_layout 中将有 1 个节点的 shell 远离原点 (#3629)
允许 jit_graph 读取 json 字符串或 json 对象 (#3628)
修复 incode 文档中的拼写错误 (#3621)
pycodestyle 并更新 greedy_coloring.py+tests 的文档 (#3631)
添加版本徽章
从 README 加载长描述
添加缺失的代码块 (#3630)
将 is_list_of_ints 更改为 make_list_of_ints (#3617)
当没有列匹配请求时,处理 from_pandas_edgelist 中的 edgeattr (#3634)
起草 v2.4 发布说明
将 notes 从 dev 移到 v2.4 文件名。
使用最新的 pypy
在 macos 上测试 Py 3.8
在 GEXF 中转换 inf/nan 之前添加属性类型检查 (#3636)
修复 sphinx 错误并为 dijkstra_path/length 文档添加 single_source_dijkstra 的链接 (#3638)
Document subgraph_view (#3627)
第一轮 pytest 修复
使用类方法进行类设置/拆卸
让 CI 使用 pytest
使用类方法进行类设置/拆卸,续
减少测试 (直到它能正常工作)
替换测试文件中的 from networkx import * 惯用法
修复 assert funcs 覆盖
修复 link_prediction 中的静态方法
部分修复 v2userfunc 测试
修复 graph/digraph 测试
修复 multigraph 检查
修复 multidigraph 检查
修复 test_function 检查
修复 distance_measures 测试
修复 decorators 测试
修复 test_mst 中的一些 raises
修复 clique 测试
修复 yaml 测试
修复 reportviews 中的测试
修复 vf2 测试
修复 mst 测试
修复 gdal 测试
将 nose.tools.assert_* 函数转换为 asserts
移除未使用的导入
修复一些警告
更新测试说明
重新启用所有测试平台
修复一些 __init__ 警告
替换 test_coloring.py 中的 nose yield tests
添加测试、覆盖率和开发环境信息
尝试 pytestimportorskip
pytest.importorskip 的另两对变体
修复拼写错误再试一次
移除已废弃的 weakly_connected_component_subgraphs
替换 algorithms/tests 中的 assert_almost_equal 和 raises
在使用旧 almost_equal 的测试中设置 places=0
更新 nx.test()
让 pytest 运行 doctests / 而不是 sphinx
恢复 “移除已废弃的 weakly_connected_component_subgraphs”
移除使用已废弃函数引起的警告
移除已废弃的函数和方法。添加到发布说明。
修复 subgraph_view 测试
移除对已废弃 view 的测试并修复已废弃的 G.node 的使用
追踪已废弃函数的使用
修复 add_path/star/cycle 的废弃用法
减少对已废弃函数引起的警告
规避 test_harmonic 中 raises 的问题
通过移除已废弃函数减少警告数量
convert_matrix 演示如何让 doctests 工作的一种方法
从 examples 中移除已废弃的内容
对 convert_matrix 和其他依赖 np.matrix 的更改
清理 doctest 已废弃代码
更多 doctest 更正
修复 examples
从 generators 中移除 nose
从 utils 中移除 nose
从 classes 中移除 nose
用 pytest.raises 替换 nose.assert_raises
用 pytest.raises 上下文管理器替换 nose.raises
用 assert 替换
eq_
,ok_
将 pytest 用于 doctest
在发布说明中突出显示切换到 pytest
移除
from nose.tools import *
移除 nose.tools.SkipTest
最终完成向 pytest 的过渡
合并拉取请求 #3639 来自 stefanv/pytest-port
使用 AppVeyor 测试 Python 3.8
合并拉取请求 #3648 来自 jarrodmillman/windows-py3.8
移除已废弃的 weakly_connected_component_subgraphs
更新发布说明
更新 README
宣布支持 Python 3.8
指定 2.4rc1 发布版本
提升发布版本号
移除剩余的 SkipTests
修复文档说明 (#3644) (#3645)
在 AppVeyor 上测试 Py 3.8.0
加速 AppVeyor
清理 travis 配置
改进 CI 缓存
在 travis 上更新 Py 3.8
合并拉取请求 #3652 来自 jarrodmillman/speedup-appveyor
最终确定发布说明
它包含以下 5 个合并:
修复 betweenness centrality subset 测试中的拼写错误 (#3436)
在 to_numpy_array 中明确说明 i.j 约定 (#3542)
pytest 移植 (#3639)
使用 AppVeyor 测试 Python 3.8 (#3648)
清理并加速 CI (#3652)
贡献者#
Rajendra Adhikari
Antoine Allard
Antoine
Salim BELHADDAD
Luca Baldesi
Tamás Bitai
Tobias Blass
Malayaja Chutani
Peter Cock
Almog Cohen
Diogo Cruz
Martin Darmüntzel
Elan Ernest
Jacob Jona Fahlenkamp
Michael Fedell
Andy Garfield
Ramiro Gómez
Haakon
Alex Henrie
Steffen Hirschmann
Martin James McHugh III
Jacob
Søren Fuglede Jørgensen
Omer Katz
Julien Klaus
Matej Klemen
Nanda H Krishna
Peter C Kroon
Anthony Labarre
Anton Lodder
MCer4294967296
Eric Ma
Fil Menczer
Erwan Le Merrer
Alexander Metz
Jarrod Millman
Subhendu Ranajn Mishra
Jamie Morton
James Myatt
Kevin Newman
Aaron Opfer
Aditya Pal
Pascal-Ortiz
Peter
Jose Pinilla
Alexios Polyzos
Michael Recachinas
Efraim Rodrigues
Adam Rosenthal
Dan Schult
William Schwartz
Weisheng Si
Kanishk Tantia
Ivan Tham
George Valkanas
Stefan van der Walt
Hsi-Hsuan Wu
Haochen Wu
Xiangyu Xu
Jean-Gabriel Young
bkief
daniel-karl
michelb7398
mikedeltalima
nandahkrishna
skhiuk
tbalint