-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix functional tests #867
Conversation
WalkthroughWalkthroughThe 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
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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
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 ofB["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 thetests/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 5Length 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 ofpatch_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 theJNoRef
dictionary in the filetests/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 filetests/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 theBNoRef
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 | uniqLength 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 thetests/functional/tdtagged/td1dtagged.py
file.
tests/functional/tdtagged/td1dtagged.py
: Multiple instances ofJwT["z"]
andJNoRef["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 filetests/functional/tdtagged/td1dtagged.py
and no other keys forBNoRef
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 5Length 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 5Length 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 inpyphare/pyphare/pharesee/hierarchy/fromh5.py
, confirming that the import pathfrom 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 frompyphare.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 3Length 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 5Length 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 5Length 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 5Length 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 5Length of output: 48546
There was a problem hiding this 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
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
There was a problem hiding this 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 dotpyphare/pyphare/pharesee/run/run.py (3)
94-95
: Avoid equality comparisons toTrue
.Replace
if merged == True:
withif merged:
to follow best practices.- if merged == True: + if merged:Tools
Ruff
94-94: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace with
merged
(E712)
104-105
: Avoid equality comparisons toTrue
.Replace
if merged == True:
withif merged:
to follow best practices.- if merged == True: + if merged:Tools
Ruff
104-104: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace with
merged
(E712)
166-167
: Avoid equality comparisons toTrue
.Replace
if merged == True:
withif merged:
to follow best practices.- if merged == True: + if merged:Tools
Ruff
166-166: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace with
merged
(E712)
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
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
; useif merged:
for truth checksReplace with
merged
(E712)
104-104: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace with
merged
(E712)
166-166: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace 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
forget_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.
There was a problem hiding this 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 thath5_filename
is often constructed usingos.path.join
with other paths, indicating it is not always a complete path by itself. This change could lead to issues ifh5_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 thath5_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
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
; useif merged:
for truth checksReplace with
merged
(E712)
104-104: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace with
merged
(E712)
166-166: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace 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.
There was a problem hiding this 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
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
; useif merged:
for truth checksReplace with
merged
(E712)
104-104: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace with
merged
(E712)
166-166: Avoid equality comparisons to
True
; useif merged:
for truth checksReplace 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 thedot
function frompyphare.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 forget_times_from_h5
.Verification successful
Verify the new import path.
Ensure that
pyphare.pharesee.hierarchy.fromh5
is the correct module forget_times_from_h5
.
Verified the new import path.
The function
get_times_from_h5
is correctly imported frompyphare.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.
Summary by CodeRabbit
Bug Fixes
Chores