Skip to content

Conversation

@networmix
Copy link
Owner

@networmix networmix commented Jul 4, 2025

Summary

  • implement NetworkStats workflow step to compute base capacity and degree stats
  • document new workflow step in DSL and API docs
  • update CLI docs with new output key
  • export NetworkStats from workflow package
  • add unit test for new step

Testing

  • make format
  • make check

Copilot AI review requested due to automatic review settings July 4, 2025 21:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new NetworkStats workflow step that computes basic capacity and degree statistics for network links and nodes, along with tests and documentation updates.

  • Implemented and registered the NetworkStats step in the workflow package.
  • Added a unit test to verify link and per-node statistics.
  • Updated DSL, CLI, and API reference docs to include the new step.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ngraph/workflow/network_stats.py Implements the NetworkStats step and registers it.
ngraph/workflow/init.py Exports NetworkStats in the workflow package.
tests/workflow/test_network_stats.py Adds unit test for the new workflow step.
docs/reference/dsl.md Documents NetworkStats in the DSL reference.
docs/reference/cli.md Adds NetworkStats to CLI output documentation.
docs/reference/api.md Includes NetworkStats in the API reference list.
docs/reference/api-full.md Provides full API docs for NetworkStats.
Comments suppressed due to low confidence (2)

tests/workflow/test_network_stats.py:52

  • This test validates link and per-node stats but does not assert on node_capacity and node_degree distributions. Consider adding assertions for those keys to ensure full coverage of the new workflow step.
    assert set(per_node.keys()) == {"A", "B", "C"}

docs/reference/api.md:201

  • The NetworkStats entry appears to be commented out; remove the leading # so it renders properly in the list of available workflow steps.
# - NetworkStats: Computes basic capacity and degree statistics

Comment on lines +31 to +38
link_caps_sorted = sorted(link_caps)
link_stats = {
"values": link_caps_sorted,
"min": min(link_caps_sorted) if link_caps_sorted else 0.0,
"max": max(link_caps_sorted) if link_caps_sorted else 0.0,
"mean": mean(link_caps_sorted) if link_caps_sorted else 0.0,
"median": median(link_caps_sorted) if link_caps_sorted else 0.0,
}
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for building distribution stats is duplicated for links, node capacities, and node degrees. Consider extracting this into a helper function to reduce repetition and improve readability.

Suggested change
link_caps_sorted = sorted(link_caps)
link_stats = {
"values": link_caps_sorted,
"min": min(link_caps_sorted) if link_caps_sorted else 0.0,
"max": max(link_caps_sorted) if link_caps_sorted else 0.0,
"mean": mean(link_caps_sorted) if link_caps_sorted else 0.0,
"median": median(link_caps_sorted) if link_caps_sorted else 0.0,
}
link_stats = self.compute_distribution_stats(link_caps)

Copilot uses AI. Check for mistakes.
@networmix networmix self-assigned this Jul 4, 2025
@networmix networmix added enhancement New feature or request and removed codex labels Jul 4, 2025
cursor[bot]

This comment was marked as outdated.

… of disabled nodes and links in statistics. Update related logic and tests to ensure backward compatibility and correct behavior.
@networmix networmix merged commit fbfac88 into capacity_analysis Jul 5, 2025
7 checks passed
@networmix networmix deleted the implement-base-statistical-network-analysis branch July 5, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants