Skip to content

pybind visbility werrors#1054

Merged
PhilipDeegan merged 1 commit intoPHAREHUB:masterfrom
PhilipDeegan:pybinding
Jul 22, 2025
Merged

pybind visbility werrors#1054
PhilipDeegan merged 1 commit intoPHAREHUB:masterfrom
PhilipDeegan:pybinding

Conversation

@PhilipDeegan
Copy link
Member

@PhilipDeegan PhilipDeegan commented Jul 15, 2025

Seeing a werror with a newer compiler for not respecting the visibility settings of pybind classes

@coderabbitai
Copy link

coderabbitai bot commented Jul 15, 2025

📝 Walkthrough

Walkthrough

Visibility attributes were added to several class and struct declarations to restrict symbol export in shared libraries, using __attribute__((visibility("hidden"))). Minor header include reordering and removals were performed. A small type qualification adjustment was made in a pointer declaration, and minor formatting changes were applied to function arguments.

Changes

File(s) Change Summary
src/python3/data_wrangler.hpp Added hidden visibility attribute to DataWrangler class; adjusted pointer type qualification in a method.
src/python3/particles.hpp Reordered and removed some header includes; no logic or functional changes.
src/python3/patch_data.hpp Added hidden visibility attribute to PatchData struct; reordered and removed some includes.
src/python3/patch_level.hpp Added hidden visibility attribute to PatchLevel class; minor formatting change in function call.
src/python3/pybind_def.hpp Added hidden visibility attribute to PyArrayWrapper class template.

Sequence Diagram(s)

No sequence diagram generated as the changes are limited to symbol visibility, type qualification, and include reordering without control flow or feature modifications.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

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.

Copy link

@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: 0

🧹 Nitpick comments (1)
src/python3/particles.hpp (1)

9-11: Consider conventional include ordering.

The standard library includes (<tuple>, <cassert>, <cstddef>) are now placed after the project-specific pybind_def.hpp include. Conventional C++ practice typically places standard library headers first, followed by third-party headers, then project-specific headers.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 956a1ec and e684889.

📒 Files selected for processing (5)
  • src/python3/data_wrangler.hpp (2 hunks)
  • src/python3/particles.hpp (1 hunks)
  • src/python3/patch_data.hpp (1 hunks)
  • src/python3/patch_level.hpp (2 hunks)
  • src/python3/pybind_def.hpp (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.hpp

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧠 Learnings (2)
📓 Common learnings
Learnt from: PhilipDeegan
PR: PHAREHUB/PHARE#784
File: tests/simulator/test_restarts.py:333-339
Timestamp: 2024-07-26T22:04:34.160Z
Learning: PhilipDeegan has indicated a preference for minimal and efficient code, even after making changes to get a function working. There may be opportunities to remove or optimize parts of the code such as sleep/wait/advances.
Learnt from: PhilipDeegan
PR: PHAREHUB/PHARE#784
File: tests/simulator/test_restarts.py:333-339
Timestamp: 2024-10-09T08:32:15.667Z
Learning: PhilipDeegan has indicated a preference for minimal and efficient code, even after making changes to get a function working. There may be opportunities to remove or optimize parts of the code such as sleep/wait/advances.
Learnt from: PhilipDeegan
PR: PHAREHUB/PHARE#888
File: src/hdf5/detail/h5/h5_file.hpp:78-79
Timestamp: 2024-09-05T17:02:58.784Z
Learning: Avoid commenting on draft PRs for the user PhilipDeegan.
Learnt from: PhilipDeegan
PR: PHAREHUB/PHARE#888
File: src/hdf5/detail/h5/h5_file.hpp:78-79
Timestamp: 2024-10-09T08:32:15.667Z
Learning: Avoid commenting on draft PRs for the user PhilipDeegan.
Learnt from: PhilipDeegan
PR: PHAREHUB/PHARE#888
File: pyphare/pyphare/pharesee/hierarchy/hierarchy_utils.py:566-568
Timestamp: 2024-09-09T13:57:02.285Z
Learning: Avoid commenting on draft PRs for PhilipDeegan unless explicitly requested.
src/python3/patch_data.hpp (1)
Learnt from: PhilipDeegan
PR: PHAREHUB/PHARE#910
File: pyphare/pyphare/pharesee/hierarchy/hierarchy_utils.py:7-7
Timestamp: 2024-10-18T13:23:32.074Z
Learning: In the `pyphare.pharesee.hierarchy` module, importing `PatchHierarchy` and `format_timestamp` from `hierarchy.py` into `hierarchy_utils.py` is acceptable as long as `hierarchy.py` does not import `hierarchy_utils.py`, thereby avoiding a cyclic import.
🔇 Additional comments (7)
src/python3/patch_data.hpp (2)

4-5: Good header organization.

Moving pybind_def.hpp to the top aligns well with its usage in the visibility-controlled struct below.


14-14: Excellent symbol visibility control.

The hidden visibility attribute correctly restricts symbol exports for the PatchData struct, which is appropriate for internal Python binding infrastructure.

src/python3/data_wrangler.hpp (2)

61-61: Correct symbol visibility control.

The hidden visibility attribute properly restricts symbol exports for the DataWrangler class, which is appropriate for internal Python binding infrastructure.


91-91: Improved const qualifier placement.

The const qualifier placement in PatchData<std::vector<double>, dimension> const* is more consistent with modern C++ style than the previous const PatchData<...>* form, while maintaining identical semantics.

src/python3/pybind_def.hpp (1)

39-39: Proper symbol visibility control.

The hidden visibility attribute correctly restricts symbol exports for the PyArrayWrapper class template, which is appropriate for internal Python binding infrastructure.

src/python3/patch_level.hpp (2)

15-15: Correct symbol visibility control.

The hidden visibility attribute properly restricts symbol exports for the PatchLevel class template, which is appropriate for internal Python binding infrastructure.


62-63: Clean formatting improvement.

The function call formatting enhances readability by properly aligning the arguments across lines.

@PhilipDeegan PhilipDeegan merged commit d31c724 into PHAREHUB:master Jul 22, 2025
13 checks passed
@PhilipDeegan PhilipDeegan deleted the pybinding branch July 22, 2025 13:18
UCaromel pushed a commit to UCaromel/PHARE that referenced this pull request Aug 1, 2025
PhilipDeegan added a commit to PhilipDeegan/PHARE that referenced this pull request Aug 7, 2025
PhilipDeegan added a commit to PhilipDeegan/PHARE that referenced this pull request Oct 8, 2025
UCaromel pushed a commit to UCaromel/PHARE that referenced this pull request Oct 14, 2025
UCaromel pushed a commit to UCaromel/PHARE that referenced this pull request Feb 6, 2026
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.

2 participants