Add ThermoResult object for streamlined thermo-abundance workflow#19
Open
Add ThermoResult object for streamlined thermo-abundance workflow#19
Conversation
Closes #14 - Add ThermoResult NamedTuple to linx/thermo.py containing all thermo outputs plus T_start/T_end used for integration - BackgroundModel now returns ThermoResult instead of plain tuple - AbundanceModel accepts ThermoResult directly with automatic temperature range detection from the thermo result - Maintains backward compatibility via tuple unpacking (use [:7] slice) Usage: # New streamlined API thermo_result = BackgroundModel()(0.) abundances = AbundanceModel(nuclear_net)(thermo_result) # Backward compatible t, a, rho_g, rho_nu, rho_extra, P_extra, Neff = thermo_model(0.)[:7] Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
|
Thanks for putting this together--I'm going to hold off on this one because it requires us to also update the example notebooks, and I want to play with it a bit in some different contexts before pulling the trigger on this switch. I'm a little backed up trying to get the stuff on cara/me-hardcode integrated in and waiting for a response on jax-ml/jax#33666, once I clear that away I'll come back to this |
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.
Summary
Closes #14
BackgroundModelnow returns aThermoResultNamedTuple thatAbundanceModelcan accept directly, with automatic temperature range detection.Changes
ThermoResultNamedTuple tolinx/thermo.pycontaining all thermo outputs plusT_start/T_endBackgroundModelreturnsThermoResultinstead of plain tupleAbundanceModelaccepts either:ThermoResultobject (auto-extracts all values including T_start/T_end)Usage
Test plan
🤖 Generated with Claude Code