Skip to content

New compas debugging_utils file - #1467

Merged
ilyamandel merged 3985 commits into
devfrom
compas_post_processing_utils
Aug 26, 2026
Merged

ilyamandel merged 3985 commits into
devfrom
compas_post_processing_utils

Conversation

@reinhold-willcox

Copy link
Copy Markdown
Collaborator

Added my own compasUtils file, which I use for lots of post-processing and testing. It was previously in misc/unsupported_utils, so I am hoping to get it elevated to the level of the other utils.

This contains two major functions that help a lot with inspecting COMPAS data.

  • printCompasDetails: takes the hdf5 output (optionally with specific seeds or masks) and prints a pandas df of the whole output (including units). Makes it visually much easier to analyze the output from a jupyter notebook.
  • getEventStrings: takes the hdf5 output and generates a string per seed that summarizes the events in the binary. Events include SMT, CEE, SNe, and mergers, and these are listed chronologically with a funny but simple syntax (described in the function). Combined with np.unique(), this is a great way to quickly see which binary channels dominate and which are rare.

I expect that there will be changes requested, so it is probably not yet ready to be merged in, but happy to hear feedback on how to improve / align these scripts with the other python utilities.

reinhold-willcox and others added 30 commits June 30, 2025 09:37
Enhancements- deprecated MERRITT2024 in favour of , plus others
03.22.00: fixes to nuclear timescale mass transfer, new 2-stage CE options, etc:

Changed default values of --enhance-CHE-lifetimes-luminosities and --scale-CHE-mass-loss-with-surface-helium-abundance to true
Added options to set beta and gamma prescription for second stage of 2-stage CE (--common-envelope-second-stage-beta, --common-envelope-second-stage-gamma-prescription)
Fixed a bug in CalculateZetaEquilibrium(), which impacted when mass transfer is declared nuclear (and how conservative it is)
Now calculate mass accretion rate for nuclear timescale mass transfer on the fly to match with donor mass loss rate set by donor mass loss (required to fit into Roche lobe) divided by time step
Fixed random draws of SN kicks to avoid artificial pile-up at boundaries of distribution
Split --muller-mandel-sigma-kick into --muller-mandel-sigma-kick-NS and --muller-mandel-sigma-kick-BH
Fixed random kick draw for MULLERMANDEL prescription
@reinhold-willcox
reinhold-willcox changed the base branch from dev to jd_feature August 17, 2026 07:54
@reinhold-willcox
reinhold-willcox changed the base branch from jd_feature to dev August 17, 2026 07:55
@reinhold-willcox

Copy link
Copy Markdown
Collaborator Author

@ilyamandel @nrsegovia No idea why the other files were showing up here, the identical local branches for me were showing the correct file diffs. In the end, changing the base branch to something else then changing it back to dev seems to have solved it, so this looks like a weird github quirk/bug.

@ilyamandel I'm happy to add some documentation. Also, I'm still iterating with @avivajpeyi on the best way to implement unit tests for this section of the code.

@avivajpeyi

Copy link
Copy Markdown
Collaborator

Hey @reinhold-willcox how do these look for unit tests?

@avivajpeyi avivajpeyi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! You could add some automated markdown docs in the future if you'd like

@ilyamandel ilyamandel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @reinhold-willcox !

The only thing preventing me from changing "Changes requested" to "Approved" is the documentation. ;-)

@reinhold-willcox reinhold-willcox changed the title New compasUtils file New compas debugging_utils file Aug 24, 2026
@reinhold-willcox

Copy link
Copy Markdown
Collaborator Author

@ilyamandel I've added in the documentation, by cleaning up the notebook for post-processing demos. I actually wrote this notebook ages ago on the same functions, but now it's cleaner and works with the updated syntax.

@avivajpeyi I'm happy with your unit tests. If we decide we need more, we can create some.

Note that there are now a large number of commits. This is because I accidentally added a file that was too large for github, and had to do some fancy git command to remove it. This shouldn't have an impact on the repo though, since you can see that only 6 files are changed.

@ilyamandel ilyamandel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if you wanted to add a pointer directly to https://compas.readthedocs.io/en/latest/pages/User%20guide/Post-processing/post-processing.html -- but happy to approve.

@reinhold-willcox

Copy link
Copy Markdown
Collaborator Author

@ilyamandel I don't follow. That pages already points to the Basic COMPAS Data Analysis notebook. Unless I'm misunderstanding you?

@ilyamandel

Copy link
Copy Markdown
Collaborator

@reinhold-willcox : all good, I hadn't appreciated that DataAnalysis.py would take the place of DataAnalysis.html.

@ilyamandel
ilyamandel merged commit e728869 into dev Aug 26, 2026
3 checks passed
@ilyamandel
ilyamandel deleted the compas_post_processing_utils branch August 26, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.