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

fix functional tests #867

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Conversation

nicolasaunai
Copy link
Member

@nicolasaunai nicolasaunai commented Jul 30, 2024

Summary by CodeRabbit

  • Bug Fixes

    • Updated variable keys for accessing magnetic field data across multiple functions to ensure consistency and accuracy in data retrieval.
    • Adjusted logic in visualization functions to reflect changes in data structure, improving output accuracy.
  • Chores

    • Modified import paths for functions to align with the new module organization, enhancing maintainability.
    • Simplified file path handling in data retrieval methods for improved efficiency.
    • Added new functionality in test files to accommodate HDF5 time group keys, enhancing diagnostic capabilities.

Copy link

coderabbitai bot commented Jul 30, 2024

Walkthrough

Walkthrough

The recent updates focus on refining how magnetic field data is accessed and structured within the codebase. Key identifiers for magnetic field components have transitioned from "B*" to "x", "y", and "z", reflecting a reorganization that simplifies the data model. Additionally, import paths have been streamlined to improve module clarity. While core functionalities remain intact, these changes aim to enhance consistency and efficiency in data handling across simulations.

Changes

Files Change Summary
tests/functional/alfven_wave/..., Updated data access in phase_speed and main() functions; introduced merged=True in GetB method for improved magnetic field access.
tests/functional/conservation/..., Changed import path and revamped mag_energy function; simplified magnetic energy calculations using the dot function.
tests/functional/ionIonBeam/..., Modified import path; updated keys from "By", "Bz" to "y", "z" in relevant functions.
tests/functional/shock/..., Updated dictionary access in main() function, changing keys from "By" to "y" for plotting variables.
pyphare/pyphare/pharesee/run/..., Adjusted GetB, GetE, and GetJ methods to modify all_primal based on the merged flag; simplified file path handling in GetDl.
tests/simulator/test_diagnostic_timestamps.py Updated import to include h5_time_grp_key, enhancing test functionality related to HDF5 time groups.

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

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

Outside diff range, codebase verification and nitpick comments (1)
tests/functional/shock/shock.py (1)

144-144: The key "y" in the dictionary "B" appears to be incorrect.

The search results show consistent usage of the key "By" across the codebase, but no instances of "B['y']". Please verify and correct the key to ensure consistency.

  • File: tests/functional/shock/shock.py
  • Lines: 144
Analysis chain

Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'B["y"]'

Length of output: 63


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type py -A 5 $'B["y"]'

Length of output: 77977

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a233cc7 and ba2575a.

Files selected for processing (6)
  • tests/functional/alfven_wave/alfven_wave1d.py (2 hunks)
  • tests/functional/conservation/conserv.py (2 hunks)
  • tests/functional/ionIonBeam/ion_ion_beam1d.py (2 hunks)
  • tests/functional/shock/shock.py (2 hunks)
  • tests/functional/tdtagged/td1dtagged.py (1 hunks)
  • tests/simulator/test_initialization.py (1 hunks)
Additional comments not posted (18)
tests/functional/shock/shock.py (3)

176-176: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Verification successful

The new key "y" in the dictionary is used consistently and correctly in the codebase.

  • tests/functional/shock/shock.py: Multiple instances of B["y"] found.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'B["y"]'

Length of output: 63


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg -A 5 'B\["y"\]'

Length of output: 1021


175-175: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Verification successful

Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.


The key "y" is used consistently in the dictionary.

The key "y" is correctly and consistently used in the tests/functional/shock/shock.py file.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'B["y"]'

Length of output: 63


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg 'B\["y"\]' --glob '*.py' -A 5

Length of output: 1035


143-143: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Verification successful

The key "y" is used correctly and consistently in the codebase.

  • tests/functional/shock/shock.py: Multiple instances confirm the correct usage of the key "y".
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'B["y"]'

Length of output: 63


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg -A 5 'B\["y"\]' --glob '*.py'

Length of output: 1035

