Skip to content

Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 250,000+ scientists worldwide. 177 ready-to-use validated skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.

Update version to 2.48.0 in pyproject.toml and uv.lock; enhance NetworkX skill documentation to reflect changes in API and deprecated features for compatibility with NetworkX 3.x.

Timothy Kassisc8c5f9dc5640
diff --git a/pyproject.toml b/pyproject.toml
index cb7c7d72..0ee6953e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "scientific-agent-skills"
-version = "2.47.0"
+version = "2.48.0"
description = "A set of ready to use Agent Skills for research, science, engineering, analysis, finance and writing."
readme = "README.md"
requires-python = ">=3.13"
diff --git a/skills/networkx/SKILL.md b/skills/networkx/SKILL.md
index af6b5eb5..456a5057 100644
--- a/skills/networkx/SKILL.md
+++ b/skills/networkx/SKILL.md
@@ -13,6 +13,8 @@ metadata:
NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs. Use this skill when working with network or graph data structures, including social networks, biological networks, transportation systems, citation networks, knowledge graphs, or any system involving relationships between entities.
+This skill targets NetworkX 3.x (current stable: 3.6, which requires Python >= 3.11). Several pre-3.0 APIs (`nx.info`, `nx.write_gpickle`, `nx.read_shp`) and the 3.4-era `nx.random_tree` no longer exist — current replacements are used throughout this skill.
+
## When to Use This Skill
Invoke this skill when tasks involve:
@@ -131,8 +133,8 @@ G = nx.watts_strogatz_graph(n=100, k=6, p=0.1, seed=42)
# Grid graph
G = nx.grid_2d_graph(m=5, n=7)
-# Random tree
-G = nx.random_tree(n=100, seed=42)
+# Random tree (random_tree was removed in NetworkX 3.4)
+G = nx.random_labeled_tree(100, seed=42)
```
**Reference**: See `references/generators.md` for comprehensive coverage of all graph generators including classic, random, lattice, bipartite, and specialized network models with detailed parameters and use cases.
@@ -155,7 +157,8 @@ nx.write_graphml(G, 'graph.graphml')
G = nx.read_gml('graph.gml')
nx.write_gml(G, 'graph.gml')
-# JSON
+# JSON (node-link format; edge list is stored under the "edges" key
+# since NetworkX 3.6 — older files may use "links", see references/io.md)
data = nx.node_link_data(G)
G = nx.node_link_graph(data)
```
@@ -330,6 +333,7 @@ Most NetworkX tasks follow this pattern:
- Consider loading only necessary subgraphs
- Use efficient file formats (pickle for Python objects, compressed formats)
- Leverage approximate algorithms for very large networks (e.g., `k` parameter in centrality calculations)
+- For heavy workloads, NetworkX 3.x supports drop-in accelerated backends via the `backend=` keyword or `nx.config.backend_priority` — e.g. `nx-cugraph` (GPU), `nx-parallel` (multicore), `graphblas-algorithms` (sparse linear algebra). Install the backend package and pass `backend="cugraph"` (or similar) to supported functions; no algorithm code changes needed.
**Node and Edge Types**:
- Nodes can be any hashable Python object (numbers, strings, tuples, custom objects)
diff --git a/skills/networkx/references/algorithms.md b/skills/networkx/references/algorithms.md
index 9ad94243..d9f1edce 100644
--- a/skills/networkx/references/algorithms.md
+++ b/skills/networkx/references/algorithms.md
@@ -223,8 +223,9 @@ mst = nx.minimum_spanning_tree(G, weight='weight')
# Maximum spanning tree
mst_max = nx.maximum_spanning_tree(G, weight='weight')
-# Enumerate all spanning trees
-all_spanning = nx.all_spanning_trees(G)
+# Iterate over spanning trees in order of increasing total weight
+for tree in nx.SpanningTreeIterator(G):
+ process(tree)
```
### Tree Properties
@@ -277,7 +278,7 @@ is_dag = nx.is_directed_acyclic_graph(G)
# Only for DAGs
try:
topo_order = list(nx.topological_sort(G))
-except nx.NetworkXError:
+except nx.NetworkXUnfeasible:
print("Graph has cycles")
# All topological sorts
@@ -294,11 +295,11 @@ cliques = list(nx.find_cliques(G))
# Maximum clique (NP-complete, approximate)
max_clique = nx.approximation.max_clique(G)
-# Clique number
-clique_number = nx.graph_clique_number(G)
+# Clique number (nx.graph_clique_number was removed in NetworkX 3.0)
+clique_number = max(len(c) for c in nx.find_cliques(G))
-# Number of maximal cliques containing each node
-clique_counts = nx.node_clique_number(G)
+# Size of the largest maximal clique containing each node
+clique_sizes = nx.node_clique_number(G)
```
## Graph Coloring
diff --git a/skills/networkx/references/generators.md b/skills/networkx/references/generators.md
index 0f92b2b4..ca7df974 100644
--- a/skills/networkx/references/generators.md
+++ b/skills/networkx/references/generators.md
@@ -177,8 +177,15 @@ G = nx.hypercube_graph(n=4)
### Random Trees
```python
-# Random tree with n nodes
-G = nx.random_tree(n=100, seed=42)
+# Random labeled tree with n nodes, sampled uniformly over labeled trees
+# (nx.random_tree was removed in NetworkX 3.4)
+G = nx.random_labeled_tree(100, seed=42)
+
+# Sample uniformly over isomorphism classes instead
+G = nx.random_unlabeled_tree(100, seed=42)
+
+# Rooted variants
+G = nx.random_labeled_rooted_tree(100, seed=42)
# Prefix tree (tries)
G = nx.prefix_tree([[0, 1, 2], [0, 1, 3], [0, 4]])
@@ -248,8 +255,8 @@ G = nx.DiGraph([(u, v) for (u, v) in G.edges() if u < v]) # Remove backward edg
### Tournament Graphs
```python
-# Random tournament (complete directed graph)
-G = nx.random_tournament(n=10, seed=42)
+# Random tournament (complete directed graph); lives in the tournament module
+G = nx.tournament.random_tournament(n=10, seed=42)
```
## Duplication-Divergence Models
diff --git a/skills/networkx/references/graph-basics.md b/skills/networkx/references/graph-basics.md
index 05d7de37..27252797 100644
--- a/skills/networkx/references/graph-basics.md
+++ b/skills/networkx/references/graph-basics.md
@@ -245,7 +245,8 @@ G_directed = G.to_directed()
### Basic Information
```python
-print(nx.info(G)) # Summary of graph structure
+print(G) # Summary string, e.g. "Graph with 5 nodes and 4 edges"
+ # (nx.info was removed in NetworkX 3.0)
# Density (ratio of actual edges to possible edges)
nx.density(G)
diff --git a/skills/networkx/references/io.md b/skills/networkx/references/io.md
index b12aee62..9a5099d5 100644
--- a/skills/networkx/references/io.md
+++ b/skills/networkx/references/io.md
@@ -105,11 +105,8 @@ nx.write_pajek(G, 'graph.net')
### LEDA Format
```python
-# Read LEDA format
+# Read LEDA format (read-only; NetworkX has no LEDA writer)
G = nx.read_leda('graph.leda')
-
-# Write LEDA format
-nx.write_leda(G, 'graph.leda')
```
## Working with Pandas
@@ -214,6 +211,12 @@ with open('graph.json', 'w') as f:
with open('graph.json', 'r') as f:
data = json.load(f)
G = nx.node_link_graph(data)
+
+# Since NetworkX 3.6 the edge list is stored under the "edges" key.
+# Older files (and some d3.js examples) use "links" — pass edges="links"
+# to read or write that layout:
+G = nx.node_link_graph(data, edges="links")
+data = nx.node_link_data(G, edges="links")
```
### Adjacency Data Format
@@ -255,12 +258,10 @@ with open('graph.pkl', 'wb') as f:
# Read pickle
with open('graph.pkl', 'rb') as f:
G = pickle.load(f)
-
-# NetworkX convenience functions
-nx.write_gpickle(G, 'graph.gpickle')
-G = nx.read_gpickle('graph.gpickle')
```
+Note: `nx.write_gpickle` / `nx.read_gpickle` were removed in NetworkX 3.0 — use the standard `pickle` module as shown above. Only unpickle files from trusted sources; pickle can execute arbitrary code on load.
+
## CSV Files
### Custom CSV Reading
@@ -295,6 +296,15 @@ df = pd.read_sql_query("SELECT source, target, weight FROM edges", conn)
G = nx.from_pandas_edgelist(df, 'source', 'target', edge_attr='weight')
conn.close()
+# When filtering on user-supplied values, always use parameterized queries —
+# never interpolate user input into the SQL string:
+conn = sqlite3.connect('network.db')
+df = pd.read_sql_query(
+ "SELECT source, target, weight FROM edges WHERE weight > ?",
+ conn, params=(min_weight,)
+)
+conn.close()
+
# Write to SQL database
df = nx.to_pandas_edgelist(G)
conn = sqlite3.connect('network.db')
@@ -348,14 +358,19 @@ A = nx.to_scipy_sparse_array(G)
mmwrite('graph.mtx', A)
```
-### Shapefile (for Geographic Networks)
+### Geographic Networks (Shapefiles, GeoDataFrames)
+`nx.read_shp` / `nx.write_shp` were removed in NetworkX 3.0. Use GeoPandas with momepy (or osmnx for street networks) instead:
```python
-# Requires pyshp library
-# Read geographic network from shapefile
-G = nx.read_shp('roads.shp')
+# uv pip install geopandas momepy
+import geopandas as gpd
+import momepy
+
+# Read line geometries from a shapefile and convert to a graph
+gdf = gpd.read_file('roads.shp')
+G = momepy.gdf_to_nx(gdf, approach='primal')
-# Write to shapefile
-nx.write_shp(G, 'network')
+# Convert back to GeoDataFrames
+nodes_gdf, edges_gdf = momepy.nx_to_gdf(G)
```
## Format Selection Guidelines
@@ -399,8 +414,9 @@ with gzip.open('graph.adjlist.gz', 'wt') as f:
with gzip.open('graph.adjlist.gz', 'rt') as f:
G = nx.read_adjlist(f)
-# Use binary formats (faster)
-nx.write_gpickle(G, 'graph.gpickle') # Faster than text formats
+# Use binary formats (faster than text formats)
+with open('graph.pkl', 'wb') as f:
+ pickle.dump(G, f)
# Use sparse matrices for adjacency
A = nx.to_scipy_sparse_array(G, format='csr') # Memory efficient
diff --git a/skills/networkx/references/visualization.md b/skills/networkx/references/visualization.md
index caf9b7a3..2f3f7592 100644
--- a/skills/networkx/references/visualization.md
+++ b/skills/networkx/references/visualization.md
@@ -18,6 +18,8 @@ plt.savefig('graph.png', dpi=300, bbox_inches='tight')
plt.close()
```
+NetworkX 3.5 added `nx.display(G)`, a newer declarative drawing API that reads visualization attributes (color, size, position) stored directly on nodes and edges. `nx.draw` and the `draw_networkx_*` functions below remain fully supported.
+
### Drawing with Labels
```python
# Draw with node labels
diff --git a/uv.lock b/uv.lock
index 9fc3bf6c..1a5710e2 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1680,7 +1680,7 @@ wheels = [
[[package]]
name = "scientific-agent-skills"
-version = "2.47.0"
+version = "2.48.0"
source = { virtual = "." }
dependencies = [
{ name = "cisco-ai-skill-scanner" },