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

bug #913

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

bug #913

wants to merge 2 commits into from

Conversation

nicolasaunai
Copy link
Member

@nicolasaunai nicolasaunai commented Oct 21, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new simulation configuration for a Maxwellian fluid model, enhancing the capabilities of the simulation framework.
    • Added diagnostic tools for monitoring electromagnetic and fluid quantities during simulations.
  • Bug Fixes

    • Improved readability in the configuration files with added blank lines.
  • Documentation

    • Enhanced documentation for simulation setup and execution processes.

Copy link

coderabbitai bot commented Oct 21, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes include the addition of a new Python script, harris.py, which implements a simulation configuration for a Maxwellian fluid model using the PyPhare framework. Additionally, a modification was made to the CMakeLists.txt file to execute this script when the HighFive condition is met, passing specific parameters to it. The changes also enhance code readability by adding a blank line in the CMake file.

Changes

File Path Change Summary
tests/simulator/refinement/CMakeLists.txt Added call to phare_python3_exec within HighFive condition; included a blank line for readability.
tests/simulator/refinement/harris.py Introduced a new file with multiple functions for simulating a Maxwellian fluid model, including setup and diagnostics. Functions added: config, check_hier, get_time, get_hier, post_advance, and main.

Sequence Diagram(s)

sequenceDiagram
    participant CMake as CMakeLists.txt
    participant Python as harris.py
    CMake->>Python: Call phare_python3_exec(9, harris2d, harris.py, ${CMAKE_CURRENT_BINARY_DIR})
    Python->>Python: Initialize MPI
    Python->>Python: Execute config()
    Python->>Python: Run simulation and diagnostics
    Python->>Python: Perform post-advance checks
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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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

🧹 Outside diff range and nitpick comments (1)
tests/simulator/refinement/CMakeLists.txt (1)

12-12: Consider adding a comment to explain the purpose of this execution.

To improve maintainability and clarity, it would be helpful to add a brief comment explaining the purpose of this new test execution. For example:

# Execute harris.py to test the Maxwellian fluid model simulation
phare_python3_exec(9  harris2d harris.py  ${CMAKE_CURRENT_BINARY_DIR})
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c262a75 and bdabce6.

📒 Files selected for processing (2)
  • tests/simulator/refinement/CMakeLists.txt (1 hunks)
  • tests/simulator/refinement/harris.py (1 hunks)
🧰 Additional context used
🪛 Ruff
tests/simulator/refinement/harris.py

9-9: pyphare.pharein.ParticleDiagnostics imported but unused

Remove unused import: pyphare.pharein.ParticleDiagnostics

(F401)


12-12: pyphare.pharein.MetaDiagnostics imported but unused

Remove unused import: pyphare.pharein.MetaDiagnostics

(F401)


17-17: sys imported but unused

Remove unused import: sys

(F401)


19-19: matplotlib.pyplot imported but unused

Remove unused import: matplotlib.pyplot

(F401)


72-72: Ambiguous variable name: l

(E741)


189-189: Loop control variable ilvl not used within loop body

Rename unused ilvl to _ilvl

(B007)


213-213: Local variable errors is assigned to but never used

Remove assignment to unused variable errors

(F841)

🔇 Additional comments (2)
tests/simulator/refinement/CMakeLists.txt (2)

12-12: LGTM: New test execution added.

The addition of phare_python3_exec(9 harris2d harris.py ${CMAKE_CURRENT_BINARY_DIR}) looks good. It correctly integrates the new harris.py script into the test suite when the HighFive condition is met.


17-17: LGTM: Improved readability with blank line.

The addition of a blank line here improves the readability of the CMake file by clearly separating the new execution from the subsequent if(testMPI) block.

from pyphare.simulator.simulator import Simulator, startMPI
from pyphare.pharein import global_vars as gv
from pyphare.pharein import LoadBalancer
import sys
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove unused import sys.

The sys module is imported but not utilized in the script.

