Conversation
aad5ff0 to
03be7fa
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4148 +/- ##
==========================================
+ Coverage 49.63% 49.69% +0.06%
==========================================
Files 148 148
Lines 29746 30098 +352
==========================================
+ Hits 14764 14957 +193
- Misses 14982 15141 +159 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds additional detailed physics outputs for collisions (times/frequencies/mean free paths), Spitzer slowing-down time, and Spitzer resistivity, and exposes them through unit tests, MFILE output, and summary plotting.
Changes:
- Compute and output new collision-related profiles plus Spitzer slowing-down time and Spitzer resistivity in
DetailedPhysics.run()/output_detailed_physics(). - Extend the physics variable data structure and initialization to include the new profiles.
- Add plotting helpers and extra summary pages to visualize the new profiles; extend the detailed-physics unit test to assert the new outputs are finite and correctly shaped.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/test_physics.py |
Adds assertions for the new detailed-physics profiles. |
process/models/physics/physics.py |
Computes new collision/resistivity/slowing-down profiles; outputs them to MFILE. |
process/data_structure/physics_variables.py |
Adds new profile variables and initializes them. |
process/core/io/plot/summary.py |
Adds plots for new profiles and adjusts summary pagination/layout. |
documentation/source/physics-models/detailed_physics.md |
Documents new formulas for the added detailed-physics quantities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
|
|
||
| # ============================ | ||
| # Resistivites |
There was a problem hiding this comment.
Section header comment has a typo ("Resistivites"). Please correct to "Resistivities" for consistency and readability.
| # Resistivites | |
| # Resistivities |
| physics_variables.res_plasma_fuel_spitzer_profile = self.calculate_spitzer_resistivity( | ||
| n_charge=1, | ||
| electron_ion_coulomb_log=physics_variables.plasma_coulomb_log_electron_deuteron_profile, | ||
| temp_plasma_electron_kev=self.plasma_profile.teprofile.profile_y, | ||
| ) |
There was a problem hiding this comment.
Spitzer resistivity is being stored in res_plasma_fuel_spitzer_profile, but the data structure also introduces rho_plasma_spitzer_classical_profile (which remains unused). Please align naming/usage (e.g., populate the newly-added *_spitzer_classical_profile, or remove/rename it) so there is a single canonical variable for the Spitzer resistivity profile.
| physics_variables.res_plasma_fuel_spitzer_profile = self.calculate_spitzer_resistivity( | |
| n_charge=1, | |
| electron_ion_coulomb_log=physics_variables.plasma_coulomb_log_electron_deuteron_profile, | |
| temp_plasma_electron_kev=self.plasma_profile.teprofile.profile_y, | |
| ) | |
| physics_variables.rho_plasma_spitzer_classical_profile = self.calculate_spitzer_resistivity( | |
| n_charge=1, | |
| electron_ion_coulomb_log=physics_variables.plasma_coulomb_log_electron_deuteron_profile, | |
| temp_plasma_electron_kev=self.plasma_profile.teprofile.profile_y, | |
| ) | |
| physics_variables.res_plasma_fuel_spitzer_profile = ( | |
| physics_variables.rho_plasma_spitzer_classical_profile | |
| ) |
| scan : | ||
| axis : plt.Axes | ||
| Axis object to plot on | ||
| mfile_data : mf.MFile |
There was a problem hiding this comment.
Docstring parameter type refers to mf.MFile, but mf is not imported and the function signature uses MFile. Update the docstring type to MFile for accuracy.
| mfile_data : mf.MFile | |
| mfile_data : MFile |
| axis : plt.Axes | ||
| Axis object to plot on | ||
| mfile_data : mf.MFile | ||
| MFILE data object | ||
| scan : int | ||
| Scan number to use |
There was a problem hiding this comment.
Docstring parameter type refers to mf.MFile, but mf is not imported and the function signature uses MFile. Update the docstring type to MFile for accuracy.
| """Plot the plasma coloumb logarithms on the given axis. | ||
|
|
There was a problem hiding this comment.
Function name and docstring use the misspelling "coloumb". Consider renaming to "coulomb" (keeping a backward-compatible alias if needed) and correcting the docstring text to avoid propagating the typo.
| """Plot the plasma coloumb logarithms on the given axis. | |
| """Backward-compatible alias for plotting plasma Coulomb logarithms.""" | |
| return plot_plasma_coulomb_logarithms(axis, mfile_data, scan) | |
| def plot_plasma_coulomb_logarithms(axis: plt.Axes, mfile_data: MFile, scan: int) -> None: | |
| """Plot the plasma Coulomb logarithms on the given axis. |
je-cook
left a comment
There was a problem hiding this comment.
Mostly minors on top of my docstring one from before. I havent looked into the maths. I assume your tests cover the results of the calculations, if not we need a test for that
…anization and maintainability
… and profiles to DetailedPhysics class
… DetailedPhysics class
…eron, electron-triton, and electron-alpha interactions in plasma
…ctions in DetailedPhysics class
…s in DetailedPhysics class
…ons, and alpha particles
…ron, electron-triton, deuteron-triton, and electron-alpha interactions
…ity profile plots
…, electron-deuteron, electron-triton, and electron-alpha interactions
…ctron, electron-deuteron, electron-triton, and electron-alpha interactions
…, electron-deuteron, electron-triton, and electron-alpha interactions
…s for electrons, deuterons, and tritons
77f37c3 to
0e12fc7
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…lify docstrings and improve readability
…g box styles for improved readability
This pull request adds several new plasma physics variables to the
physics_variables.pydata structure, primarily focused on collision times, collision frequencies, mean free paths, and resistivity profiles for various plasma species. These additions enhance the granularity and detail of plasma modeling, especially for electron interactions with deuterons, tritons, and alpha particles.New plasma variable additions:
Added profiles for Spitzer classical resistivity, electron-alpha Spitzer slowing down time, and various collision times, collision frequencies, and mean free paths between electrons and other plasma species (deuterons, tritons, alpha particles) to the data structure (
process/data_structure/physics_variables.py).Initialization updates:
Updated the
init_physics_variablesfunction to include initialization and zeroing of the new plasma variable profiles and to ensure these new variables are properly set up as empty lists or default values (process/data_structure/physics_variables.py).Checklist
I confirm that I have completed the following checks: