PHARE icon indicating copy to clipboard operation
PHARE copied to clipboard

can set a patchData w. an all_primal centering

Open rochSmets opened this issue 1 year ago • 3 comments

This is just the beginning of the work... I will continue once we will be agree with the way to do it. My notebook to test it is here : https://github.com/rochSmets/farJunk/blob/main/nb/ohm.ipynb

Summary by CodeRabbit

  • New Features

    • Introduced advanced mathematical operations for vector and scalar fields, including dot product, cross product, square root, gradient, and modulus calculations.
    • Added new methods and functions for handling hierarchical data structures, including renaming, arithmetic operations, and domain slicing.
  • Enhancements

    • Updated PatchHierarchy class with new methods for mapping quantities to spatial directions and retrieving patch data names.
    • Improved field computation methods to handle additional parameters and new arithmetic operations.

rochSmets avatar Jan 14 '24 18:01 rochSmets

[!WARNING]

.coderabbit.yaml is using a deprecated configuration schema

The configuration schema (version 1) is deprecated and will be removed soon. Please migrate to the latest schema version.

New configuration YAML
early_access: false
enable_free_tier: true
language: en
tone_instructions: ''
knowledge_base:
  learnings:
    scope: auto
  issues:
    scope: auto
  jira:
    project_keys: []
  linear:
    team_keys: []
chat:
  auto_reply: true
reviews:
  profile: chill
  request_changes_workflow: false
  high_level_summary: true
  high_level_summary_placeholder: '@coderabbitai summary'
  poem: false
  review_status: true
  collapse_walkthrough: true
  path_filters: []
  path_instructions:
    - path: '**.hpp'
      instructions: >-
        Review the C++ code, point out issues relative to principles of clean
        code, expressiveness, and performance.
  tools:
    shellcheck:
      enabled: true
    ruff:
      enabled: true
    markdownlint:
      enabled: true
    github-checks:
      enabled: true
      timeout_ms: 90000
    languagetool:
      enabled: true
      disabled_rules:
        - EN_UNPAIRED_BRACKETS
        - EN_UNPAIRED_QUOTES
      disabled_categories:
        - TYPOS
        - TYPOGRAPHY
        - CASING
      enabled_only: false
      level: default
    biome:
      enabled: true
    hadolint:
      enabled: true
    swiftlint:
      enabled: true
    phpstan:
      enabled: true
      level: '1'
    golangci-lint:
      enabled: true
  auto_review:
    enabled: true
    auto_incremental_review: true
    ignore_title_keywords:
      - WIP
    labels: []
    drafts: true
    base_branches:
      - master
  auto_title_placeholder: '@coderabbitai title'

Configuration instructions
  • 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
Walkthrough

Walkthrough

The recent updates introduce a comprehensive set of mathematical and field operations across hierarchical data structures in the pyphare library. These enhancements include new functions for computing dot products, cross products, gradients, and more for vector and scalar fields. Additionally, various classes and methods have been updated to support these operations, handle different field centerings, and manage patch data more effectively.

Changes

File Path Change Summary
pyphare/core/operators.py Introduced functions for computing dot products, cross products, square roots, gradients, and modulus of fields in a hierarchy.
pyphare/pharesee/hierarchy.py Added flat_name method, updated global_min and global_max methods, introduced ScalarField and VectorField classes with arithmetic operations.
pyphare/pharesee/run.py Added imports and functions for domain slicing and field computations. Modified existing functions to handle new parameters and logic for all-primal data.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant PatchHierarchy
    participant ScalarField
    participant VectorField
    participant Operators

    User->>PatchHierarchy: Initialize hierarchy
    PatchHierarchy-->>User: Return hierarchy instance

    User->>ScalarField: Perform arithmetic operation
    ScalarField-->>User: Return result

    User->>VectorField: Perform arithmetic operation
    VectorField-->>User: Return result

    User->>Operators: Compute dot product
    Operators-->>User: Return dot product

    User->>Operators: Compute cross product
    Operators-->>User: Return cross product

    User->>Operators: Compute gradient
    Operators-->>User: Return gradient

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.

CodeRabbit Configration 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.

coderabbitai[bot] avatar Jan 14 '24 18:01 coderabbitai[bot]

I still have 2 commits to keep memory of what I did if it happens I need to restore anything. But if this is fine for you, I will squash in a single commit

rochSmets avatar Mar 06 '24 17:03 rochSmets

I still have 2 commits to keep memory of what I did if it happens I need to restore anything. But if this is fine for you, I will squash in a single commit

it can all be squashed on merge so you don't need to bother

PhilipDeegan avatar Mar 06 '24 17:03 PhilipDeegan

Closing because is in #859

nicolasaunai avatar Jul 15 '24 08:07 nicolasaunai