♻️ Refactor some radiation methods for clarity#4219
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4219 +/- ##
==========================================
- Coverage 48.86% 48.86% -0.01%
==========================================
Files 151 151
Lines 29461 29431 -30
==========================================
- Hits 14397 14382 -15
+ Misses 15064 15049 -15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
439cbc9 to
4c7c3ce
Compare
…nd improve comments Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…sity` for clarity
…n imprad_profile method Co-authored-by: Copilot <copilot@github.com>
…` for clarity and update references
…p_compiled` for clarity
… accuracy in parameter types and documentation Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…mathematical notation Co-authored-by: Copilot <copilot@github.com>
…ions Co-authored-by: Copilot <copilot@github.com>
…y and update related tests
03ddd71 to
e4e975a
Compare
…ty and update related calculations
|
|
||
| @njit(cache=True) | ||
| def _zav_of_te_compiled( | ||
| def calculate_average_charge_at_temp_compiled( |
There was a problem hiding this comment.
| def calculate_average_charge_at_temp_compiled( | |
| def _calculate_average_charge_at_temp_compiled( |
I would prefer to keep this hidden
| indices = np.digitize(temp_electron_kev, bins) | ||
| indices[indices >= bins.shape[0]] = bins.shape[0] - 1 |
There was a problem hiding this comment.
temp_electron_kev is typed as allowed to be a float but this function would fail here because indices will be a np.int64 which you cannot do item assignment to
| nd_electron_profile: np.array | float, | ||
| temp_electron_profile_kev: np.array | float, |
There was a problem hiding this comment.
Again, I don't think these will work as floats because indexing wont work
| def z2index(zimp, data: DataStructure) -> int: | ||
| for i in range(len(data.impurity_radiation.impurity_arr_label)): | ||
| if zimp == data.impurity_radiation.impurity_arr_z[i]: | ||
| return i | ||
|
|
||
| # Should only get here if there is a problem | ||
| raise ProcessValueError( | ||
| "Element with the given charge is not in the impurity array", zimp=zimp | ||
| ) |
There was a problem hiding this comment.
I can't see this function being used anywhere
|
|
||
| Parameters | ||
| ---------- | ||
| imp_element_index |
There was a problem hiding this comment.
There are : missing in the docstrings added by this PR. E.g.
| imp_element_index | |
| imp_element_index: |
Description
Checklist
I confirm that I have completed the following checks: