Skip to content

Add documentation for particle properties and usage examples#88

Open
witNie wants to merge 9 commits intomainfrom
particles-documentation
Open

Add documentation for particle properties and usage examples#88
witNie wants to merge 9 commits intomainfrom
particles-documentation

Conversation

@witNie
Copy link
Copy Markdown

@witNie witNie commented Apr 9, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 particle to particles and mark it fully ported.
  • Add new docs/python/API/particles.md page 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.

Comment thread docs/python/function-status.md Outdated
Comment thread docs/python/API/particles.md Outdated
Comment thread docs/python/API/particles.md
Comment thread docs/python/API/particles.md Outdated
Comment thread docs/python/API/particles.md Outdated
Comment thread docs/python/API/particles.md Outdated
Comment thread docs/python/API/particles.md Outdated
witNie and others added 7 commits April 10, 2026 22:09
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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)
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
- Particle code (A*1000 + Z)
- Particle code (Z*1000 + A)

Copilot uses AI. Check for mistakes.
```

- Using atomic number (Z) directly
```python
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
```python
```python
import pyamtrack.particles

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +57
```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)
```
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +65 to +67
particle_carbon = "12C"
results_carbon = stp.stopping_power(energies, particle=particle_carbon, material=1)
```
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +74 to +75
particle_carbon = 6012
results_carbon = stp.stopping_power(energies, particle=particle_carbon, material=1)
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
- **A** (`int`): Mass number
- **Z** (`float`): Atomic number
- **I_eV_per_Z** (`float`): Ionization energy per proton
- **density_g_cm3** (`float`): Density \[g/cm3\]
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
- **density_g_cm3** (`float`): Density \[g/cm3\]
- **density_g_cm3** (`float`): Density g/cm³

Copilot uses AI. Check for mistakes.
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