Skip to content

Network File and Explorer: Load data for edges; show colored and labelled edges#249

Open
janezd wants to merge 15 commits intobiolab:masterfrom
janezd:edge-labels
Open

Network File and Explorer: Load data for edges; show colored and labelled edges#249
janezd wants to merge 15 commits intobiolab:masterfrom
janezd:edge-labels

Conversation

@janezd
Copy link
Contributor

@janezd janezd commented May 22, 2023

Issue

Resolves #247.

Description of changes
  • Add edge annotation to Pajek files. This is a "non-standard" extension to a largely undocumented format.
  • File widget: add input tables for label and edge annotation.
  • File widget: implement construction of networks from table of edges if file is not present.
  • Network explorer: color and label edges.
Includes
  • Code changes
  • Tests
  • Documentation

@janezd janezd force-pushed the edge-labels branch 2 times, most recently from ce1eab1 to 9553296 Compare June 7, 2023 18:31
@janezd janezd changed the title Network File and Explorer: Add labels to edges Network File: More options to add data to vertices and edges Jun 10, 2023
@janezd janezd changed the title Network File: More options to add data to vertices and edges Network File and Explorer: Load data for edges; show colored and labelled edges Jun 10, 2023
@janezd janezd force-pushed the edge-labels branch 2 times, most recently from 773e9a1 to 6e719cb Compare June 11, 2023 08:19
@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2023

Codecov Report

Patch coverage: 92.70% and project coverage change: +4.06 🎉

Comparison is base (3496707) 73.34% compared to head (eb3ad0e) 77.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
+ Coverage   73.34%   77.40%   +4.06%     
==========================================
  Files          21       26       +5     
  Lines        2975     3581     +606     
==========================================
+ Hits         2182     2772     +590     
- Misses        793      809      +16     
Impacted Files Coverage Δ
...gecontrib/network/network/tests/test_embeddings.py 100.00% <ø> (ø)
...rangecontrib/network/network/tests/test_twomode.py 100.00% <ø> (ø)
orangecontrib/network/widgets/graphview.py 66.43% <60.00%> (-0.60%) ⬇️
orangecontrib/network/widgets/OWNxExplorer.py 67.60% <73.33%> (-0.07%) ⬇️
orangecontrib/network/widgets/OWNxFile.py 95.62% <97.57%> (+9.36%) ⬆️
orangecontrib/network/network/base.py 81.08% <100.00%> (ø)
orangecontrib/network/network/compose.py 100.00% <100.00%> (ø)
orangecontrib/network/network/readwrite.py 82.43% <100.00%> (+1.00%) ⬆️
...rangecontrib/network/network/tests/test_compose.py 100.00% <100.00%> (ø)
...ngecontrib/network/network/tests/test_readwrite.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@janezd janezd marked this pull request as ready for review June 11, 2023 15:21
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

This PR expands Orange3-Network’s network IO and visualization capabilities by (1) supporting edge labels in Pajek-like .net files and (2) allowing networks to be constructed/annotated from input node/edge tables, with corresponding UI updates in Network File and Network Explorer.

Changes:

  • Added network.compose utilities and integrated them into OWNxFile to construct/annotate networks from input tables (including edge-table matching).
  • Updated OWNxExplorer + GraphView to support selecting edge label/color/width sources (including “Weights”) and render per-edge colors/widths/labels.
  • Added/updated extensive tests, sample network/data files, and documentation/i18n strings.

Reviewed changes

Copilot reviewed 18 out of 28 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
orangecontrib/network/widgets/tests/test_ownxsinglemode.py Adjust test to avoid mutating shared node table state.
orangecontrib/network/widgets/tests/test_OWNxFile.py Major new test coverage for new OWNxFile behaviors (items/edges inputs, hints, composing, warnings/errors).
orangecontrib/network/widgets/tests/test_OWNxExplorer.py Update tests for new edge-label selection mechanism (“Weights”).
orangecontrib/network/widgets/tests/networks/test-compose.net Adds a test network used by new widget flow tests.
orangecontrib/network/widgets/OWNxFile.py Adds “construct from inputs” mode; edge input; hint-based variable persistence; edge annotation matching; reporting updates.
orangecontrib/network/widgets/OWNxExplorer.py Adds edge label/color/width controls + hint persistence; supplies edge labels/widths/colors to GraphView.
orangecontrib/network/widgets/graphview.py Adds per-edge color support; refactors edge width/label rendering to query widget for labels/widths/colors.
orangecontrib/network/networks/stations.xlsx Adds a bundled dataset (binary).
orangecontrib/network/networks/railway.xlsx Adds a bundled dataset (binary).
orangecontrib/network/networks/railway.net Adds a bundled sample network file.
orangecontrib/network/networks/lastfm.tab Updates bundled tab metadata (class header row).
orangecontrib/network/network/tests/towns.net Adds a test network with edge labels for read/write tests.
orangecontrib/network/network/tests/test-arcslist.net Adds a Pajek arcslist test fixture.
orangecontrib/network/network/tests/test_twomode.py Adds tests for two-mode to single-mode conversion/weighting.
orangecontrib/network/network/tests/test_readwrite.py Switch to importlib.resources for packaged fixtures; adds edge-label read test.
orangecontrib/network/network/tests/test_embeddings.py Adds Node2Vec tests gated on gensim availability.
orangecontrib/network/network/tests/test_compose.py Adds unit tests for new compose utilities (tables → network).
orangecontrib/network/network/tests/init.py Present in PR listing (no functional changes shown).
orangecontrib/network/network/readwrite.py Extends edge parsing to support non-numeric edge labels (returns edge_data alongside weights).
orangecontrib/network/network/compose.py New module: construct networks from node/edge tables; validation helpers and errors.
orangecontrib/network/network/base.py Updates edge-data documentation; adjusts undirected twoway-edge computation behavior.
i18n/si/msgs.jaml Adds new strings for compose + updated widget UI/labels.
doc/widgets/networkfile.md Updates widget docs for new inputs and “construct from tables” workflow.
doc/widgets/networkexplorer.md Updates explorer docs to match new UI layout and edge controls.
doc/widgets/images/Network-File-stamped.png Adds/updates widget screenshot (binary).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] show edge labels

4 participants