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

update documentation #838

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

Conversation

nicolasaunai
Copy link
Member

@nicolasaunai nicolasaunai commented May 20, 2024

Summary by CodeRabbit

  • Documentation

    • Updated copyright year to 2024.
    • Clarified and restructured parameter sections in various functions.
    • Enhanced documentation for running PHARE simulations from Python, including defining a main function and providing code examples.
    • Reordered and removed sections in the documentation index for improved organization and usability, including a new warning note indicating that the documentation is a work in progress.
    • Updated documentation in the level_ghost_boxes function to clarify optional parameters.
    • Introduced documentation for the Maxwellian Fluid Model within the pyphare package.
  • New Features

    • Expanded simulation input capabilities with options for restart and diagnostics.
    • Added detailed descriptions of mandatory and optional parameters in the Simulator class documentation.

Copy link

coderabbitai bot commented May 20, 2024

Walkthrough

Walkthrough

The recent changes across various files in the "PHARE" project enhance documentation clarity, refine parameter descriptions, update copyright information, and improve the organization of usage instructions. These modifications aim to facilitate a better understanding of the project's functionalities and improve usability for users.

Changes

File(s) Change Summary
doc/source/conf.py Updated copyright year from "2018-2023" to "2018-2024." Enhanced Sphinx configuration settings, including autodoc options and pygments style.
doc/source/index.rst Reorganized and removed sections related to usage and development, including the removal of duplicate entries. Added a warning note indicating that the documentation is a work in progress.
doc/source/usage/run_from_python.rst Added new sections and code snippets for running PHARE simulations from Python, including a main function and usage of the Simulator class.
doc/source/usage/simulation_inputs.rst Enhanced documentation for simulation inputs, focusing on Python initialization blocks and including new parameters like restart and diagnostics options.
pyphare/pyphare/pharein/maxwellian_fluid_model.py, pyphare/pyphare/pharein/uniform_model.py Updated documentation for add_population functions to clarify parameter descriptions by changing headers from "Optional Parameters" to "Other Parameters."
pyphare/pyphare/pharesee/geometry.py Clarified the purpose of optional parameters in the level_ghost_boxes function documentation by updating the section header.
pyphare/pyphare/simulator/simulator.py Enhanced documentation for the Simulator class, detailing mandatory and optional parameters for the constructor, and providing a succinct description of the run method.
doc/source/pharesee/get_data.rst Added documentation for the Run class within the pharesee package, including setup instructions for retrieving simulation data.
doc/source/usage/maxwellian_fluid_model.rst Introduced documentation for the "Maxwellian Fluid Model," including a structured overview and details for the MaxwellianFluidModel class.

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

Out of diff range and nitpick comments (1)
pyphare/pyphare/pharein/maxwellian_fluid_model.py (1)

Line range hint 4-4: Remove unused import to clean up the code.

- from pyphare.core.gridlayout import GridLayout, yee_element_is_primal
+ from pyphare.core.gridlayout import GridLayout
Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between fd2bff6 and 09288a8.
Files selected for processing (5)
  • doc/source/conf.py (1 hunks)
  • pyphare/pyphare/core/init.py (2 hunks)
  • pyphare/pyphare/pharein/maxwellian_fluid_model.py (1 hunks)
  • pyphare/pyphare/pharein/uniform_model.py (1 hunks)
  • pyphare/pyphare/pharesee/geometry.py (1 hunks)
Files skipped from review due to trivial changes (2)
  • doc/source/conf.py
  • pyphare/pyphare/pharesee/geometry.py
Additional Context Used
Ruff (1)
pyphare/pyphare/pharein/maxwellian_fluid_model.py (1)

4-4: pyphare.core.gridlayout.yee_element_is_primal imported but unused

Additional comments not posted (4)
pyphare/pyphare/core/__init__.py (2)

22-23: LGTM! Ensure that "PHARE_SKIP_CLI" is consistently used across the project.


41-41: LGTM! Verify that this change does not alter expected CLI behavior in unintended ways.

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

62-67: Documentation update improves clarity and consistency.

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

81-86: Documentation update improves clarity and consistency.

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

Out of diff range and nitpick comments (5)
pyphare/pyphare/pharein/simulation.py (5)

Line range hint 332-332: Replace the comparison to None with is not None for clarity and Pythonic style.

- if (refinement_boxes is None or len(refinement_boxes) == 0)
+ if (refinement_boxes is not None and len(refinement_boxes) != 0)

Line range hint 352-352: The variable name l is ambiguous. Consider renaming it to something more descriptive.

- for l in boxm.refine(box, refinement_ratio).shape:
+ for length in boxm.refine(box, refinement_ratio).shape:

Line range hint 558-558: Remove the f-string as it does not contain placeholders, which makes it unnecessary.

- f"Error: Box({box}) overlaps with Box({cmp_box})"
+ "Error: Box({}) overlaps with Box({})".format(box, cmp_box)
- f"Box({box}) is incompatible with coarser boxes({refined_coarser_boxes}) and nest_buffer({nesting_buffer})"
+ "Box({}) is incompatible with coarser boxes({}) and nest_buffer({})".format(box, refined_coarser_boxes, nesting_buffer)

Also applies to: 566-566


Line range hint 673-673: Use is not None for comparison to None to adhere to Python best practices.

- if kwargs["refinement"] == "boxes":
+ if kwargs["refinement"] is not "boxes":

Line range hint 940-940: Separate the imports onto different lines to improve readability and maintain consistency with Python best practices.

- import dill, codecs
+ import dill
+ import codecs

Also applies to: 946-946

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 09288a8 and a73739c.
Files selected for processing (2)
  • doc/source/usage/simulation_inputs.rst (1 hunks)
  • pyphare/pyphare/pharein/simulation.py (1 hunks)
Additional Context Used
Ruff (7)
pyphare/pyphare/pharein/simulation.py (7)

332-332: Comparison to None should be cond is not None


352-352: Ambiguous variable name: l


558-558: f-string without any placeholders


566-566: f-string without any placeholders


673-673: Comparison to None should be cond is not None


940-940: Multiple imports on one line


946-946: Multiple imports on one line

Additional comments not posted (2)
doc/source/usage/simulation_inputs.rst (1)

71-73: The updated documentation in the Simulation block clearly outlines the additional parameters for restart and diagnostics. This enhances the clarity and usability of the documentation.

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

693-730: The added usage example in the Simulation class is comprehensive and provides clear guidance on setting up a 2D simulation with specific parameters. This is a valuable addition for users to understand the practical application of the class.

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

Out of diff range and nitpick comments (5)
pyphare/pyphare/pharein/simulation.py (5)

Line range hint 332-332: Use is not None for None comparison to follow Python best practices.

- if refinement_boxes is None or len(refinement_boxes) == 0
+ if refinement_boxes is not None and len(refinement_boxes) == 0

Line range hint 352-352: Consider renaming the variable l to something more descriptive to improve code readability.

- for l in boxm.refine(box, refinement_ratio).shape:
+ for length in boxm.refine(box, refinement_ratio).shape:

Line range hint 558-558: Remove unnecessary f-string usage to enhance code clarity.

- raise ValueError(f"Error: Box({box}) overlaps with Box({cmp_box})")
+ raise ValueError("Error: Box overlaps with Box")
- raise ValueError(f"Error: Box({box}) is incompatible with coarser boxes({refined_coarser_boxes}) and nest_buffer({nesting_buffer})")
+ raise ValueError("Error: Box is incompatible with coarser boxes and nest_buffer")

Also applies to: 566-566


Line range hint 673-673: Use is not None for None comparison to follow Python best practices.

- if restart_options is None:
+ if restart_options is not None:

Line range hint 979-979: Split multiple imports into separate lines to conform to PEP 8 style guidelines.

- import dill, codecs
+ import dill
+ import codecs
- import dill, codecs
+ import dill
+ import codecs

Also applies to: 985-985

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between a73739c and 582e25b.
Files selected for processing (1)
  • pyphare/pyphare/pharein/simulation.py (3 hunks)
Additional Context Used
Ruff (7)
pyphare/pyphare/pharein/simulation.py (7)

332-332: Comparison to None should be cond is not None


352-352: Ambiguous variable name: l


558-558: f-string without any placeholders


566-566: f-string without any placeholders


673-673: Comparison to None should be cond is not None


979-979: Multiple imports on one line


985-985: Multiple imports on one line

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 582e25b and 8619219.
Files selected for processing (5)
  • doc/source/conf.py (2 hunks)
  • doc/source/index.rst (2 hunks)
  • doc/source/usage/run_from_python.rst (1 hunks)
  • doc/source/usage/simulation_inputs.rst (1 hunks)
  • pyphare/pyphare/pharein/simulation.py (5 hunks)
Files skipped from review due to trivial changes (1)
  • doc/source/usage/run_from_python.rst
Files skipped from review as they are similar to previous changes (2)
  • doc/source/conf.py
  • doc/source/usage/simulation_inputs.rst
Additional Context Used
Ruff (7)
pyphare/pyphare/pharein/simulation.py (7)

332-332: Comparison to None should be cond is not None


352-352: Ambiguous variable name: l


558-558: f-string without any placeholders


566-566: f-string without any placeholders


673-673: Comparison to None should be cond is not None


1038-1038: Multiple imports on one line


1045-1045: Multiple imports on one line

Additional comments not posted (2)
doc/source/index.rst (1)

79-79: Reordered sections to prioritize 'simulation_inputs' over 'run_from_python'.

This change should help users find simulation input information more quickly, which is often more critical at the initial stages of learning the software.

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

693-893: Updated the Simulation class documentation with detailed usage examples and explanations.

This enhancement is valuable for users, providing clear examples and detailed parameter descriptions which will likely reduce setup errors and improve user experience.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Out of diff range and nitpick comments (8)
doc/source/usage/run_from_python.rst (1)

40-40: Clarify the purpose of the simulation_inputs document in the context of running the simulation.

pyphare/pyphare/simulator/simulator.py (2)

Line range hint 106-106: Replace bare except with specific exceptions to avoid catching unintended errors.

- except:
+ except Exception as e:

Also applies to: 129-129


Line range hint 161-161: Use is not None for None comparison to follow Python best practices.

- if self.cpp_sim != None:
+ if self.cpp_sim is not None:
pyphare/pyphare/pharein/maxwellian_fluid_model.py (1)

Line range hint 4-4: Remove unused import to clean up the code.

- from pyphare.core.gridlayout import yee_element_is_primal
pyphare/pyphare/pharein/simulation.py (4)

Line range hint 332-332: Use is not None for None comparison to improve readability and Pythonic style.

- if refinement_boxes is None or len(refinement_boxes) == 0
+ if refinement_boxes is not None and len(refinement_boxes) != 0

Line range hint 352-352: Consider renaming variable l to length to improve readability.

- for l in boxm.refine(box, refinement_ratio).shape:
+ for length in boxm.refine(box, refinement_ratio).shape:

Line range hint 558-558: Remove unnecessary f-string usage to enhance code efficiency.

- raise ValueError(f"Error: Box({box}) overlaps with Box({cmp_box})")
+ raise ValueError("Error: Box({}) overlaps with Box({})".format(box, cmp_box))

- raise ValueError(f"Box({box}) is incompatible with coarser boxes({refined_coarser_boxes}) and nest_buffer({nesting_buffer})")
+ raise ValueError("Box({}) is incompatible with coarser boxes({}) and nest_buffer({})".format(box, refined_coarser_boxes, nesting_buffer))

Also applies to: 566-566


Line range hint 673-673: Use is not None for None comparison to improve readability and Pythonic style.

- if sim.restart_options is not None:
+ if sim.restart_options is not None:
Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8619219 and 24314d2.
Files selected for processing (10)
  • doc/source/conf.py (2 hunks)
  • doc/source/index.rst (2 hunks)
  • doc/source/usage/run_from_python.rst (1 hunks)
  • doc/source/usage/simulation_inputs.rst (2 hunks)
  • pyphare/pyphare/core/init.py (2 hunks)
  • pyphare/pyphare/pharein/maxwellian_fluid_model.py (1 hunks)
  • pyphare/pyphare/pharein/simulation.py (5 hunks)
  • pyphare/pyphare/pharein/uniform_model.py (1 hunks)
  • pyphare/pyphare/pharesee/geometry.py (1 hunks)
  • pyphare/pyphare/simulator/simulator.py (2 hunks)
Files skipped from review as they are similar to previous changes (6)
  • doc/source/conf.py
  • doc/source/index.rst
  • doc/source/usage/simulation_inputs.rst
  • pyphare/pyphare/core/init.py
  • pyphare/pyphare/pharein/uniform_model.py
  • pyphare/pyphare/pharesee/geometry.py
Additional Context Used
Ruff (11)
pyphare/pyphare/pharein/maxwellian_fluid_model.py (1)

4-4: pyphare.core.gridlayout.yee_element_is_primal imported but unused

pyphare/pyphare/pharein/simulation.py (7)

332-332: Comparison to None should be cond is not None


352-352: Ambiguous variable name: l


558-558: f-string without any placeholders


566-566: f-string without any placeholders


673-673: Comparison to None should be cond is not None


1035-1035: Multiple imports on one line


1042-1042: Multiple imports on one line

pyphare/pyphare/simulator/simulator.py (3)

106-106: Do not use bare except


129-129: Do not use bare except


161-161: Comparison to None should be cond is not None

Additional comments not posted (2)
pyphare/pyphare/simulator/simulator.py (1)

40-56: Ensure the documentation accurately reflects the functionality and usage of the optional expert arguments.

Verification successful

The documentation for the optional expert arguments auto_dump, post_advance, and log_to_file in the Simulator class is accurate and matches their usage in the codebase.

  • auto_dump is used in pyphare/pyphare/simulator/simulator.py and tests/simulator/test_restarts.py.
  • post_advance is used in pyphare/pyphare/simulator/simulator.py and several test files.
  • log_to_file is used in pyphare/pyphare/simulator/simulator.py and tools/ctest_exec_mp.py.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the documentation of optional expert arguments in the Simulator class.

# Test: Search for the usage of these arguments in the codebase. Expect: Usage should match the documentation.
rg --type python $'auto_dump|post_advance|log_to_file'

Length of output: 86



Script:

#!/bin/bash
# Description: Verify the documentation of optional expert arguments in the Simulator class.

# Test: Search for the usage of these arguments in the codebase. Expect: Usage should match the documentation.
rg 'auto_dump|post_advance|log_to_file'

Length of output: 2567

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

81-86: Ensure the updated documentation for the add_population method is clear and accurate.

Verification successful

The search results indicate that the parameters charge, nbrPartCell, density, vbulk, beta, and anisotropy are indeed used throughout the codebase, particularly in the context of defining species properties in various simulation setups and tests. This confirms that the updated documentation for the add_population method is consistent with the actual usage of these parameters.

  • The parameters are used in multiple files, including maxwellian_fluid_model.py, uniform_model.py, and various test and functional files.
  • The parameters are consistently defined and utilized in the context of species properties, matching the documentation provided.

Therefore, the updated documentation for the add_population method is clear and accurate.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accuracy of the updated documentation for the add_population method.

# Test: Search for the usage of the parameters in the codebase. Expect: Usage should match the documentation.
rg --type python $'charge|nbrPartCell|density|vbulk|beta|anisotropy'

Length of output: 100



Script:

#!/bin/bash
# Description: Verify the accuracy of the updated documentation for the add_population method.

# Test: Search for the usage of the parameters in the codebase. Expect: Usage should match the documentation.
rg --type py 'charge|nbrPartCell|density|vbulk|beta|anisotropy'

Length of output: 26993

doc/source/usage/run_from_python.rst Outdated Show resolved Hide resolved
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: 1

Outside diff range and nitpick comments (7)
pyphare/pyphare/simulator/simulator.py (3)

Line range hint 106-106: Avoid using bare except statements. Specify exception types to improve error handling.

- except:
+ except Exception as e:

Line range hint 129-129: Specify exception types in the except block to enhance clarity and maintainability.

- except:
+ except Exception as e:

Line range hint 161-161: Use is not None for comparisons to None to follow Python best practices.

- if self.cpp_sim != None:
+ if self.cpp_sim is not None:
pyphare/pyphare/pharein/simulation.py (4)

Line range hint 332-332: Use is not None for None comparison to improve readability and Pythonic style.

- if (refinement_boxes is None or len(refinement_boxes) == 0)
+ if (refinement_boxes is not None and len(refinement_boxes) != 0)

Line range hint 352-352: Consider renaming variable l to length to improve readability.


Line range hint 558-558: Remove unnecessary f-string usage to enhance code efficiency.

