Skip to content
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

highfive sync #883

Merged
merged 1 commit into from
Sep 4, 2024
Merged

highfive sync #883

merged 1 commit into from
Sep 4, 2024

Conversation

PhilipDeegan
Copy link
Member

@PhilipDeegan PhilipDeegan commented Aug 27, 2024

closes #882

Summary by CodeRabbit

  • New Features

    • Improved type safety and clarity for file access modes in the H5Writer and HighFiveFile classes.
    • Simplified file access configuration in the Hi5Diagnostic structure.
  • Bug Fixes

    • Enhanced file handling by explicitly defining access modes, reducing potential errors.
  • Refactor

    • Updated data structures for better performance and maintainability, including the removal of unnecessary aggregation layers.
  • Tests

    • Revised test cases to align with new type definitions for file access modes, improving clarity and safety.

Copy link

coderabbitai bot commented Aug 27, 2024

Warning

Rate limit exceeded

@PhilipDeegan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 55 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between defe065 and 6fb6a68.

Walkthrough

Walkthrough

The changes involve modifications to data structures and types across several files to enhance type safety and clarity. Key alterations include replacing the aggregate_adapter with direct types, transitioning file access modes from unsigned integers to enumerated types, and updating constructors and member variables accordingly. These adjustments streamline the code and improve maintainability.

Changes

Files Change Summary
src/amr/solvers/solver_ppc_model_view.hpp Changed states from std::vector<core::aggregate_adapter<PatchState_t>> to std::vector<PatchState_t>.
src/core/utilities/types.hpp Removed the aggregate_adapter struct template.
src/diagnostic/detail/h5writer.hpp, src/hdf5/detail/h5/h5_file.hpp Updated file access modes in H5Writer and HighFiveFile classes to use enumerated types (HiFile::AccessMode and FileOp), modifying constructors, member variables, and method parameters accordingly.
tests/diagnostic/test_diagnostics.hpp Redefined NEW_HI5_FILE to a single access mode Overwrite, changed Hi5Diagnostic constructor to accept HiFile::AccessMode, and updated member variables to match the new type.

Assessment against linked issues

Objective Addressed Explanation
Possibly redundant helper class since C++20 (#873)
HighFive main branch conflict regarding access modes (#882)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5933e40 and 2328640.

Files selected for processing (5)
  • src/amr/solvers/solver_ppc_model_view.hpp (1 hunks)
  • src/core/utilities/types.hpp (1 hunks)
  • src/diagnostic/detail/h5writer.hpp (5 hunks)
  • src/hdf5/detail/h5/h5_file.hpp (3 hunks)
  • tests/diagnostic/test_diagnostics.hpp (3 hunks)
Files skipped from review due to trivial changes (1)
  • src/core/utilities/types.hpp
Additional context used
Path-based instructions (4)
src/hdf5/detail/h5/h5_file.hpp (1)

Pattern **/*.hpp: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.

src/amr/solvers/solver_ppc_model_view.hpp (1)

Pattern **/*.hpp: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.

tests/diagnostic/test_diagnostics.hpp (1)

Pattern **/*.hpp: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.

src/diagnostic/detail/h5writer.hpp (1)

Pattern **/*.hpp: Review the C++ code, point out issues relative to principles of clean code, expressiveness, and performance.

Additional comments not posted (13)
src/hdf5/detail/h5/h5_file.hpp (3)

16-16: LGTM!

The introduction of the FileOp alias improves code readability and type safety.

The code change is approved.


46-46: LGTM!

The updated function signature enhances type safety by using FileOp instead of unsigned for the flags parameter.

The code change is approved.


64-64: LGTM!

The updated constructor signature maintains consistency with the updated function signature and improves type safety by using FileOp instead of unsigned for the flags parameter.

The code change is approved.

src/amr/solvers/solver_ppc_model_view.hpp (1)

140-140: LGTM!

The update to use std::vector<PatchState_t> instead of std::vector<core::aggregate_adapter<PatchState_t>> simplifies the data structure and enhances performance and clarity.

The code change is approved.

tests/diagnostic/test_diagnostics.hpp (4)

19-19: LGTM!

The redefinition of NEW_HI5_FILE to use HighFive::File::AccessMode::Overwrite simplifies the file access configuration and enhances type safety.

The code change is approved.


50-50: LGTM!

The updated constructor signature enhances type safety and clarity by accepting the flags parameter as a constant of type auto.

The code change is approved.


94-94: LGTM!

The update to make out_ a constant ensures that the output path remains immutable, enhancing code safety and clarity.

The code change is approved.


95-95: LGTM!

The update to make flags_ of type HiFile::AccessMode and constant aligns with the updated constructor signature and enhances type safety.

The code change is approved.

src/diagnostic/detail/h5writer.hpp (5)

53-53: LGTM!

The change to use HiFile::AccessMode::OpenOrCreate improves type safety and clarity.

The code change is approved.


Line range hint 59-63: LGTM!

The constructor modification to accept HiFile::AccessMode instead of unsigned enhances type safety by ensuring only valid access modes can be passed.

The code change is approved.


71-72: LGTM!

The change to use HiFile::AccessMode for the flags variable in the make_unique method aligns with the new constructor signature and improves type safety.

The code change is approved.


97-97: LGTM!

The makeFile method modification to accept HiFile::AccessMode instead of unsigned enhances type safety by ensuring only valid access modes can be passed.

The code change is approved.


171-171: LGTM!

The changes to use HiFile::AccessMode for the flags member variable and the file_flags map improve type safety and consistency across the class.

The code changes are approved.

Also applies to: 181-181

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2328640 and defe065.

Files selected for processing (6)
  • src/amr/solvers/solver_ppc_model_view.hpp (1 hunks)
  • src/core/utilities/types.hpp (1 hunks)
  • src/diagnostic/detail/h5writer.hpp (5 hunks)
  • src/hdf5/detail/h5/h5_file.hpp (3 hunks)
  • tests/diagnostic/test_diagnostics.hpp (3 hunks)
  • tests/simulator/test_diagnostics.py (1 hunks)
Files skipped from review due to trivial changes (2)
  • src/amr/solvers/solver_ppc_model_view.hpp
  • src/core/utilities/types.hpp
Files skipped from review as they are similar to previous changes (3)
  • src/diagnostic/detail/h5writer.hpp
  • src/hdf5/detail/h5/h5_file.hpp
  • tests/diagnostic/test_diagnostics.hpp
Additional comments not posted (1)
tests/simulator/test_diagnostics.py (1)

209-210: LGTM!

The change to accommodate semantic versioning in the assertion logic is appropriate and enhances the robustness of the test.

The code changes are approved.

@PhilipDeegan PhilipDeegan merged commit d49abc6 into PHAREHUB:master Sep 4, 2024
12 checks passed
@PhilipDeegan PhilipDeegan deleted the cleaner branch September 4, 2024 12:31
This was referenced Sep 20, 2024
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.

highfive main branch conflict
2 participants