Add documentation for particle properties and usage examples#88
Add documentation for particle properties and usage examples#88
Conversation
There was a problem hiding this comment.
Pull request overview
Adds/updates Python documentation for the particles module, describing particle properties and providing usage examples, and updates the porting-status page to reflect the module’s porting status.
Changes:
- Update the function porting status entry from
particletoparticlesand mark it fully ported. - Add new
docs/python/API/particles.mdpage documenting particle properties and common construction/usage patterns.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| docs/python/function-status.md | Updates particle module name/status in the porting-status table. |
| docs/python/API/particles.md | New API documentation page describing Particle properties and example usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Witold Nieć <witold.niec@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Witold Nieć <witold.niec@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Witold Nieć <witold.niec@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Witold Nieć <witold.niec@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| results_carbon = stp.stopping_power(energies, particle=particle_carbon, material=1) | ||
| ``` | ||
|
|
||
| - Particle code (A*1000 + Z) |
There was a problem hiding this comment.
In the “Particle code” example, the formula is written as (A*1000 + Z), but earlier in this page you define the code as (Z*1000 + A) and the example value 6012 matches Z*1000 + A. Please make the formula consistent here to avoid users passing the wrong identifier.
| - Particle code (A*1000 + Z) | |
| - Particle code (Z*1000 + A) |
| ``` | ||
|
|
||
| - Using atomic number (Z) directly | ||
| ```python |
There was a problem hiding this comment.
This snippet constructs pyamtrack.particles.Particle(6) but doesn’t import pyamtrack.particles within the code block. If the intent is that each snippet is standalone, add the missing import here too.
| ```python | |
| ```python | |
| import pyamtrack.particles |
| ```python | ||
| import pyamtrack.stopping as stp | ||
| from pyamtrack import particles | ||
| particle_carbon = particles.C | ||
| results_carbon = stp.stopping_power(energies, particle=particle_carbon, material=1) | ||
| ``` |
There was a problem hiding this comment.
energies is used in this example but never defined, so the snippet isn’t runnable as-written. Please define energies (e.g., a list or numpy array) within the example code block.
| particle_carbon = "12C" | ||
| results_carbon = stp.stopping_power(energies, particle=particle_carbon, material=1) | ||
| ``` |
There was a problem hiding this comment.
This example also calls stopping_power(energies, ...) but energies isn’t defined within the snippet. Please define it in the block so the example is copy-pastable.
| particle_carbon = 6012 | ||
| results_carbon = stp.stopping_power(energies, particle=particle_carbon, material=1) |
There was a problem hiding this comment.
energies is still undefined in this example, so it won’t run if copied as-is. Please add a definition for energies inside the snippet.
| - **A** (`int`): Mass number | ||
| - **Z** (`float`): Atomic number | ||
| - **I_eV_per_Z** (`float`): Ionization energy per proton | ||
| - **density_g_cm3** (`float`): Density \[g/cm3\] |
There was a problem hiding this comment.
The density unit is written as \[g/cm3\] (and has a trailing space). Other API pages use g/cm³ without escaping; aligning the unit formatting here would improve consistency and readability.
| - **density_g_cm3** (`float`): Density \[g/cm3\] | |
| - **density_g_cm3** (`float`): Density g/cm³ |
No description provided.