tests/functional/alfven_wave/alfven_wave1d.py (2)

165-165: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Verification successful

Re-verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.


Re-verify the usage of dictionary keys in patch_datas.

Ensure that the key "y" is correct and consistent with the rest of the codebase by reviewing all occurrences of patch_datas.


The new key "y" in the dictionary is correct and consistent.

The key "y" is used consistently within the codebase, confirming that the change is aligned with the existing code structure.

  • tests/functional/alfven_wave/alfven_wave1d.py
  • tests/functional/conservation/conserv.py
  • tests/simulator/test_initialization.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'patch_datas["y"]'

Length of output: 73


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type py -A 5 $'patch_datas["y"]'

Length of output: 38


Script:

#!/bin/bash
# Description: Verify the usage of dictionary keys in `patch_datas` in the codebase.

# Test: Search for all occurrences of `patch_datas` and review the context.
rg --type py -A 5 'patch_datas'

Length of output: 80363


166-166: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Verification successful

The new key "y" in the dictionary is consistent and correct.

The key "y" is used consistently across the codebase, indicating that the change is appropriate and aligns with the existing data structure or naming conventions.

  • Verified instances in tests/simulator/test_initialization.py
  • Verified instances in tests/functional/conservation/conserv.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'patch_datas["y"]'

Length of output: 73


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type py -A 5 $'patch_datas["y"]'

Length of output: 38


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary keys in `patch_datas` in the codebase.

# Test: Search for any usage of `patch_datas` and inspect the keys being accessed.
rg --type py -A 5 'patch_datas\["' 

Length of output: 21941

tests/functional/tdtagged/td1dtagged.py (8)

167-167: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.


172-172: Verify the new key "z" in the dictionary.

Ensure that the key "z" is correct and consistent with the rest of the codebase.

Verification successful

The key "z" is consistent in the codebase.

The key "z" is used consistently within the JNoRef dictionary in the file tests/functional/tdtagged/td1dtagged.py.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "z" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "z".
rg --type python -A 5 $'JNoRef["z"]'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "z" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "z".
rg --type py -A 5 $'JNoRef["z"]'

Length of output: 33


Script:

#!/bin/bash
# Description: Verify the keys used in the JNoRef dictionary in the codebase.

# Test: Search for all keys used in the JNoRef dictionary.
rg --type py -o 'JNoRef\["[^"]+"\]'

Length of output: 141


170-170: Verify the new key "z" in the dictionary.

Ensure that the key "z" is correct and consistent with the rest of the codebase.

Verification successful

The key "z" is used consistently in the dictionary JwT within the file tests/functional/tdtagged/td1dtagged.py.

  • tests/functional/tdtagged/td1dtagged.py:170
  • tests/functional/tdtagged/td1dtagged.py:171
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "z" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "z".
rg --type python -A 5 $'JwT["z"]'

Length of output: 65


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "z" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "z".
rg --type py -A 5 $'JwT["z"]'

Length of output: 30


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary JwT and its keys in the codebase.

# Test: Search for all instances of the dictionary JwT. Expect: Consistent usage of keys.
rg --type py -A 5 $'JwT'

Length of output: 949


166-166: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Verification successful

The new key "y" is correctly used and consistent within the codebase.

  • The key "y" is found in multiple places within the tests/functional/tdtagged/td1dtagged.py file.
  • There are no occurrences of the previous key "By" in the search results.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'BwT["y"]'

Length of output: 65


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type py -A 5 $'BwT["y"]'

Length of output: 30


Script:

#!/bin/bash
# Description: Search for any occurrences of `BwT` in the codebase to verify its structure and keys.

# Test: Search for the dictionary `BwT`. Expect: Find its definition and usage.
rg --type py -A 5 'BwT'

Length of output: 975


169-169: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Verification successful

The key "y" in the dictionary BNoRef is consistent with the rest of the codebase.

  • The key "y" is the only one used in the BNoRef dictionary across the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'BNoRef["y"]'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg -t py -A 5 $'BNoRef["y"]'

Length of output: 29


Script:

#!/bin/bash
# Description: Search for all keys used in the BNoRef dictionary in the codebase.

# Test: List all keys used in the BNoRef dictionary.
rg -t py -o 'BNoRef\["[^"]+"\]' | sort | uniq

Length of output: 99


171-171: Verify the new key "z" in the dictionary.

Ensure that the key "z" is correct and consistent with the rest of the codebase.

Verification successful

Verified the new key "z" in the dictionary.

The key "z" is used correctly and consistently within the tests/functional/tdtagged/td1dtagged.py file.

  • tests/functional/tdtagged/td1dtagged.py: Multiple instances of JwT["z"] and JNoRef["z"] confirm consistent usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "z" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "z".
rg --type python -A 5 $'JwT["z"]'

Length of output: 65


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "z" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "z".
rg --type py -A 5 $'JwT["z"]'

Length of output: 30


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary JwT and its keys in the codebase.

# Test: Search for any usage of the dictionary JwT and its keys.
rg --type py -A 5 'JwT\["'

Length of output: 494


168-168: Verify the new key "y" in the dictionary.

Ensure that the key "y" is correct and consistent with the rest of the codebase.

Verification successful

Re-verify the usage of the dictionary key "y".

Ensure that the key "y" is correct and consistent with the rest of the codebase.


Re-verify the dictionary key usage in BNoRef.

Ensure that the key "y" is correct and consistent with the rest of the codebase.


The key "y" is correctly and consistently used in the codebase.

The key "y" is found in the file tests/functional/tdtagged/td1dtagged.py and no other keys for BNoRef were identified. This confirms that the change is consistent within the file.

  • tests/functional/tdtagged/td1dtagged.py: BNoRef["y"]
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type python -A 5 $'BNoRef["y"]'

Length of output: 68


Script:

#!/bin/bash
# Description: Verify the usage of the dictionary key "y" in the codebase.

# Test: Search for the dictionary key usage. Expect: Consistent usage of the new key "y".
rg --type py -A 5 $'BNoRef["y"]'

Length of output: 33


Script:

#!/bin/bash
# Description: Search for all dictionary keys used within the `BNoRef` dictionary.

# Test: Search for all keys within the `BNoRef` dictionary. Expect: Identify all keys used.
rg --type py -o '\bBNoRef\["[^"]+"\]'

Length of output: 143


173-173: Verify the new key "z" in the dictionary.

Ensure that the key "z" is correct and consistent with the rest of the codebase.

tests/functional/ionIonBeam/ion_ion_beam1d.py (2)

129-130: Verify the consistency of new keys.

Ensure the new keys "y" and "z" are used consistently and correctly throughout the codebase.

Verification successful

The new keys "y" and "z" are used consistently and correctly throughout the codebase.

The changes in lines 129-130 of tests/functional/ionIonBeam/ion_ion_beam1d.py are consistent with the rest of the codebase.

  • tests/simulator/test_initialization.py
  • tests/simulator/test_run.py
  • tests/simulator/test_advance.py
  • tests/functional/tdtagged/td1dtagged.py
  • tests/functional/shock/shock.py
  • tests/functional/ionIonBeam/ion_ion_beam1d.py
  • tests/functional/alfven_wave/alfven_wave1d.py
  • tests/functional/harris/harris_2d_lb.py
  • tests/functional/conservation/conserv.py
  • tests/amr/data/field/coarsening/test_coarsen_field.py
  • pyphare/pyphare_tests/test_pharesee/test_hierarchy.py
  • pyphare/pyphare_tests/test_pharesee/__init__.py
  • pyphare/pyphare/core/operators.py
  • pyphare/pyphare/core/gridlayout.py
  • pyphare/pyphare/pharesee/hierarchy/vectorfield.py
  • pyphare/pyphare/pharesee/run/utils.py
  • pyphare/pyphare/pharesee/hierarchy/hierarchy_utils.py
  • pyphare/pyphare/pharesee/hierarchy/patchdata.py
  • pyphare/pyphare/pharesee/hierarchy/patch.py
  • pyphare/pyphare/pharesee/hierarchy/hierarchy.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of new keys `"y"` and `"z"`.

# Test: Search for the usage of the new keys. Expect: Only occurrences of the new keys.
rg --type python '"y"' -A 5
rg --type python '"z"' -A 5

Length of output: 121


Script:

#!/bin/bash
# Description: Verify the consistency of new keys `"y"` and `"z"`.

# Test: Search for the usage of the new keys. Expect: Only occurrences of the new keys.
rg --type py '"y"' -A 5
rg --type py '"z"' -A 5

Length of output: 29451


5-5: Verify the new import path.

Ensure the new import path from pyphare.pharesee.hierarchy.fromh5 import get_times_from_h5 is correct and consistent with the rest of the codebase.

Verification successful

The new import path is correct.

The function get_times_from_h5 is defined in pyphare/pyphare/pharesee/hierarchy/fromh5.py, confirming that the import path from pyphare.pharesee.hierarchy.fromh5 import get_times_from_h5 is accurate.

  • pyphare/pyphare/pharesee/hierarchy/fromh5.py: def get_times_from_h5(filepath, as_float=True):
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new import path for `get_times_from_h5`.

# Test: Search for the function definition. Expect: Only occurrences of the new path.
rg --type python 'def get_times_from_h5'

Length of output: 73


Script:

#!/bin/bash
# Description: Verify the new import path for `get_times_from_h5`.

# Find all Python files and search for the function definition within them.
fd -e py -x rg 'def get_times_from_h5' {}

Length of output: 93


Script:

#!/bin/bash
# Description: Verify the new import path for `get_times_from_h5`.

# Find all Python files and search for the function definition within them, including file paths.
fd -e py -x rg 'def get_times_from_h5' --with-filename {}

Length of output: 156

tests/functional/conservation/conserv.py (2)

6-6: Verify the new import path.

Ensure the new import path from pyphare.pharesee.hierarchy.fromh5 import get_times_from_h5 is correct and consistent with the rest of the codebase.

Verification successful

The new import path is correct.

The function get_times_from_h5 is correctly imported from pyphare.pharesee.hierarchy.fromh5.

  • pyphare/pyphare/pharesee/hierarchy/fromh5.py: def get_times_from_h5(filepath, as_float=True):
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new import path for `get_times_from_h5`.

# Test: Search for the function definition. Expect: Only occurrences of the new path.
rg --type python 'def get_times_from_h5'

Length of output: 73


Script:

#!/bin/bash
# Description: Verify the new import path for `get_times_from_h5`.

# Test: Search for the function definition. Expect: Only occurrences of the new path.
rg 'def get_times_from_h5' --glob '*.py' -A 3

Length of output: 411


158-168: Verify the consistency of new keys.

Ensure the new keys "x", "y", and "z" are used consistently and correctly throughout the codebase.

Verification successful

The new keys "x", "y", and "z" are used consistently and correctly throughout the codebase.

The keys are integrated and utilized properly across various files, including the file under review (tests/functional/conservation/conserv.py).

  • tests/functional/conservation/conserv.py
  • tests/simulator/test_initialization.py
  • tests/simulator/test_run.py
  • src/python3/patch_level.hpp
  • src/amr/wrappers/integrator.hpp
  • src/amr/wrappers/hierarchy.hpp
  • tests/functional/tdtagged/td1dtagged.py
  • tests/functional/ionIonBeam/ion_ion_beam1d.py
  • tests/functional/harris/harris_2d_lb.py
  • tests/amr/data/field/coarsening/test_linear_coarsen.hpp
  • tests/amr/data/field/coarsening/test_coarsen_field.py
  • pyphare/pyphare/pharesee/hierarchy/vectorfield.py
  • pyphare/pyphare/pharesee/hierarchy/hierarchy_utils.py
  • pyphare/pyphare/core/operators.py
  • pyphare/pyphare/core/gridlayout.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of new keys `"x"`, `"y"`, and `"z"`.

