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

remove compute_timestamps #866

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

nicolasaunai
Copy link
Member

@nicolasaunai nicolasaunai commented Jul 29, 2024

from #773

Summary by CodeRabbit

  • New Features

    • Simplified diagnostic functionality by removing the compute_timestamps parameter from various diagnostic classes, enhancing overall clarity and performance.
  • Bug Fixes

    • Adjustments made to the handling of timestamps to ensure consistent behavior across diagnostics.
  • Documentation

    • Improved comments and code readability for better maintainability in diagnostic processes.
  • Style

    • Code formatting enhancements for better readability and consistency across various scripts.

Copy link

coderabbitai bot commented Jul 29, 2024

Walkthrough

Walkthrough

The recent changes primarily focus on simplifying the diagnostics handling in the codebase by removing the compute_timestamps parameter from various diagnostic classes and function calls. This adjustment streamlines the instantiation of diagnostic entities, suggesting a more integrated approach for timestamp management. The overall functionality remains intact, but the modifications aim to enhance clarity and reduce complexity in the code.

Changes

File(s) Change Summary
pyphare/pyphare/pharein/diagnostics.py Removed compute_timestamps from the wrapper function and adjusted its handling in the constructor.
pyphare/pyphare_tests/test_pharesee/test_hierarchy.py Simplified FluidDiagnostics instantiation by removing compute_timestamps.
src/phare/phare_init.py, src/phare/phare_init_small.py Removed compute_timestamps from constructor calls for ElectromagDiagnostics and FluidDiagnostics.
tests/diagnostic/__init__.py Removed compute_timestamps from dump_all_diags function calls for various diagnostics.
tests/functional/* Simplified calls to ElectromagDiagnostics and FluidDiagnostics by removing compute_timestamps.
tests/simulator/* Removed compute_timestamps from diagnostic class instantiations, simplifying the setup.
tools/bench/real/bench_harris.py Improved code formatting and removed redundant parameters in diagnostic function calls for better clarity.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Diagnostics
    participant FluidDiagnostics
    participant ElectromagDiagnostics

    User->>Diagnostics: Request diagnostics
    Diagnostics->>FluidDiagnostics: Instantiate with quantity, write_timestamps
    Diagnostics->>ElectromagDiagnostics: Instantiate with quantity, write_timestamps
    FluidDiagnostics->>Diagnostics: Return diagnostics data
    ElectromagDiagnostics->>Diagnostics: Return diagnostics data
    Diagnostics->>User: Deliver diagnostics results
Loading

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 (3)
tests/functional/td/td1d.py (1)

104-106: Verify the removal of compute_timestamps from FluidDiagnostics.

The compute_timestamps parameter is still present in multiple parts of the codebase, including pyphare/pyphare/pharein/diagnostics.py, where the FluidDiagnostics class is defined. This indicates that the parameter has not been fully removed.

  • pyphare/pyphare/pharein/diagnostics.py: Contains multiple references to compute_timestamps.

Please ensure that all references to compute_timestamps are removed from the codebase to avoid potential issues.

Analysis chain

Verify the removal of compute_timestamps from FluidDiagnostics.

Ensure that the removal of the compute_timestamps parameter does not affect the functionality of FluidDiagnostics.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of `compute_timestamps` from `FluidDiagnostics`.

# Test: Search for the function definition of `FluidDiagnostics` and check for the `compute_timestamps` parameter.
rg --type python 'def FluidDiagnostics' -A 5

Length of output: 77


Script:

#!/bin/bash
# Description: Verify the removal of `compute_timestamps` from `FluidDiagnostics`.

# Test: Search for the function definition of `FluidDiagnostics` and check for the `compute_timestamps` parameter.
rg 'def FluidDiagnostics' -A 10

# Test: Search for any references to `compute_timestamps` in the codebase.
rg 'compute_timestamps'

Length of output: 878


Script:

#!/bin/bash
# Description: Verify the removal of `compute_timestamps` from `FluidDiagnostics`.

# Test: Search for the class definition of `FluidDiagnostics` and check for the `compute_timestamps` parameter.
rg 'class FluidDiagnostics' -A 10

# Test: Search for any references to `FluidDiagnostics` in non-Python files to determine its type.
rg 'FluidDiagnostics'

Length of output: 6658

tests/simulator/test_advance.py (2)

153-153: Issue with the removal of compute_timestamps parameter

The compute_timestamps parameter is still used within the ElectromagDiagnostics class. Removing it from the instantiation may lead to functional issues.

  • pyphare/pyphare/pharein/diagnostics.py: The compute_timestamps parameter is assigned the value of write_timestamps and is used multiple times within the class.
Analysis chain

Ensure correctness of the ElectromagDiagnostics instantiation.

The compute_timestamps parameter is removed. Ensure that this change does not affect the functionality.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the instantiation of `ElectromagDiagnostics` without `compute_timestamps`.

# Test: Search for the `ElectromagDiagnostics` class definition to ensure `compute_timestamps` is not required.
rg --type python -A 5 'class ElectromagDiagnostics'

Length of output: 84


Script:

#!/bin/bash
# Description: Verify the instantiation of `ElectromagDiagnostics` without `compute_timestamps`.

# Test: Search for the `ElectromagDiagnostics` class definition to ensure `compute_timestamps` is not required.
rg -A 5 'class ElectromagDiagnostics'

Length of output: 458


Script:

#!/bin/bash
# Description: Verify if `compute_timestamps` is used within the `ElectromagDiagnostics` class.

# Test: Search for the usage of `compute_timestamps` within the `ElectromagDiagnostics` class.
rg 'compute_timestamps' pyphare/pyphare/pharein/diagnostics.py

Length of output: 354


167-167: Ensure correctness of the ParticleDiagnostics instantiation.

The compute_timestamps parameter is still used within the diagnostics.py file. Its removal from the instantiation of ParticleDiagnostics could affect functionality. Please review the usage of compute_timestamps to ensure that this change does not cause any issues.

  • pyphare/pyphare/pharein/diagnostics.py
Analysis chain

Ensure correctness of the ParticleDiagnostics instantiation.

The compute_timestamps parameter is removed. Ensure that this change does not affect the functionality.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the instantiation of `ParticleDiagnostics` without `compute_timestamps`.

# Test: Search for the `ParticleDiagnostics` class definition to ensure `compute_timestamps` is not required.
rg --type python -A 5 'class ParticleDiagnostics'

Length of output: 82


Script:

#!/bin/bash
# Description: Verify the instantiation of `ParticleDiagnostics` without `compute_timestamps`.

# Test: Search for the `ParticleDiagnostics` class definition to ensure `compute_timestamps` is not required.
ast-grep --lang python --pattern $'class ParticleDiagnostics($_, $_):\n    def __init__($_):\n        $$$'

Length of output: 105


Script:

#!/bin/bash
# Description: Verify the instantiation of `ParticleDiagnostics` without `compute_timestamps`.

# Test: Search for the `ParticleDiagnostics` class definition to ensure `compute_timestamps` is not required.
rg 'class ParticleDiagnostics'

Length of output: 111


Script:

#!/bin/bash
# Description: Verify the instantiation of `ParticleDiagnostics` without `compute_timestamps`.

# Test: Search for the `__init__` method of the `ParticleDiagnostics` class to ensure `compute_timestamps` is not required.
rg -A 10 'class ParticleDiagnostics' pyphare/pyphare/pharein/diagnostics.py

Length of output: 453


Script:

#!/bin/bash
# Description: Verify the instantiation of `ParticleDiagnostics` without `compute_timestamps`.

# Test: Search for the usage of `compute_timestamps` within the `ParticleDiagnostics` class and its parent class `Diagnostics`.
rg 'compute_timestamps' pyphare/pyphare/pharein/diagnostics.py

Length of output: 354

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

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

Files selected for processing (19)
  • pyphare/pyphare/pharein/diagnostics.py (2 hunks)
  • pyphare/pyphare_tests/test_pharesee/test_hierarchy.py (1 hunks)
  • src/phare/phare_init.py (1 hunks)
  • src/phare/phare_init_small.py (1 hunks)
  • tests/diagnostic/init.py (3 hunks)
  • tests/functional/alfven_wave/alfven_wave1d.py (1 hunks)
  • tests/functional/conservation/conserv.py (1 hunks)
  • tests/functional/dispersion/dispersion.py (2 hunks)
  • tests/functional/ionIonBeam/ion_ion_beam1d.py (1 hunks)
  • tests/functional/shock/shock.py (1 hunks)
  • tests/functional/td/td1d.py (1 hunks)
  • tests/functional/tdtagged/td1dtagged.py (1 hunks)
  • tests/functional/translation/translat1d.py (2 hunks)
  • tests/simulator/refinement/test_2d_10_core.py (1 hunks)
  • tests/simulator/refinement/test_2d_2_core.py (1 hunks)
  • tests/simulator/test_advance.py (2 hunks)
  • tests/simulator/test_diagnostic_timestamps.py (2 hunks)
  • tests/simulator/test_initialization.py (2 hunks)
  • tools/bench/real/bench_harris.py (1 hunks)
Files skipped from review due to trivial changes (3)
  • tests/functional/translation/translat1d.py
  • tests/simulator/refinement/test_2d_10_core.py
  • tests/simulator/refinement/test_2d_2_core.py
Additional context used
Ruff
tools/bench/real/bench_harris.py

36-36: Ambiguous variable name: l

(E741)

Additional comments not posted (29)
tests/diagnostic/__init__.py (2)

23-23: Removal of compute_timestamps parameter from InfoDiagnostics

The compute_timestamps parameter has been removed from the ph.InfoDiagnostics call. Ensure that this change does not affect the functionality of the diagnostics.


28-28: Removal of compute_timestamps parameter from commented-out MetaDiagnostics

The compute_timestamps parameter has been removed from the commented-out ph.MetaDiagnostics call. This change is consistent with the removal in other diagnostic calls.

src/phare/phare_init.py (2)

101-101: Removal of compute_timestamps parameter from ElectromagDiagnostics

The compute_timestamps parameter has been removed from the ph.ElectromagDiagnostics instantiation. Ensure that this change does not affect the functionality of the diagnostics.


105-105: Removal of compute_timestamps parameter from FluidDiagnostics

The compute_timestamps parameter has been removed from the ph.FluidDiagnostics instantiation. Ensure that this change does not affect the functionality of the diagnostics.

src/phare/phare_init_small.py (2)

104-104: Removal of compute_timestamps parameter from ElectromagDiagnostics

The compute_timestamps parameter has been removed from the ph.ElectromagDiagnostics instantiation. Ensure that this change does not affect the functionality of the diagnostics.


108-108: Removal of compute_timestamps parameter from FluidDiagnostics

The compute_timestamps parameter has been removed from the ph.FluidDiagnostics instantiation. Ensure that this change does not affect the functionality of the diagnostics.

tests/functional/td/td1d.py (1)

101-102: Verify the removal of compute_timestamps from ElectromagDiagnostics.

Ensure that the removal of the compute_timestamps parameter does not affect the functionality of ElectromagDiagnostics.

Verification successful

Verify the removal of compute_timestamps from ElectromagDiagnostics.

The compute_timestamps parameter is not found in the class definition or invocations of ElectromagDiagnostics. The functionality appears to rely on the write_timestamps parameter instead. The removal of compute_timestamps does not affect the functionality of ElectromagDiagnostics.

  • pyphare/pyphare/pharein/diagnostics.py: Class definition and __init__ method of ElectromagDiagnostics.
  • Multiple test files and source files invoking ElectromagDiagnostics with write_timestamps.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of `compute_timestamps` from `ElectromagDiagnostics`.

# Test: Search for the function definition of `ElectromagDiagnostics` and check for the `compute_timestamps` parameter.
rg --type python 'def ElectromagDiagnostics' -A 5

Length of output: 82


Script:

#!/bin/bash
# Description: Verify the removal of `compute_timestamps` from `ElectromagDiagnostics`.

# Test: Search for the function definition of `ElectromagDiagnostics` and check for the `compute_timestamps` parameter.
rg --type py 'def ElectromagDiagnostics' -A 5

Length of output: 47


Script:

#!/bin/bash
# Description: Verify the removal of `compute_timestamps` from `ElectromagDiagnostics`.

# Test 1: Search for the class definition of `ElectromagDiagnostics`.
rg --type py 'class ElectromagDiagnostics' -A 10

# Test 2: Search for any method definitions within the `ElectromagDiagnostics` class.
rg --type py 'def ' -A 5 | rg 'ElectromagDiagnostics'

# Test 3: Search for invocations of `ElectromagDiagnostics` to check for parameters used.
rg --type py 'ElectromagDiagnostics(' -A 2

Length of output: 1594


Script:

#!/bin/bash
# Description: Verify the removal of `compute_timestamps` from `ElectromagDiagnostics`.

# Test: Search for invocations of `ElectromagDiagnostics` to check for parameters used.
rg --type py 'ElectromagDiagnostics\(' -A 2

Length of output: 6725

tools/bench/real/bench_harris.py (2)

81-84: Enhance readability with formatting improvements.

The formatting improvements in the config function enhance readability and maintainability.


122-123: Verify the removal of redundant parameters from ElectromagDiagnostics.

Ensure that the removal of redundant parameters does not affect the functionality of ElectromagDiagnostics.

tests/functional/dispersion/dispersion.py (3)

89-90: Verify the removal of compute_timestamps from ElectromagDiagnostics.

Ensure that the removal of the compute_timestamps parameter does not affect the functionality of ElectromagDiagnostics.


171-172: Verify the removal of compute_timestamps from ElectromagDiagnostics.

Ensure that the removal of the compute_timestamps parameter does not affect the functionality of ElectromagDiagnostics.


174-175: Verify the removal of compute_timestamps from FluidDiagnostics.

Ensure that the removal of the compute_timestamps parameter does not affect the functionality of FluidDiagnostics.

tests/functional/shock/shock.py (2)

108-108: LGTM! But verify the usage of ElectromagDiagnostics.

The compute_timestamps parameter has been removed. Ensure that the remaining parameters are correctly passed and the functionality remains intact.

Verification successful

LGTM! But verify the usage of ElectromagDiagnostics.

The compute_timestamps parameter has been removed. Ensure that the remaining parameters are correctly passed and the functionality remains intact.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `ElectromagDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `ElectromagDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type python -A 5 $'ElectromagDiagnostics'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the usage of `ElectromagDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `ElectromagDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type py -A 5 $'ElectromagDiagnostics'

Length of output: 16962


111-111: LGTM! But verify the usage of FluidDiagnostics.

The compute_timestamps parameter has been removed. Ensure that the remaining parameters are correctly passed and the functionality remains intact.

Verification successful

The usage of FluidDiagnostics is verified and correct.

All instances of FluidDiagnostics in the codebase use the updated parameters quantity and write_timestamps. The removal of the compute_timestamps parameter does not affect the functionality.

  • src/phare/phare_init.py
  • src/phare/phare_init_small.py
  • tests/simulator/test_initialization.py
  • tests/simulator/test_advance.py
  • tests/simulator/test_run.py
  • tests/simulator/refinement/test_2d_2_core.py
  • tests/simulator/refinement/test_2d_10_core.py
  • tests/diagnostic/__init__.py
  • tests/functional/harris/harris_2d_lb.py
  • tests/functional/td/td1d.py
  • tests/functional/shock/shock.py
  • tests/functional/tdtagged/td1dtagged.py
  • tests/functional/dispersion/dispersion.py
  • tests/functional/alfven_wave/alfven_wave1d.py
  • tests/functional/translation/translat1d.py
  • pyphare/pyphare_tests/test_pharesee/test_hierarchy.py
  • pyphare/pyphare/pharein/diagnostics.py
  • pyphare/pyphare/pharein/examples/job.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `FluidDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `FluidDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type python -A 5 $'FluidDiagnostics'

Length of output: 71


Script:

#!/bin/bash
# Description: Verify the usage of `FluidDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `FluidDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --glob '*.py' -A 5 'FluidDiagnostics'

Length of output: 14848

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

97-97: LGTM! But verify the usage of FluidDiagnostics.

The compute_timestamps parameter has been removed. Ensure that the remaining parameters are correctly passed and the functionality remains intact.

Verification successful

LGTM! The compute_timestamps parameter has been removed, and the remaining parameters are correctly passed. The functionality remains intact.

  • tests/functional/alfven_wave/alfven_wave1d.py: Line 97
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `FluidDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `FluidDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type python -A 5 $'FluidDiagnostics'

Length of output: 71


Script:

#!/bin/bash
# Description: Verify the usage of `FluidDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `FluidDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type py -A 5 $'FluidDiagnostics'

Length of output: 14844


94-94: LGTM! But verify the usage of ElectromagDiagnostics.

The compute_timestamps parameter has been removed. Ensure that the remaining parameters are correctly passed and the functionality remains intact.

Verification successful

LGTM! The usage of ElectromagDiagnostics has been verified.

The compute_timestamps parameter has been removed consistently across the codebase. The remaining parameters quantity and write_timestamps are correctly passed, ensuring the functionality remains intact.

  • Instances found in:
    • tests/simulator/test_initialization.py
    • tests/diagnostic/__init__.py
    • tests/functional/translation/translat1d.py
    • tests/functional/conservation/conserv.py
    • tests/functional/tdtagged/td1dtagged.py
    • tests/functional/td/td1d.py
    • tests/functional/shock/shock.py
    • tests/functional/ionIonBeam/ion_ion_beam1d.py
    • tests/functional/harris/harris_2d.py
    • tests/functional/harris/harris_2d_lb.py
    • tests/functional/dispersion/dispersion.py
    • tests/functional/alfven_wave/alfven_wave1d.py
    • tests/simulator/test_run.py
    • tests/simulator/test_advance.py
    • tests/simulator/test_diagnostic_timestamps.py
    • tests/simulator/refinement/test_2d_2_core.py
    • tests/simulator/refinement/test_2d_10_core.py
    • tools/bench/real/bench_harris.py
    • src/phare/phare_init_small.py
    • src/phare/phare_init.py
    • pyphare/pyphare_tests/test_pharesee/test_hierarchy.py
    • pyphare/pyphare/pharein/examples/job.py
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `ElectromagDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `ElectromagDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type python -A 5 $'ElectromagDiagnostics'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the usage of `ElectromagDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `ElectromagDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type py -A 5 'ElectromagDiagnostics'

Length of output: 16962

tests/simulator/test_diagnostic_timestamps.py (2)

Line range hint 61-61:
LGTM! But verify the usage of ElectromagDiagnostics.

The compute_timestamps parameter has been removed. Ensure that the remaining parameters are correctly passed and the functionality remains intact.

Verification successful

LGTM! The removal of the compute_timestamps parameter from the ElectromagDiagnostics instantiation is correctly handled across the codebase.

  • The remaining parameters (quantity and write_timestamps) are correctly passed in all instances.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `ElectromagDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `ElectromagDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type python -A 5 $'ElectromagDiagnostics'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the usage of `ElectromagDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `ElectromagDiagnostics`. Expect: Only occurrences with the updated parameters.
rg 'ElectromagDiagnostics' --glob '*.py' -A 5

Length of output: 16966


Line range hint 101-101:
LGTM! But verify the usage of ElectromagDiagnostics.

The compute_timestamps parameter has been removed. Ensure that the remaining parameters are correctly passed and the functionality remains intact.

Verification successful

LGTM! But verify the usage of ElectromagDiagnostics.

The compute_timestamps parameter has been removed. Ensure that the remaining parameters are correctly passed and the functionality remains intact.

  • The removal of the compute_timestamps parameter has been consistently applied across the codebase.
  • The remaining parameters (quantity, write_timestamps, flush_every) are correctly passed in the instantiations.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `ElectromagDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `ElectromagDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type python -A 5 $'ElectromagDiagnostics'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the usage of `ElectromagDiagnostics` to ensure correct parameters are passed.

# Test: Search for the instantiation of `ElectromagDiagnostics`. Expect: Only occurrences with the updated parameters.
rg --type py -A 5 $'ElectromagDiagnostics'

Length of output: 16962

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

119-119: Simplified diagnostic function call for ElectromagDiagnostics.

The removal of the compute_timestamps parameter simplifies the function call. Ensure that the removal does not affect the intended functionality.


121-121: Simplified diagnostic function call for FluidDiagnostics.

The removal of the compute_timestamps parameter simplifies the function call. Ensure that the removal does not affect the intended functionality.

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

99-99: Simplified diagnostic function call for ElectromagDiagnostics.

The removal of the compute_timestamps parameter simplifies the function call. Ensure that the removal does not affect the intended functionality.


103-103: Simplified diagnostic function call for ParticleDiagnostics.

The removal of the compute_timestamps parameter simplifies the function call. Ensure that the removal does not affect the intended functionality.

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

86-86: Simplified diagnostic function call for ElectromagDiagnostics.

The removal of the compute_timestamps parameter simplifies the function call. Ensure that the removal does not affect the intended functionality.

pyphare/pyphare_tests/test_pharesee/test_hierarchy.py (1)

148-148: Simplified instantiation of FluidDiagnostics.

The compute_timestamps parameter has been removed from the instantiation of FluidDiagnostics. Ensure that this change aligns with the updated class definition and that the diagnostics are correctly handled without this parameter.

pyphare/pyphare/pharein/diagnostics.py (1)

119-123: Simplified timestamp handling in Diagnostics constructor.

The compute_timestamps parameter has been removed and is now assigned the same value as write_timestamps. This change simplifies the logic but ensure that future enhancements allow for different timestamp computations based on the type of diagnostics.

tests/simulator/test_initialization.py (2)

170-170: Simplified instantiation of ElectromagDiagnostics.

The compute_timestamps parameter has been removed from the instantiation of ElectromagDiagnostics. Ensure that this change aligns with the updated class definition and that the diagnostics are correctly handled without this parameter.


175-175: Simplified instantiation of FluidDiagnostics.

The compute_timestamps parameter has been removed from the instantiation of FluidDiagnostics. Ensure that this change aligns with the updated class definition and that the diagnostics are correctly handled without this parameter.

tests/simulator/test_advance.py (2)

156-156: Ensure correctness of the FluidDiagnostics instantiation.

The compute_timestamps parameter is removed. Ensure that this change does not affect the functionality.

Verification successful

The compute_timestamps parameter is not required for the FluidDiagnostics instantiation.

  • The FluidDiagnostics class constructor does not include a compute_timestamps parameter, and the instantiation logic is based on the quantity provided in kwargs.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the instantiation of `FluidDiagnostics` without `compute_timestamps`.

# Test: Search for the `FluidDiagnostics` class definition to ensure `compute_timestamps` is not required.
rg --type python -A 5 'class FluidDiagnostics'

Length of output: 79


Script:

#!/bin/bash
# Description: Verify the instantiation of `FluidDiagnostics` without `compute_timestamps`.

# Corrected Test: Search for the `FluidDiagnostics` class definition and inspect its constructor.
rg 'class FluidDiagnostics' -A 20

Length of output: 3076


Line range hint 162-162:
Ensure correctness of the FluidDiagnostics instantiation for population.

The compute_timestamps parameter is removed. Ensure that this change does not affect the functionality.

@nicolasaunai nicolasaunai merged commit 0614b8a into PHAREHUB:master Aug 1, 2024
12 checks passed
This was referenced Sep 12, 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