Skip to content

new interpolator#615

Draft
philipp-rajah wants to merge 342 commits intov2.3from
new_interpolator
Draft

new interpolator#615
philipp-rajah wants to merge 342 commits intov2.3from
new_interpolator

Conversation

@philipp-rajah
Copy link
Copy Markdown
Contributor

Initial draft PR for the initial final interpolator rewrite which includes numerous improvements to the code, both at the preprocessing and the algorithmic levels.

mkruckow and others added 30 commits May 4, 2023 10:36
* Add initial_z to be read from directory name

Add initial_z to be read from directory name, which is the case for v2 and newer versions.

* Try to get metallicity form directory name

Try to get the metallicity value from the directory name in case, there is no history file.

* Correct typo

step_7 -> step_6

* Add to reset DISPLAY for plotting 

Add to reset DISPLAY for plotting step on a cluster to avoid problems when logged in with window mode on ssh.

* Check for initial RLO in join_grids

Check for initial RLO in join_grids, too.
Use a joint initial RLO boundary.

* Debug

Flush output for debugging

* Fix bug in adding too many boundary systems

Fix bug in adding too many boundary systems

* Remove debugging

Remove debugging

* Fix list entry replacement (psygrid.py)

Fix list entry replacement in psygrid.py

* Fix list entry replacement (termination_flags.py)

Fix list entry replacement in termination_flags.py

* Add STEPID

Add the number of the step to the slurm job-name

* Update last developement changes (#62)

* Fixed more dict syntax for kwargs in docs (#53)

In SingleStar object docs

* Fixed dict syntax for kwargs1, kwargs2 definitions (#52)

---------

Co-authored-by: Camille Liotine <cliotine@u.northwestern.edu>

* account for suggestions 

- add else (nevertheless it will raise an error message later; I thought I predefined STEPID, but it looks like I put it out/or missed to put it in; using job_name here as content of the STEPID is a bad idea, because it is expected to be a single character and not a string)
- add the check for the length after the split (again, this would cause an error message later nevertheless)

* rename variable

e -> exists_already

* rename

e -> exists_already

---------

Co-authored-by: Camille Liotine <cliotine@u.northwestern.edu>
* Add initial_z to be read from directory name

Add initial_z to be read from directory name, which is the case for v2 and newer versions.

* Try to get metallicity form directory name

Try to get the metallicity value from the directory name in case, there is no history file.

* Correct typo

step_7 -> step_6

* Add to reset DISPLAY for plotting 

Add to reset DISPLAY for plotting step on a cluster to avoid problems when logged in with window mode on ssh.

* Check for initial RLO in join_grids

Check for initial RLO in join_grids, too.
Use a joint initial RLO boundary.

* Debug

Flush output for debugging

* Fix bug in adding too many boundary systems

Fix bug in adding too many boundary systems

* Remove debugging

Remove debugging

* Fix list entry replacement (psygrid.py)

Fix list entry replacement in psygrid.py

* Fix list entry replacement (termination_flags.py)

Fix list entry replacement in termination_flags.py

* Add STEPID

Add the number of the step to the slurm job-name

* Update last developement changes (#62)

* Fixed more dict syntax for kwargs in docs (#53)

In SingleStar object docs

* Fixed dict syntax for kwargs1, kwargs2 definitions (#52)

---------

Co-authored-by: Camille Liotine <cliotine@u.northwestern.edu>

* account for suggestions 

- add else (nevertheless it will raise an error message later; I thought I predefined STEPID, but it looks like I put it out/or missed to put it in; using job_name here as content of the STEPID is a bad idea, because it is expected to be a single character and not a string)
- add the check for the length after the split (again, this would cause an error message later nevertheless)

* rename variable

e -> exists_already

* rename

e -> exists_already

* Add run_pipeline.sh

- create the bash script "run_pipeline.sh", which starts all the setup steps with dependency

* Automatic kill on failure

set option to kill pending jobs, where the depended job failed

* Check all steps, which can run in parallel

- allow step_5 to go in parallel to step_3, too

---------

Co-authored-by: Camille Liotine <cliotine@u.northwestern.edu>
…ed step (#45)

* Update common_functions.py

* Update step_detached.py

* Update step_mesa.py

* Update step_detached.py
* Adding gzip support when reading MESA grids.

* Adding GZIP support to psygrid metadata printing.

* Adding GZIP support to grid points files.

* Adding GZIP support to EEP files.

* Clarifications for GZIP files inside the code.

* Adding more clarification regarding support of GZIP files.

* Adding GZIP support to function converting MESA output to table.

* Adding GZIP support when inferring termination flag from MESA run output.

* Adding GZIP support in EEP class.

* Correcting types in io
move option "--kill-on-invalid-dep=yes" in the brackets
* started the step_isolated files (2 is for superclass with detached) and first changes in detached and in flow

* allowed for different psygrid for isoalted step, selected lists of stellar states, still need to solve absence of logR for mergers

* deleted old step_isolated

* made step_merging

* integrated the step_merged correctly in the flow

* before intorducing the option for not using log_R as a matching criteria, having the option do decide the parameters of the matching

* added most merger cases, still need to solve logR avsence in matching

* finished step_merged combinations

* made the new disrupted_step

* added spin of merged product

* made step_initially_single too and changes of structure after discussion with Konstantinos

* latest changes

* Eirini's change,name of mist0 to match_to_single_star

* making lists for each matching

* changes in lambda minimize function to a more general function that can take an arbitrary list

* typo

* added the option of the different list of attributes in the step_merged

* matching should work the same for all subclasses now

* syntax errors prob fixed

* fixing runtime errors in the new files

* some more fixing

* Some print statements

* change the flowchart to not go to sterp_disurpted if one of the events is detached is called

* prints

* typo in flowchart

* Friday's work

* .

* fix init orbit

* disrupted bianry evolves until CC2

* step SN updated to expect a 2nd CC in an already disrupted system. Matching for postMS and maybe HeStars may still need work

* matching fixing

* slightly improved the verbose text of the matching

* print errors

* changes to match_to_single_star

* generalized alternative matching

* for this PR, step merged does nothing

* matching happening only when needed (once)

* step merged and intially single go to step end for now

* testing cases of ZAMS stars not needed to match

* binary fraction

* minor changes in isolated or initially single

* else statement, self.companion

* typo

* deleted the option of fidning ZAMS through logR

* syntax error fixing

* resolving merging issues

* went back to grid_Hrich and grid_strippedHe

* ini file

* ini

* surf_avg_omega_div_omega_crit is not always stored, so it is no longer called for and passed to solve_ivp. It is calculated in the Matt+2015 magnetic braking calculation from stellar properties now, as it is only needed there.

* del grid from detached params

* ini

* Removed additional instances where interp1d_sec[surf_avg_omega_div_omega_crit](t - t_offset_sec) was called.

* changing the random

* removed superfluous commas in defining detached step properties

* Adding step_isolated,step_disrupted in the STEP_NAMES_LOADING_GRIDS so the metallicity can propagate in ther kwargs

* fix in ini file

* I think I went the POSYDON-MESA-INLIST submodule back

* changed class names according to CamelCase convention

* time profiling

* Corrections to the detached verbose with timestamp.

* no matching for the CO star, using m0,t0 of the previously matched star

* Giving additional option 1 in verbose to print only the matching parameters

* Step 1 in cleaning detached step.

* Step 2 in cleaing detached step.

* Removing duplicate code in square difference function.

* Deciding on which column are going to use relative distance during matching.

* Deleting obsolete transform method in detached step.

* Removing unnecessary transform when scaling columns in detached step.

* Using stored scalers and removing some useless self.grid assignments

* in the 3rd matching step, I added the change of htrack also for postMS stars

* added htrack  = star.htrack

* commenting out the relative differences during matching for center_he4

* in the 3rd alternative matching we also change the parameters used for matching to the ones according to the new htrack

* typo

* htrack is updated outside match_to_single_star to be used in the rest of get_star_data

* removed simulationproperties from CE folder...

---------

Co-authored-by: Eirini Kasdagli <kasdaglie@login6.ufhpc>
Co-authored-by: kasdaglie <kasdaglie@ufl.edu>
Co-authored-by: sg <sethg45@gmail.com>
Co-authored-by: kkovlakas <kkovla@gmail.com>
* updating modules to newest versions for python 3.11

* merge developmet and fix sintax warning in step_SN where is not was incorrectly used whencomparig strigs

---------

Co-authored-by: ssbvr <sim.bavera@gmail.com>
…ted using grids of pre-calculated detection probabilities living at /projects/b1119/POSYDON_GRIDS/POSYDON_popsynth_data/v2/POSYDON_data/selection_effects/grids/pdet_grid.hdf5. This file contains pdets assuming a 3-detector HLV network operating at different sensitivities. (#82)
* add synthetic population parser

* bug fixes

* cleaning

* get DCO population at formation as df_synthetic, add t_inspiral and underlying stellar mass for rate calculation

* add method to compute merger efficiency

* add intrinsic and detectable populations

* define all class variables

* add visualisation modules

* small edit

* add rate calculation and SFR

* add docstrings and parser of oneline dataframe

* update pdet calculation to POSYDON selection effects

* update sensitivity docstring
* Update gridutils.py

add a catch, if something goes wrong while reading files

* Update psygrid.py

Catch "None" in history_mod and history_age

* Ignore runs with corrupted history

Ignore runs with corrupted history

* fix typo

close an open bracket

* Remove some ignore_data again

Remove ignore_data on normal history read, to allow stars to not be included in the simulation, e.g. a CO

* Update scrubbing.py

Catch, that table might not be None, while model or age is.

* catch None

if (binary) history is None set length to 0
* adding profile interpolation

* adding monotonicity enforcement to main class

* fixing typo in learn_bounds and increase epochs/callbacks

* remove default path, move IF interpolator argument to train method

* changed some variable names

* adding load interpolator arg to main class init function

* changing arg name from interpolator to IF_interpolator to prevent confusion

* adding docs for prof interpolation

* fixed file format for docs

* fix typo

* removed extraneous line

* addressing some stylistic issues

* resolve various issues

* changed name of finalmass to final_m1, added missing states to X_H class

* fixed missing return in mono renorm

* addressing Philipp's comments; changing a few argument/variable names, added arguments for model training parameters

---------

Co-authored-by: Elizabeth Teng <elizabethteng@u.northwestern.edu>
* allow to remove slices from combining grids and only remove the combining if all slices are missing

* Update setup-pipeline

correct some typos

* track previously created files

* Update setup-pipeline

fix typo

* get files from step 1

* change range over df shape to instead use the index object

* turn any to check on length

* add check for no slurm tasks

* account for larger length difference of histories

* reuse columns from histories if possible, add warnings

* bugfix

* add open-mode, remove old file (make a copy first)

* allow to ignore bad charaters in MESA log files

* drop rows and columns
* Add function "keep_till_He_depletion"

* Add option to stop at He depletion

* Add option to pipeline (remove later)

* correct not

* Change threshold for He depletion

* allow histories without age, add new flag

* Check for history of 0 length

* add C criterion for He depletion

add C criterion for He depletion

* Update psygrid.py

use 0.08 carbon abundance

* Update scrubbing.py

where can't handle two arrays in parallel

* Update psygrid.py

change C limit to 0.1

* Update psygrid.py

Add mass request to only apply stopping earlier to masses of 100Msun and above

* Update run-pipeline

remove "_He_depletion" extension for the file name of the hdf5 file containing the psygrid

* rename function and flags

* Update psygrid.py

correct typo
* add synthetic population parser

* bug fixes

* cleaning

* get DCO population at formation as df_synthetic, add t_inspiral and underlying stellar mass for rate calculation

* add method to compute merger efficiency

* add intrinsic and detectable populations

* define all class variables

* add visualisation modules

* small edit

* add rate calculation and SFR

* add docstrings and parser of oneline dataframe

* update pdet calculation to POSYDON selection effects

* update sensitivity docstring

* support arbitrary MODEL for rate calculation

* fix
…models + introduce H envelope option to step_SN + v2 data pop synth debugged (#70)

* Add function "keep_till_He_depletion"

* Add option to stop at He depletion

* Add option to pipeline (remove later)

* correct not

* Change threshold for He depletion

* allow histories without age, add new flag

* Check for history of 0 length

* support BH formation above PISN gap and direct/Fryer collapse prescriptions now assume hydrogen envelope does not go into the BH

* add C criterion for He depletion

add C criterion for He depletion

* Update psygrid.py

use 0.08 carbon abundance

* Update scrubbing.py

where can't handle two arrays in parallel

* Update psygrid.py

change C limit to 0.1

* support the option to conserve the hydrogen envelope in BH formation

* add MODEL var to post processing

* update post processing script to support multiple core collapse models

* Update psygrid.py

Add mass request to only apply stopping earlier to masses of 100Msun and above

* Update run-pipeline

remove "_He_depletion" extension for the file name of the hdf5 file containing the psygrid

* debug

* rename function and flags

* add support for BH disk mass

* allow to remove slices from combining grids and only remove the combining if all slices are missing

* fix small bug

* Update setup-pipeline

correct some typos

* track previously created files

* Update setup-pipeline

fix typo

* get files from step 1

* change range over df shape to instead use the index object

* update step_6 run-pipeline

* turn any to check on length

* debug

* add check for no slurm tasks

* account for larger length difference of histories

* reuse columns from histories if possible, add warnings

* bugfix

* propagate changes in step_SN and step_MESA

* fix bug

* debug plot2D

* remove circular import

* add open-mode, remove old file (make a copy first)

* allow to ignore bad charaters in MESA log files

* drop rows and columns

* change import

* import TF1 for post processing

* fix bug

* Update psygrid.py

correct typo

* debug

* roll fix for single stars as well

* debug

* Matthias split grid rlo (#99)

* fix in psygrid.py

fix check of initial mass when cutting off carbon depletion

* Update run-pipeline

get start_at_RLO from compression type
add flag to stop before carbon depletion (allow only for HMS grids)

* Update setup-pipeline

remove CO_HMS_GRID_START_AT_RLO
add STOP_BEFORE_CARBON_DEPLETION

* Update setup-pipeline

get different directory for plotting if compression contains "RLO"

* Update setup-pipeline

correct typo

* Update psygrid.py

correct typo

* Update psygrid.py

debug

* debug single interpolation

* add support for other metallicities

* update Z to Y conversion

* SN_type not diclared in star properties

* debug

* update default params ini

* increase len interp_class column

* update params ini

* add authorship to MODEL.py

* Matthias split grid rlo (#100)

* fix in psygrid.py

fix check of initial mass when cutting off carbon depletion

* Update run-pipeline

get start_at_RLO from compression type
add flag to stop before carbon depletion (allow only for HMS grids)

* Update setup-pipeline

remove CO_HMS_GRID_START_AT_RLO
add STOP_BEFORE_CARBON_DEPLETION

* Update setup-pipeline

get different directory for plotting if compression contains "RLO"

* Update setup-pipeline

correct typo

* Update psygrid.py

correct typo

* Update psygrid.py

debug

* Update setup-pipeline

Add RLO to steps 6 and 7

* Update setup-pipeline

Correct step 7

* Update run-pipeline

don't interpolate no_MT for any grid starting at RLO

* Update run-pipeline

remove "_RLO" from method, which is read from the filename

* Update setup-pipeline

add "CO-HeMS_RLO" to export dirs

* update spin orbit tilt name in rate calculation

---------

Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com>
Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch>
* started the step_isolated files (2 is for superclass with detached) and first changes in detached and in flow

* allowed for different psygrid for isoalted step, selected lists of stellar states, still need to solve absence of logR for mergers

* deleted old step_isolated

* made step_merging

* integrated the step_merged correctly in the flow

* before intorducing the option for not using log_R as a matching criteria, having the option do decide the parameters of the matching

* added most merger cases, still need to solve logR avsence in matching

* finished step_merged combinations

* made the new disrupted_step

* added spin of merged product

* made step_initially_single too and changes of structure after discussion with Konstantinos

* latest changes

* Eirini's change,name of mist0 to match_to_single_star

* making lists for each matching

* changes in lambda minimize function to a more general function that can take an arbitrary list

* typo

* added the option of the different list of attributes in the step_merged

* matching should work the same for all subclasses now

* syntax errors prob fixed

* fixing runtime errors in the new files

* some more fixing

* Some print statements

* change the flowchart to not go to sterp_disurpted if one of the events is detached is called

* prints

* typo in flowchart

* Friday's work

* .

* fix init orbit

* disrupted bianry evolves until CC2

* step SN updated to expect a 2nd CC in an already disrupted system. Matching for postMS and maybe HeStars may still need work

* matching fixing

* slightly improved the verbose text of the matching

* print errors

* changes to match_to_single_star

* generalized alternative matching

* for this PR, step merged does nothing

* matching happening only when needed (once)

* step merged and intially single go to step end for now

* testing cases of ZAMS stars not needed to match

* binary fraction

* minor changes in isolated or initially single

* else statement, self.companion

* typo

* deleted the option of fidning ZAMS through logR

* syntax error fixing

* resolving merging issues

* went back to grid_Hrich and grid_strippedHe

* ini file

* ini

* surf_avg_omega_div_omega_crit is not always stored, so it is no longer called for and passed to solve_ivp. It is calculated in the Matt+2015 magnetic braking calculation from stellar properties now, as it is only needed there.

* del grid from detached params

* ini

* Removed additional instances where interp1d_sec[surf_avg_omega_div_omega_crit](t - t_offset_sec) was called.

* changing the random

* removed superfluous commas in defining detached step properties

* Adding step_isolated,step_disrupted in the STEP_NAMES_LOADING_GRIDS so the metallicity can propagate in ther kwargs

* fix in ini file

* I think I went the POSYDON-MESA-INLIST submodule back

* changed class names according to CamelCase convention

* time profiling

* Corrections to the detached verbose with timestamp.

* no matching for the CO star, using m0,t0 of the previously matched star

* Giving additional option 1 in verbose to print only the matching parameters

* printing of more timing profiling

* Step 1 in cleaning detached step.

* Step 2 in cleaing detached step.

* Removing duplicate code in square difference function.

* Deciding on which column are going to use relative distance during matching.

* Deleting obsolete transform method in detached step.

* Removing unnecessary transform when scaling columns in detached step.

* Using stored scalers and removing some useless self.grid assignments

* adding massless in the star states in flow chart

* Adding massless_remant and a compact binary state list for the detached. Adding initially single stars in the step names for metallisity

* fixing the primary.co in some elif

* fixing the infite loop created by the flow chart

* metallicity = 1 as default

* in the flow, a CO+massless goes to step_end

* going to step initially single only after ZAMS

* pulled merged step from manos_merged_step

* pulled the isolated step and the population defaults for all substeps (disrupted, initially_single, merged)

* pulled step_SN, flow, and step_detached

* added step_merged in steps that need a metallicity (in binarypopulations.py)

* IsolatedStep changes

* fixing the STAR_STATES_ALL in the flow_chart

* properties_massless_remnant in common function

* convert_massless_remenant in merged

* properties massless in SingleStar class instead

* corrected massless_remnant dictionary

* fixing the state after CC1 in merged and single stars

* set initial period and separation for single star equal to nan

* deleting some unnecessary comments

* deleting repeated dictionaries in detached

* reverting the changes in MESA-INLISTS

* Update step_detached.py

* Update binarystar.py

---------

Co-authored-by: ezapartas <ezapartas@gmail.com>
Co-authored-by: Eirini Kasdagli <kasdaglie@login6.ufhpc>
Co-authored-by: sg <sethg45@gmail.com>
Co-authored-by: kkovlakas <kkovla@gmail.com>
* Fixing coordinate frame inconsistency in orbital_kick()

* more documentation for orbital_kick fix

* fixed issue with cos_psi being limited to >0

---------

Co-authored-by: Jeff Andrews <jeffrey.andrews@northwestern.edu>
* adding profile interpolation

* adding monotonicity enforcement to main class

* fixing typo in learn_bounds and increase epochs/callbacks

* remove default path, move IF interpolator argument to train method

* changed some variable names

* adding load interpolator arg to main class init function

* changing arg name from interpolator to IF_interpolator to prevent confusion

* adding docs for prof interpolation

* fixed file format for docs

* fix typo

* removed extraneous line

* addressing some stylistic issues

* resolve various issues

* changed name of finalmass to final_m1, added missing states to X_H class

* fixed missing return in mono renorm

* addressing Philipp's comments; changing a few argument/variable names, added arguments for model training parameters

* adding tensorflow to extras_require

* fixed typo and added comment for tensorflow dependency

* added helium profile interpolation, updated docs

* update compiledata to include option for star 2, add MT class to dataframe

* condensed a for loop

* fixed a few bugs

* moved some definitions around

* make 80/20 split for validation data from training data

* typos

* allowed for star 2 in all classes

* got rid of feature that would make predictions from untrained models for final star states with no training data

* Update setup.py

---------

Co-authored-by: Elizabeth Teng <elizabethteng@u.northwestern.edu>
Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu>
* Added an agb_wind rerun type (to perform reruns that will have the Bloecker AGB wind enabled).

* removed the initial mass < 10 Msol check

* Update run-pipeline

---------

Co-authored-by: Seth Shearer Gossage <ssg9761@quser32.quest.it.northwestern.edu>
Co-authored-by: Seth Shearer Gossage <ssg9761@quser33.quest.it.northwestern.edu>
Co-authored-by: Jeff Andrews <jeffrey.andrews@northwestern.edu>
Missing comment block
Adding a comma
set tpabg to False in case of a missing history, e.g. if there is a CO instead of a star
* Add function "keep_till_He_depletion"

* Add option to stop at He depletion

* Add option to pipeline (remove later)

* correct not

* Change threshold for He depletion

* allow histories without age, add new flag

* Check for history of 0 length

* support BH formation above PISN gap and direct/Fryer collapse prescriptions now assume hydrogen envelope does not go into the BH

* add C criterion for He depletion

add C criterion for He depletion

* Update psygrid.py

use 0.08 carbon abundance

* Update scrubbing.py

where can't handle two arrays in parallel

* Update psygrid.py

change C limit to 0.1

* support the option to conserve the hydrogen envelope in BH formation

* add MODEL var to post processing

* update post processing script to support multiple core collapse models

* Update psygrid.py

Add mass request to only apply stopping earlier to masses of 100Msun and above

* Update run-pipeline

remove "_He_depletion" extension for the file name of the hdf5 file containing the psygrid

* debug

* rename function and flags

* add support for BH disk mass

* allow to remove slices from combining grids and only remove the combining if all slices are missing

* fix small bug

* Update setup-pipeline

correct some typos

* track previously created files

* Update setup-pipeline

fix typo

* get files from step 1

* change range over df shape to instead use the index object

* update step_6 run-pipeline

* turn any to check on length

* debug

* add check for no slurm tasks

* account for larger length difference of histories

* reuse columns from histories if possible, add warnings

* bugfix

* propagate changes in step_SN and step_MESA

* fix bug

* debug plot2D

* remove circular import

* add open-mode, remove old file (make a copy first)

* allow to ignore bad charaters in MESA log files

* drop rows and columns

* change import

* import TF1 for post processing

* fix bug

* Update psygrid.py

correct typo

* debug

* roll fix for single stars as well

* debug

* Matthias split grid rlo (#99)

* fix in psygrid.py

fix check of initial mass when cutting off carbon depletion

* Update run-pipeline

get start_at_RLO from compression type
add flag to stop before carbon depletion (allow only for HMS grids)

* Update setup-pipeline

remove CO_HMS_GRID_START_AT_RLO
add STOP_BEFORE_CARBON_DEPLETION

* Update setup-pipeline

get different directory for plotting if compression contains "RLO"

* Update setup-pipeline

correct typo

* Update psygrid.py

correct typo

* Update psygrid.py

debug

* debug single interpolation

* add support for other metallicities

* update Z to Y conversion

* SN_type not diclared in star properties

* debug

* update default params ini

* increase len interp_class column

* update params ini

* add authorship to MODEL.py

* Matthias split grid rlo (#100)

* fix in psygrid.py

fix check of initial mass when cutting off carbon depletion

* Update run-pipeline

get start_at_RLO from compression type
add flag to stop before carbon depletion (allow only for HMS grids)

* Update setup-pipeline

remove CO_HMS_GRID_START_AT_RLO
add STOP_BEFORE_CARBON_DEPLETION

* Update setup-pipeline

get different directory for plotting if compression contains "RLO"

* Update setup-pipeline

correct typo

* Update psygrid.py

correct typo

* Update psygrid.py

debug

* Update setup-pipeline

Add RLO to steps 6 and 7

* Update setup-pipeline

Correct step 7

* Update run-pipeline

don't interpolate no_MT for any grid starting at RLO

* Update run-pipeline

remove "_RLO" from method, which is read from the filename

* Update setup-pipeline

add "CO-HeMS_RLO" to export dirs

* update spin orbit tilt name in rate calculation

* adding function get_formation_channels

* in parse function, shifting the binary_index

* compute GRB properties

* add channelwise merger efficiency calculation and plotting

* add channelwise rate density

* support channelwise histogram distributions

* add file authorship

* debug

* cosistency change

* add GRB rate calculation

* fixing shift in binary index

* minor bug

* debug

* debug

* debug

* address PR103 PR104 comments

* remove bug introduced in previous comment

* remove bug introduced in previous commit

* debug

---------

Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com>
Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch>
Co-authored-by: Monica Gallegos-Garcia <monicagallegosgarcia2024@u.northwestern.edu>
* adding profile interpolation

* adding monotonicity enforcement to main class

* fixing typo in learn_bounds and increase epochs/callbacks

* remove default path, move IF interpolator argument to train method

* changed some variable names

* adding load interpolator arg to main class init function

* changing arg name from interpolator to IF_interpolator to prevent confusion

* adding docs for prof interpolation

* fixed file format for docs

* fix typo

* removed extraneous line

* addressing some stylistic issues

* resolve various issues

* changed name of finalmass to final_m1, added missing states to X_H class

* fixed missing return in mono renorm

* addressing Philipp's comments; changing a few argument/variable names, added arguments for model training parameters

* adding tensorflow to extras_require

* fixed typo and added comment for tensorflow dependency

* added helium profile interpolation, updated docs

* update compiledata to include option for star 2, add MT class to dataframe

* condensed a for loop

* fixed a few bugs

* moved some definitions around

* make 80/20 split for validation data from training data

* typos

* allowed for star 2 in all classes

* got rid of feature that would make predictions from untrained models for final star states with no training data

* Update setup.py

* testing branch

* undo

* Update ProfileInterpolator.rst

* update comments and docstrings, fix star 1/star 2 stuff in composition class

* adding missing argument name

* fixed comment

* update tensorflow version to 2.13 to avoid installation issues

* added omega profiles normalized by omega/omega_crit

---------

Co-authored-by: Elizabeth Teng <elizabethteng@u.northwestern.edu>
Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu>
Co-authored-by: Simone Bavera <32518238+ssbvr@users.noreply.github.com>
* Update gridutils.py

* Update gridutils.py

Use os functionalities instead

* Update step_mesa.py

Use os functionality

* Update run-pipeline

Use os functionalities

* Update posydon-setup-grid

Use os functionality
correct bug (use file name instead of first directory name)

* Update compress-mesa

Use os functionality
…erbunt, and Joss 1983 prescription in step_detached (#114)

The leading constant should have been 3.8e-30, not 3.8e30.
* Add function "keep_till_He_depletion"

* Add option to stop at He depletion

* Add option to pipeline (remove later)

* correct not

* Change threshold for He depletion

* allow histories without age, add new flag

* Check for history of 0 length

* support BH formation above PISN gap and direct/Fryer collapse prescriptions now assume hydrogen envelope does not go into the BH

* add C criterion for He depletion

add C criterion for He depletion

* Update psygrid.py

use 0.08 carbon abundance

* Update scrubbing.py

where can't handle two arrays in parallel

* Update psygrid.py

change C limit to 0.1

* support the option to conserve the hydrogen envelope in BH formation

* add MODEL var to post processing

* update post processing script to support multiple core collapse models

* Update psygrid.py

Add mass request to only apply stopping earlier to masses of 100Msun and above

* Update run-pipeline

remove "_He_depletion" extension for the file name of the hdf5 file containing the psygrid

* debug

* rename function and flags

* add support for BH disk mass

* allow to remove slices from combining grids and only remove the combining if all slices are missing

* fix small bug

* Update setup-pipeline

correct some typos

* track previously created files

* Update setup-pipeline

fix typo

* get files from step 1

* change range over df shape to instead use the index object

* update step_6 run-pipeline

* turn any to check on length

* debug

* add check for no slurm tasks

* account for larger length difference of histories

* reuse columns from histories if possible, add warnings

* bugfix

* propagate changes in step_SN and step_MESA

* fix bug

* debug plot2D

* remove circular import

* add open-mode, remove old file (make a copy first)

* allow to ignore bad charaters in MESA log files

* drop rows and columns

* change import

* import TF1 for post processing

* fix bug

* Update psygrid.py

correct typo

* debug

* roll fix for single stars as well

* debug

* Matthias split grid rlo (#99)

* fix in psygrid.py

fix check of initial mass when cutting off carbon depletion

* Update run-pipeline

get start_at_RLO from compression type
add flag to stop before carbon depletion (allow only for HMS grids)

* Update setup-pipeline

remove CO_HMS_GRID_START_AT_RLO
add STOP_BEFORE_CARBON_DEPLETION

* Update setup-pipeline

get different directory for plotting if compression contains "RLO"

* Update setup-pipeline

correct typo

* Update psygrid.py

correct typo

* Update psygrid.py

debug

* debug single interpolation

* add support for other metallicities

* update Z to Y conversion

* SN_type not diclared in star properties

* debug

* update default params ini

* increase len interp_class column

* update params ini

* add authorship to MODEL.py

* Matthias split grid rlo (#100)

* fix in psygrid.py

fix check of initial mass when cutting off carbon depletion

* Update run-pipeline

get start_at_RLO from compression type
add flag to stop before carbon depletion (allow only for HMS grids)

* Update setup-pipeline

remove CO_HMS_GRID_START_AT_RLO
add STOP_BEFORE_CARBON_DEPLETION

* Update setup-pipeline

get different directory for plotting if compression contains "RLO"

* Update setup-pipeline

correct typo

* Update psygrid.py

correct typo

* Update psygrid.py

debug

* Update setup-pipeline

Add RLO to steps 6 and 7

* Update setup-pipeline

Correct step 7

* Update run-pipeline

don't interpolate no_MT for any grid starting at RLO

* Update run-pipeline

remove "_RLO" from method, which is read from the filename

* Update setup-pipeline

add "CO-HeMS_RLO" to export dirs

* update spin orbit tilt name in rate calculation

* adding function get_formation_channels

* in parse function, shifting the binary_index

* compute GRB properties

* add channelwise merger efficiency calculation and plotting

* add channelwise rate density

* support channelwise histogram distributions

* add file authorship

* debug

* cosistency change

* add GRB rate calculation

* debug

* debug

* debug

* address PR103 PR104 comments

* remove bug introduced in previous comment

* remove bug introduced in previous commit

* bug fix

---------

Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com>
Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch>
Co-authored-by: Monica Gallegos-Garcia <monicagallegosgarcia2024@u.northwestern.edu>
maxbriel and others added 17 commits March 10, 2025 22:02
This fixes a bug in the logic.

For `f_bin_simulated != 1`, the logic would result in the second if/else statement always being run, despite wanting to run the `f_bin_nature == 0`.
* implement Hendriks+23 SN prescription

* Add commentedMODELS to train for Hendriks+23 with and without hydrogen envelope conservation

* add additioanl PISN parameters in default population.ini file. Not necessary to include when running pops

* add paper equation comment + limit metallicity to Z >= 1e-4 for equation. Lower values use 1e-4 PPI prescription

* add new parameter for conserve_hydrogen_PPI

* Add to default model

* Allow CCSN to use conserve_hydrogen

* define m_CO_core_PISN_min/max for easier understanding

* Update the documentation

with the new parameters
* Add BZ jet calculation option + restructure do_core_collapse_BH output

* Update profile_collapse.py

* fix verbose print statement

* extend doc string + fix return on l 404

* remove ==BH statement

* shift star.mass definition upwards before the check

* remove double set of m_disk_x

* Update posydon/binary_evol/SN/profile_collapse.py

Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com>

* typo fix

---------

Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com>
…476)

* split popsyn plotting into separate components for future modularity

* swap m1 and m2 for CO grid plotting

* additional comment

* add small changes to doc strings

* add value error + doc string

* save file to add else
* use information about dominating star in infer_mass_transfer_case

* Update profile_collapse.py

correct typo

* separate best_fit and new htrack

* Update step_detached.py

cleanup

* cleanup blanks

---------

Co-authored-by: Max Briel <max.briel@gmail.com>
sphinx at least 8.2.2
* change to v4

* add to CI for testing checkout and setup python versions

* change other versions to 'latest'
* update first tutorial

* add shell loop; make shell script executeable

* add cleanup to shell run

* reuse already loaded grid

* tutorial2

* tutorial 4

* tutorial 3: changes before submission only

* complete tutorial 3
* create data sets

* add new functions

* Update datasets.py

* add command line interaction

* add todos to not download full default always as soon as we have more datasets

* add more error handling

* use dataset name more in outputs

* adpot documantation

* Update data_download.py

filename -> filepath in error

* Update installation-guide.rst

More info for the PATH* variables

* correct typos and add more information

* adjust line length

---------

Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu>
* Update step_SN.py

escape for ECSN in SN_MODELS

* add check for ECSN to not use interpolated values

* add warning for mismatching SN_type and reorder other warnings

* replace np.isnan by pd.isna

* attemped to overwrite ECSN in SN_MODEL

* add ReplaceValueWarning

* add warning if ECSN leads to BH

* Update step_SN.py

typo

* Update step_SN.py

typo

* Update step_SN.py

another typo

* Update step_SN.py

bug fix
* add WDs to infer_star_state, incl. testing and new limits

* add references
change >3.10 to >=3.11
* create new pyproject.toml; try to reuse setup.py as much as possible

* add refs
Update to give the correct usage for the engine if 'other' mechanisms are used
@astroJeff
Copy link
Copy Markdown
Contributor

astroJeff commented Aug 13, 2025

Fixes #367 and #86

@sgossage sgossage added the enhancement New feature or request label Aug 25, 2025
@sgossage
Copy link
Copy Markdown
Contributor

This should be rebased or cherrypicked to merge into v2.1-dev

@sgossage
Copy link
Copy Markdown
Contributor

sgossage commented Oct 3, 2025

@philipp-rajah I linked Issue#86 to this PR. We stated back then that maybe we could resolve that issue and its sub-issues with this interpolator rewrite, so we should check that we can resolve them here.

@sgossage
Copy link
Copy Markdown
Contributor

sgossage commented Oct 3, 2025

Linked Issue#419 to this PR. There it is suggested that we might find a solution to fix a possible classification issue that can lead HMS-HMS stars to result in RLO.

An example there finds a system that entered unstable_MT during step_HMS_HMS, which should lead to step_CE, not step_detached (which would be valid as a result of stable MT).

@astroJeff astroJeff changed the base branch from development-deprecated to v2.3 April 16, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet