Skip to content

Commit 4d07baa

Browse files
committed
Revert "move docstrings from ext to main"
This reverts commit be119b7.
1 parent be119b7 commit 4d07baa

File tree

3 files changed

+36
-36
lines changed

3 files changed

+36
-36
lines changed

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ for example in filter(contains(r".jl$"), readdir(example_dir, join=true))
3535
end
3636

3737
mtkext = Base.get_extension(NetworkDynamics, :NetworkDynamicsMTKExt)
38+
dfext = Base.get_extension(NetworkDynamics, :NetworkDynamicsDataFramesExt)
3839
kwargs = (;
3940
root=joinpath(pkgdir(NetworkDynamics), "docs"),
4041
sitename="NetworkDynamics",
41-
modules=[NetworkDynamics, mtkext, NetworkDynamicsInspector],
42+
modules=[NetworkDynamics, mtkext, dfext, NetworkDynamicsInspector],
4243
linkcheck=true, # checks if external links resolve
4344
pagesonly=true,
4445
plugins=[links],

ext/NetworkDynamicsDataFramesExt.jl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ function _df_from_pair(list, pair)
3030
df
3131
end
3232

33+
"""
34+
describe_vertices(nw::Network, extras...; parameters=true, states=true, batch=nothing)
35+
36+
Creates a DataFrame containing information about the vertices in a Network.
37+
38+
# Arguments
39+
- `nw::Network`: The network to describe
40+
- `extras...`: Additional pairs of (key, function) to include as columns,
41+
where the function gets the [`VertexModel`](@ref) as its only parameter
42+
to extract a custom metadata field for example..
43+
- `parameters=true`: Whether to include parameter values
44+
- `states=true`: Whether to include state values
45+
- `batch=nothing`: Optionally filter by specific batches
46+
47+
# Returns
48+
A DataFrame with columns for vertex indices, names, batch numbers, and any parameter/state values.
49+
"""
3350
function NetworkDynamics.describe_vertices(nw::Network, extras...; parameters=true, states=true, batch=nothing)
3451
pairs = enumerate(nw.im.vertexm);
3552
batches = map(idx -> findfirst(batch -> idx batch.indices, nw.vertexbatches), first.(pairs))
@@ -61,6 +78,23 @@ function NetworkDynamics.describe_vertices(nw::Network, extras...; parameters=tr
6178
foldl((a,b) -> DataFrames.leftjoin(a,b; on=:idx), dfs)
6279
end
6380

81+
"""
82+
describe_edges(nw::Network, extras...; parameters=true, states=true, batch=nothing)
83+
84+
Creates a DataFrame containing information about the edges in a Network.
85+
86+
# Arguments
87+
- `nw::Network`: The network to describe
88+
- `extras...`: Additional pairs of (key, function) to include as columns,
89+
where the function gets the [`EdgeModel`](@ref) as its only parameter
90+
to extract a custom metadata field for example..
91+
- `parameters=true`: Whether to include parameter values
92+
- `states=true`: Whether to include state values
93+
- `batch=nothing`: Optionally filter by specific batches
94+
95+
# Returns
96+
A DataFrame with columns for edge indices, source-destination pairs, names, batch numbers, and any parameter/state values.
97+
"""
6498
function NetworkDynamics.describe_edges(nw::Network, extras...; parameters=true, states=true, batch=nothing)
6599
pairs = enumerate(nw.im.edgem);
66100
batches = map(idx -> findfirst(batch -> idx batch.indices, nw.layer.edgebatches), first.(pairs))

src/metadata.jl

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -771,40 +771,5 @@ function _has_changed_hash(aliased_cfs)
771771
end
772772

773773

774-
"""
775-
describe_vertices(nw::Network, extras...; parameters=true, states=true, batch=nothing)
776-
777-
Creates a DataFrame containing information about the vertices in a Network.
778-
779-
# Arguments
780-
- `nw::Network`: The network to describe
781-
- `extras...`: Additional pairs of (key, function) to include as columns,
782-
where the function gets the [`VertexModel`](@ref) as its only parameter
783-
to extract a custom metadata field for example..
784-
- `parameters=true`: Whether to include parameter values
785-
- `states=true`: Whether to include state values
786-
- `batch=nothing`: Optionally filter by specific batches
787-
788-
# Returns
789-
A DataFrame with columns for vertex indices, names, batch numbers, and any parameter/state values.
790-
"""
791774
function describe_vertices end
792-
793-
"""
794-
describe_edges(nw::Network, extras...; parameters=true, states=true, batch=nothing)
795-
796-
Creates a DataFrame containing information about the edges in a Network.
797-
798-
# Arguments
799-
- `nw::Network`: The network to describe
800-
- `extras...`: Additional pairs of (key, function) to include as columns,
801-
where the function gets the [`EdgeModel`](@ref) as its only parameter
802-
to extract a custom metadata field for example..
803-
- `parameters=true`: Whether to include parameter values
804-
- `states=true`: Whether to include state values
805-
- `batch=nothing`: Optionally filter by specific batches
806-
807-
# Returns
808-
A DataFrame with columns for edge indices, source-destination pairs, names, batch numbers, and any parameter/state values.
809-
"""
810775
function describe_edges end

0 commit comments

Comments
 (0)