# Test: Search for the usage of the new keys. Expect: Only occurrences of the new keys.
rg --type python '"x"' -A 5
rg --type python '"y"' -A 5
rg --type python '"z"' -A 5

Length of output: 182


Script:

#!/bin/bash
# Description: Verify the consistency of new keys `"x"`, `"y"`, and `"z"`.

# Test: Search for the usage of the new keys. Expect: Only occurrences of the new keys.
rg '"x"' -A 5
rg '"y"' -A 5
rg '"z"' -A 5

Length of output: 62979

tests/simulator/test_initialization.py (1)

286-288: Verify the consistency of new keys.

Ensure the new keys "x", "y", and "z" are used consistently and correctly throughout the codebase.

Verification successful

The new keys "x", "y", and "z" are used consistently and correctly throughout the codebase.

This confirms that the changes made in tests/simulator/test_initialization.py are aligned with the rest of the codebase.

  • tests/simulator/test_run.py
  • tests/simulator/test_initialization.py
  • tests/simulator/test_advance.py
  • tests/functional/harris/harris_2d_lb.py
  • tests/functional/ionIonBeam/ion_ion_beam1d.py
  • tests/functional/conservation/conserv.py
  • tests/functional/alfven_wave/alfven_wave1d.py
  • tests/core/data/gridlayout/grid_yee.py
  • tests/amr/data/field/coarsening/test_coarsen_field.py
  • pyphare/pyphare_tests/test_pharesee/test_hierarchy.py
  • pyphare/pyphare/pharesee/run/utils.py
  • pyphare/pyphare/pharesee/hierarchy/patchdata.py
  • pyphare/pyphare/pharesee/hierarchy/vectorfield.py
  • pyphare/pyphare/pharesee/hierarchy/hierarchy.py
  • pyphare/pyphare/pharesee/hierarchy/patch.py
  • pyphare/pyphare/pharesee/hierarchy/hierarchy_utils.py
  • pyphare/pyphare/core/operators.py
  • pyphare/pyphare/core/gridlayout.py
  • pyphare/pyphare/pharesee/plotting.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of new keys `"x"`, `"y"`, and `"z"`.

# Test: Search for the usage of the new keys. Expect: Only occurrences of the new keys.
rg --type python '"x"' -A 5
rg --type python '"y"' -A 5
rg --type python '"z"' -A 5

Length of output: 182


Script:

#!/bin/bash
# Description: Verify the consistency of new keys `"x"`, `"y"`, and `"z"`.

# Test: Search for the usage of the new keys. Expect: Only occurrences of the new keys.
rg -t py '"x"' -A 5
rg -t py '"y"' -A 5
rg -t py '"z"' -A 5

Length of output: 48546

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 ba2575a and df19d2d.

Files selected for processing (5)
  • tests/functional/alfven_wave/alfven_wave1d.py (2 hunks)
  • tests/functional/conservation/conserv.py (2 hunks)
  • tests/functional/ionIonBeam/ion_ion_beam1d.py (2 hunks)
  • tests/functional/shock/shock.py (2 hunks)
  • tests/functional/tdtagged/td1dtagged.py (1 hunks)
Files skipped from review as they are similar to previous changes (5)
  • tests/functional/alfven_wave/alfven_wave1d.py
  • tests/functional/conservation/conserv.py
  • tests/functional/ionIonBeam/ion_ion_beam1d.py
  • tests/functional/shock/shock.py
  • tests/functional/tdtagged/td1dtagged.py

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

Outside diff range, codebase verification and nitpick comments (4)
tests/functional/conservation/conserv.py (1)

154-155: Consider moving the import statement to the top.

The import statement for dot should be moved to the top of the file to follow the convention of placing all imports together.

-    from pyphare.core.operators import dot
+from pyphare.core.operators import dot
pyphare/pyphare/pharesee/run/run.py (3)

94-95: Avoid equality comparisons to True.

Replace if merged == True: with if merged: to follow best practices.

-        if merged == True:
+        if merged:
Tools
Ruff

94-94: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)


104-105: Avoid equality comparisons to True.

Replace if merged == True: with if merged: to follow best practices.

-        if merged == True:
+        if merged:
Tools
Ruff

104-104: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)


166-167: Avoid equality comparisons to True.

Replace if merged == True: with if merged: to follow best practices.

-        if merged == True:
+        if merged:
Tools
Ruff

166-166: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between df19d2d and 141a502.

Files selected for processing (4)
  • pyphare/pyphare/pharesee/run/run.py (5 hunks)
  • tests/functional/alfven_wave/alfven_wave1d.py (3 hunks)
  • tests/functional/conservation/conserv.py (2 hunks)
  • tests/functional/ionIonBeam/ion_ion_beam1d.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • tests/functional/ionIonBeam/ion_ion_beam1d.py
Files skipped from review as they are similar to previous changes (1)
  • tests/functional/alfven_wave/alfven_wave1d.py
Additional context used
Ruff
pyphare/pyphare/pharesee/run/run.py

94-94: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)


104-104: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)


166-166: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)

Additional comments not posted (4)
tests/functional/conservation/conserv.py (3)

6-6: Verify the updated import path.

Ensure that the new path pyphare.pharesee.hierarchy.fromh5 for get_times_from_h5 is correct and consistent with the project's module structure.


156-161: LGTM!

The new logic for calculating magnetic energy using the dot function is correct and more efficient than the previous implementation.


158-161: LGTM!

The summation process for magnetic energy is correct and efficiently implemented.

pyphare/pyphare/pharesee/run/run.py (1)

249-254: LGTM!

The changes to simplify file path handling in the GetDl method are correct and improve the method's efficiency.

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: 3

Outside diff range, codebase verification and nitpick comments (1)
pyphare/pyphare/pharesee/run/run.py (1)

249-249: Issues found with file path handling change.

The assumption that h5_filename is always a complete path is incorrect. The context shows that h5_filename is often constructed using os.path.join with other paths, indicating it is not always a complete path by itself. This change could lead to issues if h5_filename is not a complete path in some contexts.

  • File: pyphare/pyphare/pharesee/run/run.py
  • Lines: 249
Analysis chain

Verify the file path handling change.

Ensure that h5_filename is expected to be a complete path or that the context of file locations has changed. This change assumes that h5_filename is already a complete path.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the context of `h5_filename` to ensure it is a complete path.

# Test: Search for the definition and usage of `h5_filename`. Expect: It should be a complete path.
rg --type python -A 5 $'h5_filename'

Length of output: 66


Script:

#!/bin/bash
# Description: Verify the context of `h5_filename` to ensure it is a complete path.

# Test: Search for the definition and usage of `h5_filename`. Expect: It should be a complete path.
rg --type py -A 5 $'h5_filename'

Length of output: 18339

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 141a502 and afb8f8c.

Files selected for processing (5)
  • pyphare/pyphare/pharesee/run/run.py (5 hunks)
  • tests/functional/alfven_wave/alfven_wave1d.py (4 hunks)
  • tests/functional/conservation/conserv.py (2 hunks)
  • tests/functional/ionIonBeam/ion_ion_beam1d.py (1 hunks)
  • tests/simulator/test_diagnostic_timestamps.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • tests/functional/ionIonBeam/ion_ion_beam1d.py
Additional context used
Ruff
pyphare/pyphare/pharesee/run/run.py

94-94: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)


104-104: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)


166-166: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)

Additional comments not posted (7)
tests/simulator/test_diagnostic_timestamps.py (1)

16-16: LGTM!

The import of h5_time_grp_key is correctly added to support the new functionality.

tests/functional/alfven_wave/alfven_wave1d.py (5)

131-133: LGTM!

The updates to the GetB method and dictionary keys are consistent with the new data structure.


160-162: LGTM!

The updates to the GetB method and dictionary keys are consistent with the new data structure.


167-168: LGTM!

The updates to the dictionary keys are consistent with the new data structure.


170-172: LGTM!

The updates to the GetB method and dictionary keys are consistent with the new data structure.


182-184: LGTM!

The updates to the GetB method and dictionary keys are consistent with the new data structure.

tests/functional/conservation/conserv.py (1)

154-163: LGTM!

The new approach simplifies the calculation of magnetic energy and improves readability.

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: 3

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between afb8f8c and 11470dd.

Files selected for processing (5)
  • pyphare/pyphare/pharesee/run/run.py (5 hunks)
  • tests/functional/alfven_wave/alfven_wave1d.py (4 hunks)
  • tests/functional/conservation/conserv.py (2 hunks)
  • tests/functional/ionIonBeam/ion_ion_beam1d.py (1 hunks)
  • tests/simulator/test_diagnostic_timestamps.py (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • tests/functional/alfven_wave/alfven_wave1d.py
  • tests/functional/ionIonBeam/ion_ion_beam1d.py
  • tests/simulator/test_diagnostic_timestamps.py
Additional context used
Ruff
pyphare/pyphare/pharesee/run/run.py

94-94: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)


104-104: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)


166-166: Avoid equality comparisons to True; use if merged: for truth checks

Replace with merged

(E712)

Additional comments not posted (4)
tests/functional/conservation/conserv.py (2)

154-161: LGTM! Ensure the correctness of the new implementation.

The new implementation of mag_energy looks correct and efficient. Ensure that the dot function from pyphare.core.operators is correctly used and that the changes maintain the intended functionality.


6-6: Verify the new import path.

Ensure that pyphare.pharesee.hierarchy.fromh5 is the correct module for get_times_from_h5.

Verification successful

Verify the new import path.

Ensure that pyphare.pharesee.hierarchy.fromh5 is the correct module for get_times_from_h5.


Verified the new import path.

The function get_times_from_h5 is correctly imported from pyphare.pharesee.hierarchy.fromh5.

  • pyphare/pyphare/pharesee/hierarchy/fromh5.py: def get_times_from_h5(filepath, as_float=True):
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new import path for `get_times_from_h5`.

# Test: Search for the definition of `get_times_from_h5`. Expect: It should be defined in `pyphare/pharesee/hierarchy/fromh5.py`.
rg --type python --files-with-matches 'def get_times_from_h5'

Length of output: 94


Script:

#!/bin/bash
# Description: Verify the new import path for `get_times_from_h5`.

# Test: Search for the definition of `get_times_from_h5`. Expect: It should be defined in `pyphare/pharesee/hierarchy/fromh5.py`.
rg 'def get_times_from_h5' --glob '*.py'

Length of output: 135

pyphare/pyphare/pharesee/run/run.py (2)

249-249: LGTM! Simplify the file path handling.

The change simplifies the file path handling by directly using h5_filename.


254-254: LGTM! Simplify the method's implementation.

The change removes the unnecessary path variable, simplifying the method's implementation.

pyphare/pyphare/pharesee/run/run.py Show resolved Hide resolved
pyphare/pyphare/pharesee/run/run.py Show resolved Hide resolved
pyphare/pyphare/pharesee/run/run.py Show resolved Hide resolved
@nicolasaunai nicolasaunai merged commit 006595e into PHAREHUB:master Aug 1, 2024
12 checks passed
@nicolasaunai nicolasaunai mentioned this pull request Aug 4, 2024
@coderabbitai coderabbitai bot mentioned this pull request Sep 20, 2024
This was referenced Oct 18, 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.

2 participants