Apply this diff to remove the unused import:

-import sys
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import sys
🧰 Tools
🪛 Ruff

17-17: sys imported but unused

Remove unused import: sys

(F401)

datahier = check_hier(
get_hier("/home/aunai/Documents/code/phare/phare_jobs/run104/diags_master")
)
errors = test.base_test_overlaped_fields_are_equal(datahier, new_time)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove assignment to unused variable errors.

The variable errors is assigned but never used, which may lead to confusion.

If the variable is not needed, remove the assignment:

-errors = test.base_test_overlaped_fields_are_equal(datahier, new_time)
+test.base_test_overlaped_fields_are_equal(datahier, new_time)

Alternatively, if errors is significant, consider utilizing it appropriately in the code.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
errors = test.base_test_overlaped_fields_are_equal(datahier, new_time)
test.base_test_overlaped_fields_are_equal(datahier, new_time)
🧰 Tools
🪛 Ruff

213-213: Local variable errors is assigned to but never used

Remove assignment to unused variable errors

(F841)

from pyphare.pharein import LoadBalancer
import sys
import numpy as np
import matplotlib.pyplot as plt
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove unused import matplotlib.pyplot as plt.

matplotlib.pyplot is imported as plt but is not used in the code.

Apply this diff to remove the unused import:

-import matplotlib.pyplot as plt
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import matplotlib.pyplot as plt
🧰 Tools
🪛 Ruff

19-19: matplotlib.pyplot imported but unused

Remove unused import: matplotlib.pyplot

(F401)

from pyphare.pharein import (
ElectromagDiagnostics,
FluidDiagnostics,
ParticleDiagnostics,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove unused import ParticleDiagnostics.

According to the static analysis hints, ParticleDiagnostics is imported but not used in the code.

Apply this diff to remove the unused import:

     ElectromagDiagnostics,
     FluidDiagnostics,
-    ParticleDiagnostics,
     InfoDiagnostics,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ParticleDiagnostics,
ElectromagDiagnostics,
FluidDiagnostics,
InfoDiagnostics,
🧰 Tools
🪛 Ruff

9-9: pyphare.pharein.ParticleDiagnostics imported but unused

Remove unused import: pyphare.pharein.ParticleDiagnostics

(F401)

ParticleDiagnostics,
InfoDiagnostics,
)
from pyphare.pharein import MetaDiagnostics
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove unused import MetaDiagnostics.

MetaDiagnostics is imported but not used in the code.

Apply this diff to remove the unused import:

-from pyphare.pharein import MetaDiagnostics
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from pyphare.pharein import MetaDiagnostics
🧰 Tools
🪛 Ruff

12-12: pyphare.pharein.MetaDiagnostics imported but unused

Remove unused import: pyphare.pharein.MetaDiagnostics

(F401)

+ 1.0 / np.cosh((y - Ly * 0.7) / L) ** 2
)

def S(y, y0, l):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Rename ambiguous variable l to improve clarity.

Using l (lowercase 'L') as a variable name can be confused with the digit 1. It's recommended to use a more descriptive name.

Apply this diff to rename the variable:

-def S(y, y0, l):
+def S(y, y0, length):

Also, update all occurrences of l within the function to length:

-return 0.5 * (1.0 + np.tanh((y - y0) / l))
+return 0.5 * (1.0 + np.tanh((y - y0) / length))

Committable suggestion was skipped due to low confidence.

🧰 Tools
🪛 Ruff

72-72: Ambiguous variable name: l

(E741)



def check_hier(hier):
for ilvl, lvl in hier.levels().items():
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Rename unused loop variable ilvl to _ to indicate it's unused.

The loop variable ilvl is not used within the loop body. Renaming it to _ improves readability by indicating it's intentionally unused.

Apply this diff:

-for ilvl, lvl in hier.levels().items():
+for _, lvl in hier.levels().items():
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for ilvl, lvl in hier.levels().items():
for _, lvl in hier.levels().items():
🧰 Tools
🪛 Ruff

189-189: Loop control variable ilvl not used within loop body

Rename unused ilvl to _ilvl

(B007)


def post_advance(new_time):
datahier = check_hier(
get_hier("/home/aunai/Documents/code/phare/phare_jobs/run104/diags_master")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid hardcoding absolute file paths for better portability.

Using absolute paths like "/home/aunai/Documents/code/phare/phare_jobs/run104/diags_master" makes the code less portable and harder to maintain. Consider using relative paths or configuration variables.

Apply this diff to use a relative path or a variable:

-get_hier("/home/aunai/Documents/code/phare/phare_jobs/run104/diags_master")
+data_directory = "/path/to/diags_master"  # Define a variable or obtain from configuration
+get_hier(data_directory)

This change enhances portability and maintainability of the code.

Committable suggestion was skipped due to low confidence.

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

🧹 Outside diff range and nitpick comments (1)
tests/simulator/refinement/harris.py (1)

62-139: Add documentation for complex mathematical formulas

The functions density(), bx(), by(), and bz() contain complex mathematical formulas. Consider adding docstrings to explain the physical meaning of these formulas and their parameters.

Here's an example of how you could document the density() function:

def density(x, y):
    """
    Calculate the plasma density distribution.

    This function creates a density profile with two peaks using hyperbolic secant functions.

    Parameters:
    x (float): x-coordinate (not used in this implementation)
    y (float): y-coordinate

    Returns:
    float: Plasma density at the given (x, y) position
    """
    from pyphare.pharein.global_vars import sim

    Ly = sim.simulation_domain()[1]
    return (
        0.4
        + 1.0 / np.cosh((y - Ly * 0.3) / L) ** 2
        + 1.0 / np.cosh((y - Ly * 0.7) / L) ** 2
    )

Consider adding similar documentation for other complex functions.

🧰 Tools
🪛 Ruff

72-72: Ambiguous variable name: l

(E741)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between bdabce6 and 79fadaa.

📒 Files selected for processing (1)
  • tests/simulator/refinement/harris.py (1 hunks)
🧰 Additional context used
🪛 Ruff
tests/simulator/refinement/harris.py

9-9: pyphare.pharein.ParticleDiagnostics imported but unused

Remove unused import: pyphare.pharein.ParticleDiagnostics

(F401)


12-12: pyphare.pharein.MetaDiagnostics imported but unused

Remove unused import: pyphare.pharein.MetaDiagnostics

(F401)


17-17: sys imported but unused

Remove unused import: sys

(F401)


19-19: matplotlib.pyplot imported but unused

Remove unused import: matplotlib.pyplot

(F401)


72-72: Ambiguous variable name: l

(E741)


189-189: Loop control variable ilvl not used within loop body

Rename unused ilvl to _ilvl

(B007)


211-211: Local variable errors is assigned to but never used

Remove assignment to unused variable errors

(F841)

🔇 Additional comments (1)
tests/simulator/refinement/harris.py (1)

1-223: Overall assessment: Well-structured simulation setup with minor improvements needed

The harris.py file implements a comprehensive simulation setup for a Maxwellian fluid model using the PyPhare framework. The code is generally well-structured, with clear separation of concerns between configuration, utility functions, and the main execution flow.

Key strengths:

  1. Detailed configuration of simulation parameters
  2. Complex mathematical models for physical properties
  3. Clear organization of diagnostic setups

Areas for improvement:

  1. Cleanup of unused imports
  2. Better documentation for complex mathematical functions
  3. Minor code clarity improvements in utility functions

Consider addressing these points to enhance the overall quality and maintainability of the code. Additionally, it may be beneficial to add high-level comments explaining the purpose and methodology of the simulation for future readers and maintainers.

🧰 Tools
🪛 Ruff

9-9: pyphare.pharein.ParticleDiagnostics imported but unused

Remove unused import: pyphare.pharein.ParticleDiagnostics

(F401)


12-12: pyphare.pharein.MetaDiagnostics imported but unused

Remove unused import: pyphare.pharein.MetaDiagnostics

(F401)


17-17: sys imported but unused

Remove unused import: sys

(F401)


19-19: matplotlib.pyplot imported but unused

Remove unused import: matplotlib.pyplot

(F401)


72-72: Ambiguous variable name: l

(E741)


189-189: Loop control variable ilvl not used within loop body

Rename unused ilvl to _ilvl

(B007)


211-211: Local variable errors is assigned to but never used

Remove assignment to unused variable errors

(F841)

Comment on lines +188 to +192
def check_hier(hier):
for ilvl, lvl in hier.levels().items():
for patch in lvl.patches:
assert all(patch.box.shape > 5)
return hier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Use underscore for unused loop variable

In the check_hier() function, the loop variable ilvl is not used within the loop body. It's a good practice to use an underscore _ for unused variables to make the intention clear.

Apply this diff to improve code clarity:

-def check_hier(hier):
-    for ilvl, lvl in hier.levels().items():
+def check_hier(hier):
+    for _, lvl in hier.levels().items():
         for patch in lvl.patches:
             assert all(patch.box.shape > 5)
     return hier
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def check_hier(hier):
for ilvl, lvl in hier.levels().items():
for patch in lvl.patches:
assert all(patch.box.shape > 5)
return hier
def check_hier(hier):
for _, lvl in hier.levels().items():
for patch in lvl.patches:
assert all(patch.box.shape > 5)
return hier
🧰 Tools
🪛 Ruff

189-189: Loop control variable ilvl not used within loop body

Rename unused ilvl to _ilvl

(B007)

Comment on lines +208 to +212

def post_advance(new_time):
datahier = check_hier(get_hier("diags_master"))
errors = test.base_test_overlaped_fields_are_equal(datahier, new_time)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove or use the assigned errors variable

In the post_advance() function, the errors variable is assigned but never used. Either remove the assignment or use the variable if it's intended for future use.

If the errors variable is not needed, apply this diff:

 def post_advance(new_time):
     datahier = check_hier(get_hier("diags_master"))
-    errors = test.base_test_overlaped_fields_are_equal(datahier, new_time)
+    test.base_test_overlaped_fields_are_equal(datahier, new_time)

If the errors variable is intended for future use, consider adding a TODO comment explaining its purpose.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def post_advance(new_time):
datahier = check_hier(get_hier("diags_master"))
errors = test.base_test_overlaped_fields_are_equal(datahier, new_time)
def post_advance(new_time):
datahier = check_hier(get_hier("diags_master"))
test.base_test_overlaped_fields_are_equal(datahier, new_time)
🧰 Tools
🪛 Ruff

211-211: Local variable errors is assigned to but never used

Remove assignment to unused variable errors

(F841)

Comment on lines +72 to +73
def S(y, y0, l):
return 0.5 * (1.0 + np.tanh((y - y0) / l))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Rename ambiguous variable for better readability

The variable name l in the S() function is ambiguous and could be confused with the number 1. Consider renaming it to a more descriptive name.

Apply this diff to improve readability:

-def S(y, y0, l):
-    return 0.5 * (1.0 + np.tanh((y - y0) / l))
+def S(y, y0, scale_length):
+    return 0.5 * (1.0 + np.tanh((y - y0) / scale_length))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def S(y, y0, l):
return 0.5 * (1.0 + np.tanh((y - y0) / l))
def S(y, y0, scale_length):
return 0.5 * (1.0 + np.tanh((y - y0) / scale_length))
🧰 Tools
🪛 Ruff

72-72: Ambiguous variable name: l

(E741)

Comment on lines +1 to +27
#!/usr/bin/env python3

import pyphare.pharein as ph # lgtm [py/import-and-import-from]
from pyphare.pharein import Simulation
from pyphare.pharein import MaxwellianFluidModel
from pyphare.pharein import (
ElectromagDiagnostics,
FluidDiagnostics,
ParticleDiagnostics,
InfoDiagnostics,
)
from pyphare.pharein import MetaDiagnostics
from pyphare.pharein import ElectronModel
from pyphare.simulator.simulator import Simulator, startMPI
from pyphare.pharein import global_vars as gv
from pyphare.pharein import LoadBalancer
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from tests.simulator.test_advance import AdvanceTestBase

mpl.use("Agg")
from pyphare.cpp import cpp_lib

cpp = cpp_lib()
startMPI()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Clean up imports and improve consistency

There are several unused imports in the file. Consider removing them to improve code clarity:

  1. Remove the unused import of ParticleDiagnostics (line 9).
  2. Remove the unused import of MetaDiagnostics (line 12).
  3. Remove the unused import of sys (line 17).
  4. Remove the unused import of matplotlib.pyplot as plt (line 19).

Additionally, consider grouping related imports and using a consistent import style throughout the file.

Apply this diff to clean up the imports:

-from pyphare.pharein import (
-    ElectromagDiagnostics,
-    FluidDiagnostics,
-    ParticleDiagnostics,
-    InfoDiagnostics,
-)
-from pyphare.pharein import MetaDiagnostics
+from pyphare.pharein import (
+    ElectromagDiagnostics,
+    FluidDiagnostics,
+    InfoDiagnostics,
+)
 from pyphare.pharein import ElectronModel
 from pyphare.simulator.simulator import Simulator, startMPI
 from pyphare.pharein import global_vars as gv
 from pyphare.pharein import LoadBalancer
-import sys
 import numpy as np
-import matplotlib.pyplot as plt
 import matplotlib as mpl
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#!/usr/bin/env python3
import pyphare.pharein as ph # lgtm [py/import-and-import-from]
from pyphare.pharein import Simulation
from pyphare.pharein import MaxwellianFluidModel
from pyphare.pharein import (
ElectromagDiagnostics,
FluidDiagnostics,
ParticleDiagnostics,
InfoDiagnostics,
)
from pyphare.pharein import MetaDiagnostics
from pyphare.pharein import ElectronModel
from pyphare.simulator.simulator import Simulator, startMPI
from pyphare.pharein import global_vars as gv
from pyphare.pharein import LoadBalancer
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from tests.simulator.test_advance import AdvanceTestBase
mpl.use("Agg")
from pyphare.cpp import cpp_lib
cpp = cpp_lib()
startMPI()
#!/usr/bin/env python3
import pyphare.pharein as ph # lgtm [py/import-and-import-from]
from pyphare.pharein import Simulation
from pyphare.pharein import MaxwellianFluidModel
from pyphare.pharein import (
ElectromagDiagnostics,
FluidDiagnostics,
InfoDiagnostics,
)
from pyphare.pharein import ElectronModel
from pyphare.simulator.simulator import Simulator, startMPI
from pyphare.pharein import global_vars as gv
from pyphare.pharein import LoadBalancer
import numpy as np
import matplotlib as mpl
from tests.simulator.test_advance import AdvanceTestBase
mpl.use("Agg")
from pyphare.cpp import cpp_lib
cpp = cpp_lib()
startMPI()
🧰 Tools
🪛 Ruff

9-9: pyphare.pharein.ParticleDiagnostics imported but unused

Remove unused import: pyphare.pharein.ParticleDiagnostics

(F401)


12-12: pyphare.pharein.MetaDiagnostics imported but unused

Remove unused import: pyphare.pharein.MetaDiagnostics

(F401)


17-17: sys imported but unused

Remove unused import: sys

(F401)


19-19: matplotlib.pyplot imported but unused

Remove unused import: matplotlib.pyplot

(F401)

@PhilipDeegan
Copy link
Member

is this something that should be logged in ISSUES.md, as more of a context dependent thing (i.e. too many cores for too small a problem, or not that)

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