Skip to content

pgr_degree: Moving to metrics family #2781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

cvvergara
Copy link
Member

@cvvergara cvvergara commented Mar 4, 2025

Fixes #2763 .

Changes proposed in this pull request:

  • Move pgr_degree related files to metric subdirectories
  • Adjust build
  • Fix some documentation typos

@pgRouting/admins

Summary by CodeRabbit

  • Documentation

    • Introduced updated proposed metric documentation describing a function that returns vertex edge counts.
    • Enhanced clarity by reformatting sections and correcting typographical errors.
    • Removed outdated topology sections referencing the proposed metric.
    • Updated references to reflect changes in documentation structure from topology functions to metrics family.
  • Tests

    • Updated test configurations to align with the new metric documentation.
  • Chores

    • Adjusted build and packaging configurations for documentation and SQL modules to maintain consistency.

@cvvergara cvvergara added this to the Release 3.8.0 milestone Mar 4, 2025
Copy link
Contributor

coderabbitai bot commented Mar 4, 2025

Walkthrough

This pull request updates various documentation and SQL configuration files to integrate a new metric function called pgr_degree. The changes add new documentation entries under the metrics module—including a new file, updated section headers, and typographical fixes—while removing references to this metric from the topology module. Adjustments are also made in the docqueries and SQL directories where files related to degree are added under metrics and removed from topology.

Changes

File(s) Change Summary
doc/metrics/CMakeLists.txt, doc/metrics/metrics-family.rst, doc/metrics/pgr_degree.rst Added new documentation for the pgr_degree metric, including a new file entry, a "Proposed" section with function description, and typographical corrections.
doc/topology/CMakeLists.txt, doc/topology/topology-functions.rst Removed pgr_degree entries and documentation references from the topology module.
docqueries/metrics/CMakeLists.txt, docqueries/metrics/test.conf Added new "degree" file entries to the metrics documentation and test configurations.
docqueries/topology/CMakeLists.txt, docqueries/topology/test.conf Removed "degree" file entries from the topology documentation and test configurations.
sql/metrics/CMakeLists.txt, sql/topology/CMakeLists.txt Added degree.sql in the metrics module and removed it from the topology module.

Possibly related PRs

Suggested labels

Documentation, functionality/official

Suggested reviewers

  • robe2
  • iosefa

Poem

In a burrow of code on a spring day bright,
I hopped through changes with delight.
New docs sprouted like carrots in a row,
Typos fixed with a twitch of my nose.
The metrics now shine, all fresh and neat—
A rabbit’s smile in every beat!
🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58a0817 and 1e5b8cf.

📒 Files selected for processing (2)
  • doc/src/proposed.rst (1 hunks)
  • docqueries/metrics/CMakeLists.txt (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: Ubuntu Boost (56)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: Ubuntu clang
  • GitHub Check: Check queries
🔇 Additional comments (2)
doc/src/proposed.rst (1)

59-62: Documentation Reference Updated to Metrics Family

The new block introducing the :doc:metrics-family`` reference and its corresponding include directive for metrics-family.rst is correctly implemented. The inclusion parameters (`:start-after: proposed-start` and `:end-before: proposed-end`) mirror the structure used for the other family blocks, ensuring consistency across the documentation. Please double-check that the referenced file (`metrics-family.rst`) is present and properly maintained in the new metrics subdirectory to align with the overall PR objectives.

docqueries/metrics/CMakeLists.txt (1)

1-13: Overall integration of the new metric entry looks correct.

The inclusion of degree in the LOCAL_FILES list aligns well with the efforts to relocate and integrate the pgr_degree metric. Ensure that corresponding build and documentation changes (in related files) continue to follow the same coding standards.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cvvergara cvvergara requested review from robe2 and iosefa March 4, 2025 21:03
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99ba589 and 58a0817.

📒 Files selected for processing (11)
  • doc/metrics/CMakeLists.txt (1 hunks)
  • doc/metrics/metrics-family.rst (1 hunks)
  • doc/metrics/pgr_degree.rst (2 hunks)
  • doc/topology/CMakeLists.txt (0 hunks)
  • doc/topology/topology-functions.rst (0 hunks)
  • docqueries/metrics/CMakeLists.txt (1 hunks)
  • docqueries/metrics/test.conf (1 hunks)
  • docqueries/topology/CMakeLists.txt (0 hunks)
  • docqueries/topology/test.conf (0 hunks)
  • sql/metrics/CMakeLists.txt (1 hunks)
  • sql/topology/CMakeLists.txt (0 hunks)
💤 Files with no reviewable changes (5)
  • sql/topology/CMakeLists.txt
  • docqueries/topology/test.conf
  • doc/topology/topology-functions.rst
  • doc/topology/CMakeLists.txt
  • docqueries/topology/CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms (16)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Ubuntu clang
  • GitHub Check: macos (macos-latest)
  • GitHub Check: macos (macos-14)
  • GitHub Check: Ubuntu Boost (84)
  • GitHub Check: Ubuntu Boost (80)
  • GitHub Check: Check queries
  • GitHub Check: Ubuntu Boost (86)
  • GitHub Check: Ubuntu Boost (77)
  • GitHub Check: Ubuntu Boost (75)
  • GitHub Check: Ubuntu Boost (78)
  • GitHub Check: Ubuntu Boost (68)
  • GitHub Check: Ubuntu Boost (83)
  • GitHub Check: Ubuntu Boost (79)
  • GitHub Check: Ubuntu Boost (76)
  • GitHub Check: Ubuntu Boost (56)
🔇 Additional comments (10)
sql/metrics/CMakeLists.txt (1)

5-5: File addition appropriately integrated.

The addition of "degree.sql" to the LOCAL_FILES list correctly includes this file in the build process for the metrics module, which aligns with the PR objective of moving pgr_degree from topology to metrics.

docqueries/metrics/test.conf (1)

7-7: Test configuration properly updated.

The addition of "degree.pg" to the test configuration ensures that tests for the pgr_degree functionality will be executed as part of the metrics module testing suite.

doc/metrics/CMakeLists.txt (1)

5-5: Documentation file correctly added.

Adding "pgr_degree.rst" to the LOCAL_FILES list ensures that the documentation for pgr_degree will be properly built and included in the metrics module documentation.

doc/metrics/pgr_degree.rst (2)

11-11: Index Entry Update for Correct Categorization
The index entry has been updated to reference "Metrics Family" rather than "Topology Family," which improves the categorization and clarity of the documentation for the proposed pgr_degree metric.


54-54: Typographical Correction in Return Description
The return type description is now correctly shown as "OR EMPTY SET"—this fixes the previous typographical error ("EMTPY SET") and enhances clarity.

doc/metrics/metrics-family.rst (5)

18-23: New "Proposed" Section Added for Upcoming Metrics
The introduction of a collapsible "Proposed" section clearly segregates experimental or upcoming metrics from stable ones. This organizational improvement enhances readability and helps users locate new functions like pgr_degree more easily.


24-27: Removal of Redundant Inline Description for pgr_degree
The inline description for pgr_degree has been removed from the "Proposed" section, which is appropriate given that its detailed documentation resides in its own file. Consider ensuring that users are guided to the full details elsewhere (e.g., via a cross-reference).


29-34: Formatting of the "Experimental" Section is Clear
The collapsible "Experimental" section is structured well, including the use of the include directive with proper range markers. This format supports readability and consistency with other sections.


35-41: Presentation and Formatting of Experimental Function
The experimental entry for pgr_betweennessCentrality is clear and split appropriately over two lines to enhance readability. The usage of the experimental start/end markers helps delineate content scope.


42-47: Toctree Update for Documentation Integration
The addition of pgr_degree to the toctree along with pgr_betweennessCentrality ensures that the new metric file is included in the documentation build process. This change supports the overall goal of improved project structure.

@cvvergara cvvergara merged commit 9c8acfc into pgRouting:main Mar 6, 2025
26 checks passed
@cvvergara cvvergara deleted the issue-2763-classify-pgr_degree-metric-family branch March 6, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pgr_degree is a graph metric function
2 participants