Cleanout v1p0 flatparams diffstarpop flatparams - #96
Merged
Conversation
Almost all tests pass, except for 4 that are all due to the fact that namedtuple_utils_mgash.py has not yet been updated. I have a (strong) hunch that we can entirely delete the whole pytree registration altogether. I tried to do something more passive than that, and just modify the code so that the flattening is trivial. But I failed to do that on my first try, and it wasn't clear how to resolve. @alexalar I am not so sure how to fix this because I have never used the pytree registry. You may be able to resolve these last lingering failures (much) more quickly than me. Could you take a look? If not, I can try to resolve.
…an older version wrt to diffstarpop/loss_kernels/mstar_ssfr_loss_mgash_anyz.py
…the flattened Diffstarpop params
This was referenced Oct 1, 2025
Contributor
Author
|
Proceeding to merge this into |
Merged
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.
This PR updates the repo for the
v1.0.0release of diffstar. Changes summarized below:diffstarhas changed from the model introduced in Alarcon+22. There is no longer a convolution kernel between the gas mass accretion and the gas consumption timescale, anddMstar/dtis no longer proportional todMhalo/dt, but is instead proportional toMhalo(t)via a newly formulated star formation efficiency function. The new formulation improves the flexibility of the model, and dramatically improves performance (see figure below). Further information about the new model formulation will be summarized in a forthcoming paper, Alarcon+25, in prep.diffstarare now encoded as a flat namedtuple with 8 entries. This is distinct from the original formulation of the parameters, which were encoded as a nested namedtuple,diffstar_params.ms_paramsanddiffstar_params.q_params, each of which had 4 parameters.diffstarpop, which brings in a population-level model of SFHs. Thediffstarpopmodel was previously developed in a separate repo, ArgonneCPAC/diffstarpop, which is now deprecated. The parameters ofdiffstarpopare now formulated as a flat namedtuple.The figure below shows results from a simple timing test I ran on a single CPU on my laptop. The upshot is that there is a 10x memory footprint reduction, and additionally, 10x per-galaxy speedup.