add units to summary hyst table - #915
Open
Swanson-Hysell wants to merge 1 commit into
Open
Swanson-Hysell wants to merge 1 commit into
Swanson-Hysell wants to merge 1 commit into
Conversation
These units are inferred from a MagIC contribution or can be specified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #889
The summary table displayed by
rmag.process_hyst_loop/rmag.process_hyst_loopsreported parameter values without units. Column headers now spell them out:Ms (Am²/kg) Mr (Am²/kg) Bc (T) Brh (T) sigma Q Qf chi_HF (m³/kg) FNL60 FNL70 FNL80Parameters that are ratios, logarithms of ratios, or F statistics (
Q,Qf,sigma, theFNLfamily) are dimensionless and stay bare; the closure-test ratios shown at the open-loop decision-tree exit (SNR,HAR) are labeleddB. TheTableColumnfield names are unchanged, so nothing downstream of the display shifts.Changes
_hyst_param_unitand_hyst_param_label, at the top of the hysteresis section ofrockmag.py._show_hyst_summary_tableuses them for its headers, so all three decision-tree outcomes (full processing, linear loop, open loop) are labeled consistently.chi_HFis returned as μ₀·dM/dB, so its unit is the magnetization unit times m/A: Am²/kg → m³/kg, A/m → SI (dimensionless), Am² → m³. An unrecognized magnetization unit leaveschi_HFunlabeled rather than guessing.magn_unitkeyword (at the end of the signature) toprocess_hyst_loop,plot_hyst_loop, andprocess_hyst_loops. It only labels output — no values are converted. Inprocess_hyst_loopsit defaults toNoneand is inferred from the MagIC column name (magn_mass→ Am²/kg,magn_volume→ A/m,magn_moment→ Am²), so the usual call needs no new argument while volume-normalized data is no longer mislabeled as mass-normalized.Returnssections state the unit of each reported quantity.process_hyst_loopsadditionally notes that the returned DataFrame's column names deliberately carry no units, since renaming them would breakadd_hyst_stats_to_specimens_tableand the specimens-table writers._HYST_UNDEFINED_RESULTShad drifted above_show_hyst_summary_table; it is back on the constant it describes.Tests
New
TestSummaryTableUnitsclass inpmagpy/test/test_rockmag_hysteresis.pycovers the unit of each reported parameter, the chi_HF/magnetization-unit relation including the unrecognized-unit fallback, the renderedDataTableheaders (with the field names verified unchanged), and themagn_col→ unit inference in batch processing.All 62 tests in the hysteresis suite pass, as do the curie, unmixing, and FORC suites (303 tests).
🤖 Assisted by Claude Opus 5 in code development.