- f"Error: Box({box}) overlaps with Box({cmp_box})"
+ "Error: Box({}) overlaps with Box({})".format(box, cmp_box)

- f"Error: Box({box}) is incompatible with coarser boxes({refined_coarser_boxes}) and nest_buffer({nesting_buffer})"
+ "Error: Box({}) is incompatible with coarser boxes({}) and nest_buffer({})".format(box, refined_coarser_boxes, nesting_buffer)

Also applies to: 566-566


Line range hint 673-673: Use is not None for None comparison to improve readability and Pythonic style.

- if sim.restart_options is not None
+ if sim.restart_options is not None
Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 24314d2 and 689a145.
Files selected for processing (11)
  • doc/source/conf.py (3 hunks)
  • doc/source/index.rst (2 hunks)
  • doc/source/usage/maxwellian_fluid_model.rst (1 hunks)
  • doc/source/usage/run_from_python.rst (1 hunks)
  • doc/source/usage/simulation_inputs.rst (2 hunks)
  • pyphare/pyphare/core/init.py (2 hunks)
  • pyphare/pyphare/pharein/maxwellian_fluid_model.py (2 hunks)
  • pyphare/pyphare/pharein/simulation.py (5 hunks)
  • pyphare/pyphare/pharein/uniform_model.py (1 hunks)
  • pyphare/pyphare/pharesee/geometry.py (1 hunks)
  • pyphare/pyphare/simulator/simulator.py (2 hunks)
Files skipped from review due to trivial changes (1)
  • doc/source/usage/maxwellian_fluid_model.rst
Files skipped from review as they are similar to previous changes (6)
  • doc/source/conf.py
  • doc/source/index.rst
  • doc/source/usage/run_from_python.rst
  • pyphare/pyphare/core/init.py
  • pyphare/pyphare/pharein/uniform_model.py
  • pyphare/pyphare/pharesee/geometry.py
Additional Context Used
Ruff (11)
pyphare/pyphare/pharein/maxwellian_fluid_model.py (1)

4-4: pyphare.core.gridlayout.yee_element_is_primal imported but unused

pyphare/pyphare/pharein/simulation.py (7)

332-332: Comparison to None should be cond is not None


352-352: Ambiguous variable name: l


558-558: f-string without any placeholders


566-566: f-string without any placeholders


673-673: Comparison to None should be cond is not None


1035-1035: Multiple imports on one line


1042-1042: Multiple imports on one line

pyphare/pyphare/simulator/simulator.py (3)

106-106: Do not use bare except


129-129: Do not use bare except


161-161: Comparison to None should be cond is not None

Additional comments not posted (6)
pyphare/pyphare/simulator/simulator.py (2)

40-56: The class documentation is clear and informative, providing good defaults for optional arguments.


57-57: The initialization of the Simulator class is well-handled with appropriate defaults and assertions.

doc/source/usage/simulation_inputs.rst (1)

Line range hint 8-328: The documentation in simulation_inputs.rst is comprehensive and well-structured, providing clear examples and descriptions of simulation inputs.

pyphare/pyphare/pharein/maxwellian_fluid_model.py (3)

9-49: The class documentation for MaxwellianFluidModel is clear and provides useful examples and parameter descriptions.


50-50: The initialization method of MaxwellianFluidModel is robust, ensuring that no other models are declared before proceeding.


123-123: The add_population method is well-implemented, handling default values and checking for invalid arguments effectively.

pyphare/pyphare/pharein/simulation.py Outdated Show resolved Hide resolved
@nicolasaunai nicolasaunai marked this pull request as draft May 22, 2024 17:05
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: 1

Outside diff range, codebase verification and nitpick comments (7)
doc/source/pharesee/get_data.rst (5)

9-10: Clarify the PYTHONPATH setting instructions.

The instruction "Make your PYTHONPATH includes the directory where pyphare is located." should be clarified for better readability.

- Make your `PYTHONPATH` includes the directory where `pyphare` is located.
+ Ensure your `PYTHONPATH` includes the directory where `pyphare` is located.

17-17: Fix grammatical error.

The sentence "Then import the pharesee package should work:" is grammatically incorrect.

- Then import the `pharesee` package should work:
+ Then importing the `pharesee` package should work:

28-29: Correct minor typographical error.

The phrase "for which ElectromagDianostics have been activated" should be corrected.

- for which `ElectromagDianostics` have been activated
+ for which `ElectromagDiagnostics` have been activated

36-37: Improve readability.

The sentence "The first step to get the data is to create a Run object, that basically represents your simulation and will let you interact with its data." can be made more concise.

- The first step to get the data is to create a `Run` object, that basically represents your simulation and will let you interact with its data.
+ The first step to get the data is to create a `Run` object, which represents your simulation and allows you to interact with its data.

57-57: Fix typographical error.

The phrase "where XXX is the name of a physical quantity available from pharesee" should be corrected.

- where `XXX` is the name of a physical quantity available from `pharesee`, 
+ where `XXX` is the name of a physical quantity available from `pharesee`
doc/source/usage/run_from_python.rst (2)

Line range hint 11-11: Fix typographical error.

The word "minimmum" should be corrected to "minimum".

- PHARE requires a minimmum version of python 3.8 to run properly.
+ PHARE requires a minimum version of python 3.8 to run properly.

56-56: Fix typographical error.

The word "Heere" should be corrected to "Here".

- Heere is a small example:
+ Here is a small example:
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 689a145 and 980c18a.

Files selected for processing (11)
  • doc/source/conf.py (3 hunks)
  • doc/source/index.rst (2 hunks)
  • doc/source/pharesee/get_data.rst (1 hunks)
  • doc/source/usage/maxwellian_fluid_model.rst (1 hunks)
  • doc/source/usage/run_from_python.rst (1 hunks)
  • doc/source/usage/simulation_inputs.rst (2 hunks)
  • pyphare/pyphare/pharein/maxwellian_fluid_model.py (2 hunks)
  • pyphare/pyphare/pharein/simulation.py (6 hunks)
  • pyphare/pyphare/pharein/uniform_model.py (1 hunks)
  • pyphare/pyphare/pharesee/geometry.py (1 hunks)
  • pyphare/pyphare/simulator/simulator.py (2 hunks)
Files skipped from review due to trivial changes (4)
  • doc/source/index.rst
  • doc/source/usage/maxwellian_fluid_model.rst
  • pyphare/pyphare/pharein/uniform_model.py
  • pyphare/pyphare/pharesee/geometry.py
Additional comments not posted (22)
doc/source/usage/run_from_python.rst (1)

33-33: Use correct paths for PYTHONPATH setting.

The placeholder paths (/path/to/PHARE/pyphare and /path/to/build) should be updated to reflect the actual paths used in the project.

doc/source/conf.py (3)

24-24: Update copyright year.

The copyright year has been updated from 2023 to 2024.


52-54: Ensure consistency in the list of Sphinx extensions.

The sphinxcontrib.apidoc and numpydoc extensions have been commented out. Ensure that this change is intentional and documented.


113-114: Set pygments_style explicitly.

The pygments_style option has been explicitly set to "sphinx" for syntax highlighting.

pyphare/pyphare/simulator/simulator.py (2)

61-77: Improved docstring for __init__ method.

The expanded docstring provides clear descriptions of mandatory and optional parameters, enhancing the usability and understanding of the constructor.


192-194: Added docstring for run method.

The new docstring succinctly states the purpose of the method, enhancing the clarity of the code.

doc/source/usage/simulation_inputs.rst (6)

8-13: Enhanced section on Python initialization blocks.

The renaming and expansion of this section improve clarity and emphasize the initialization process using Python objects.


75-77: Updated Simulation block section.

The inclusion of additional parameters like restart and diagnostics options enhances the user's ability to configure simulations comprehensively.


86-125: Expanded section on Magnetic field and ions.

The detailed examples and explanations for initializing ion populations and magnetic fields improve the clarity and usability of the documentation.


211-222: Added ElectronModel section.

The new section specifying the electron fluid properties is crucial for users needing to configure electron dynamics in their simulations.


228-234: Expanded Diagnostics section.

The detailed explanations and examples for different types of diagnostics blocks improve the clarity and usability of the documentation.


240-261: Added Electromagnetic Diagnostics subsection.

The detailed explanations and examples for electromagnetic diagnostics enhance the user's understanding of configuring these diagnostics.

pyphare/pyphare/pharein/maxwellian_fluid_model.py (2)

9-49: Added detailed docstring for MaxwellianFluidModel class.

The comprehensive usage examples and parameter descriptions improve the documentation quality, making it easier for users to understand how to instantiate and utilize the class effectively.


127-132: Refined documentation headers for add_population method.

The refined headers enhance clarity and contribute to a more structured presentation of the method's documentation.

pyphare/pyphare/pharein/simulation.py (8)

702-899: Enhanced documentation for Simulation class looks good.

The detailed usage examples and structured documentation improve clarity and usability.


976-980: Private method add_diagnostics documentation looks good.

The :meta private: tag correctly indicates internal use.


997-1000: Private method is_restartable_compared_to documentation looks good.

The :meta private: tag correctly indicates internal use.


1009-1012: Private method count_diagnostics documentation looks good.

The :meta private: tag correctly indicates internal use.


1024-1027: Private method set_model documentation looks good.

The :meta private: tag correctly indicates internal use.


1031-1034: Private method set_electrons documentation looks good.

The :meta private: tag correctly indicates internal use.


1042-1045: Private method serialize documentation looks good.

The :meta private: tag correctly indicates internal use.


1054-1055: Private method deserialize documentation looks good.

The :meta private: tag correctly indicates internal use.

doc/source/pharesee/get_data.rst Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 980c18a and 353398e.

Files selected for processing (1)
  • doc/source/index.rst (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • doc/source/index.rst

@nicolasaunai nicolasaunai marked this pull request as ready for review August 3, 2024 19:34
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: 1

Outside diff range, codebase verification and nitpick comments (1)
doc/source/usage/run_from_python.rst (1)

56-56: Add context to the example code.

The example code should include more context about the simulation parameters and initial conditions to be more helpful to users.

- # define your simulation parameters
- # and initial condition...
+ # Define your simulation parameters
+ # and initial conditions here.
+ # Example:
+ # sim = Simulation(
+ #     domain_size=100,
+ #     cells_per_unit=10,
+ #     timestep=0.1,
+ #     total_time=10.0
+ # )
+ # MaxwellianFluidModel(
+ #     density=1.0,
+ #     temperature=1.0,
+ #     velocity=0.0
+ # )
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 353398e and 57daf27.

Files selected for processing (1)
  • doc/source/usage/run_from_python.rst (1 hunks)
Additional comments not posted (1)
doc/source/usage/run_from_python.rst (1)

56-56: Typographical error: "minimmum" should be corrected to "minimum".

There is a typographical error in the word "minimmum".

- PHARE requires a minimmum version of python 3.8 to run properly.
+ PHARE requires a minimum version of python 3.8 to run properly.

Likely invalid or redundant comment.

@@ -30,18 +30,66 @@ Running PHARE
-------------
First, make sure it is accessible to python.
Assuming PHARE source directory is in `/path/to/PHARE`, and the build directory is
`/path/to/build/`, then use the following to let python know where to find PHARE:
`/path/to/build/`, then use the following to let python know where to find PHARE:
Copy link

Choose a reason for hiding this comment

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

Update the PYTHONPATH setting to use actual paths.

The placeholder paths /path/to/PHARE/pyphare and /path/to/build should be updated to ${PWD}/build and ${PWD}/pyphare to reflect the actual paths used in the project.

- export PYTHONPATH=/path/to/PHARE/pyphare:/path/to/build:$PYTHONPATH
+ export PYTHONPATH=${PWD}/pyphare:${PWD}/build:$PYTHONPATH
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
`/path/to/build/`, then use the following to let python know where to find PHARE:
`/path/to/build/`, then use the following to let python know where to find PHARE:
export PYTHONPATH=${PWD}/pyphare:${PWD}/build:$PYTHONPATH

"sphinx.ext.viewcode",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.autosectionlabel",
"sphinx_gallery.load_style",
"sphinx_codeautolink",
"sphinxcontrib.apidoc",
# "sphinxcontrib.apidoc",
Copy link
Member

Choose a reason for hiding this comment

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

torm or tokeep?

Copy link
Member

@PhilipDeegan PhilipDeegan left a comment

Choose a reason for hiding this comment

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

conflicts and some commented out code to rm

@nicolasaunai nicolasaunai requested a review from UCaromel October 18, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants