Conversation
Major changes: 1. Removed dependency on HALP. As a consequence, added self.edge_mapping and self.node_set_to_hyperedge to map arcs to ids. Node profiles are now mapped to self.node_profiles (node: tid: NProfile) and stars to self.stars (node: edge id set) 2. self.time_to_edge. Mapped tid: edge : event. Handling this mapping is the most expensive thing. Removing it gives a considerable boost in performance when creating large hypergraphs. Requires changing stream_interactions (the only function that really used it). 3. Stream_interactions. Can no longer simply iterate over time_to_edge. Now: If hedge_removal is False, it yields temporally ordered hyperedges (one iteration for each non-contiguous appearance). If hedge_removal is True, it instead (i) yields the first snapshot, (ii) for each subsequent instant, yields the additions checking that they are not present at the previous instant, then yields the removals checking that they are not present at the next instant. 4. Added a warning: hedge removal not implemented 5. add_nodes. Faster because it does not do time checks. Overwrites if the node already exists. (When working on it, therefore, add arcs first, then node attributes) 6. various bug fixes, incl. neighbors counting
… update related tests
- Created subdirectories: unit/, paths/, measures/, utils/, generators/, io/, viz/, integration/, fixtures/ - Added conftest.py with shared fixtures (rng, ash_factory, small_hg, matplotlib_agg) - Created fixtures/sample_hypergraphs.py with reusable test hypergraph factories - Moved all existing tests to appropriate subdirectories - Added 38 new tests: * measures/test_segregation.py: 16 tests for RWHS measures * integration/test_backends.py: 15 tests for Dense/Interval backend parity * integration/test_workflows.py: 7 end-to-end workflow tests - Fixed integration test API signatures - Copied hif_data to io/ subdirectory for I/O tests - All 189 tests passing (161 original + 28 new without duplicates) - Maintained 95% code coverage
- Implements multi-ego network extraction for temporal hypergraphs - Three extraction variants: standard, fractured (alpha), core (beta) - Three similarity measures: Jaccard, minimum overlapping, delta - Supports single snapshot and time window queries (start/end) - 28 comprehensive tests (all passing) - API consistent with ASH.star() and temporal conventions
- Convert docstrings from NumPy to Sphinx style (:param:, :return:) - Add docs/reference/multiego.rst with autosummary - Include multiego in docs/reference/reference.rst - All 28 tests passing - Consistent with ASH documentation standards
- Add conftest.py with shared fixtures - Create fixtures/sample_hypergraphs.py for reusable test data - Organize tests in subdirectories: integration/, measures/, viz/ - Add comprehensive integration tests (backends, workflows) - Add visualization tests (static and temporal) - Improve test isolation and maintainability - All 228 tests passing
- Update temporal parameters (start/end) to use Optional[int] for PEP 484 compliance - Add Optional to typing imports in s_centralities.py, projections.py, matrices.py - Fix s_eigenvector_centrality: add missing weight parameter - Fix s_load_centrality: correct docstring parameters - Improves IDE support, type checking, and code clarity - No behavioral changes, type system only - Affected: 15 functions across 3 modules - All tests pass (test_centralities.py, test_utils.py)
- Changed documentation theme from sphinx_rtd_theme to Furo for better logo visibility - Furo provides modern design with dark sidebar that makes the orange logo stand out - Fixed logo configuration to prevent duplication - Moved logo to _static directory for proper Furo integration - Reorganized reference.rst: moved multiego from Measures to its own MultiEgo section
- Add ash_model.viz.static: functions for static hypergraph visualization - plot_s_degrees: visualize s-degree distribution - plot_hyperedge_size_distribution: hyperedge size distribution - plot_degree_distribution: node degree distribution (log-log) - plot_s_ranks: s-rank distribution - Add ash_model.viz.temporal: functions for temporal hypergraph visualization - plot_hyperedge_activity_series: activity over time for hyperedges - plot_node_activity_series: activity over time for nodes - plot_node_presence_timeline: presence intervals for nodes - plot_hyperedge_presence_timeline: presence intervals for hyperedges - plot_interevent_time_distribution: time between consecutive events - plot_lifespan_distribution: lifespan distribution for nodes/hyperedges - Add docs/reference/viz.rst: comprehensive documentation with separate sections for static and temporal plots - Fixed docstring formatting issues to eliminate Sphinx warnings - Standardized parameter naming: 'normalize' (American English) across all functions
- Add generated autosummary documentation for multiego functions - Includes docs for delta_similarity, jaccard_similarity, minimum_overlap - Includes docs for get_core_multiego, get_multiego, get_fractures
- Remove same-timestamp edges: DAG now only creates edges from timestamp t to t' where t' > t - Each step in a time-respecting walk must happen at a strictly later timestamp - Optimize walk validation from O(n²) to O(n) by tracking prev_edge directly - Update temporal_s_dag to build only forward-in-time connections - Fix ping-pong detection to avoid redundant seq.index() calls Tests updated: - test_time_respecting_walks.py: All 5 tests passing with correct expectations - test_randwalks.py: Updated hypergraphs to use multi-timestamp scenarios - test_time_respecting_randwalks.py: Updated validation for strictly increasing timestamps Time-respecting walk constraints now correctly enforced: ✓ Each edge happens at a specific time t ✓ Can only move along edges that exist at that time ✓ Every next step must happen later in time (no backtracking, no same-time transitions)
Major improvements to time-respecting walks and random walks: **Time-Respecting Random Walks:** - Removed terminate_at_sink parameter (redundant with corrected logic) - Walks always terminate at temporal sinks (nodes with no forward neighbors) - Simplified API: walks stop automatically when no forward transitions exist - Updated docstring to reflect corrected behavior **Test Suite Enhancements:** - Added comprehensive test coverage for complex temporal networks - New test_complex_temporal_network: 11 hyperedges, 12 timestamps, 8 nodes - New test_larger_network_* tests: 15 hyperedges, 10 timestamps, 8 nodes - Tests verify walks spanning >2 timestamps with temporal diversity - Updated test expectations to match corrected time-respecting semantics **Test Improvements:** - test_time_respecting_walks.py: Added test_complex_temporal_network - test_time_respecting_randwalks.py: Added 3 comprehensive tests: * test_larger_network_node_walks (50 walks, length 8) * test_larger_network_edge_walks_long_paths (walks up to 10 steps) * test_larger_network_temporal_span_coverage (diversity metrics) - test_randwalks.py: Removed terminate_at_sink parameter usage **Coverage Statistics:** - Max timestamps tested: 12 (previously 5) - Max hyperedges tested: 15 (previously 5) - Max nodes tested: 8 (previously 4) - Temporal span: 6-10 timestamps (previously ~4) - All 38 tests in paths module passing
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive documentation, tutorials, tests, and utility functions to the ASH (Attributed Stream Hypergraph) library. The changes include:
- New Jupyter notebook tutorials covering generators, walks, and attribute analysis
- Complete Sphinx documentation setup with API reference pages
- Visualization modules for static and temporal hypergraph properties
- Utility functions for matrices, projections, NetworkX conversions, and profile aggregation
- Extensive test coverage for all new functionality
- Updated package configuration (setup.py, environment.yml)
Reviewed Changes
Copilot reviewed 186 out of 199 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tutorial/*.ipynb | Tutorial notebooks demonstrating generators, walks, and attribute analysis features |
| docs/* | Sphinx documentation structure including API reference, installation guide, and tutorial integration |
| ash_model/viz/* | Visualization functions for static and temporal hypergraph properties |
| ash_model/utils/* | Utility modules for matrices, projections, NetworkX conversions, and profile operations |
| ash_model/test/* | Comprehensive test suites for utils, viz, paths, and core classes |
| setup.py | Updated package name to ash_model and version to 1.0.0 |
| environment.yml | Updated dependencies including numpy version constraint and csrgraph |
Comments suppressed due to low confidence (3)
tutorial/01-attribute_analysis.ipynb:1
- Corrected spelling of 'Imternally' to 'Internally'.
{
tutorial/02-walks.ipynb:1
- Corrected spelling of 'subsquent' to 'subsequent'.
{
docs/reference/utils.rst:1
- Corrected 'SpSpecify' to 'Specify'.
Utils
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - python>=3.9 | ||
| - halp | ||
| - numpy | ||
| - numpy<2.0 |
There was a problem hiding this comment.
[nitpick] The numpy version constraint <2.0 may be too restrictive. Consider using >=1.20,<3.0 to allow numpy 2.x while maintaining compatibility, unless there's a specific incompatibility with numpy 2.x.
| - numpy<2.0 | |
| - numpy>=1.20,<3.0 |
|
@copilot revise conflicts and accept changes from the features branch |
|
@andreafailla I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you. |
No description provided.