-
Notifications
You must be signed in to change notification settings - Fork 29
SFH bug fix, rewrite, and basic tests #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… call, which pre-calculate the multiplication for speed improvemen
| float or array | ||
| The mean metallicity at the given redshift. | ||
| ''' | ||
| return 10 ** (0.153 - 0.074 * z ** 1.34) * Zsun |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that formula valid for any updated Zsun or does it rely on the Asplund+09 value? In the second case, we should have the Asplund value hard coded instead of using the constant for the solar metallicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what was originally implemented. I'm not certain on this validity. Feel free to verify.
|
|
||
| # include material outside the metallicity bounds if requested | ||
| if self.Z_max is not None: | ||
| if self.Z_max >= metallicity_bins[-1]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that metallicity_bins is sorted from highest metallicity to lowest. Can we make sure that's enforced somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good one. In principle, this takes the sorted array from Rates().edges_metallciity_bins which is sorted. But it does not verify or check here.
I will add a check to make sure it is sorted.
| raise ValueError("Z_min must be in absolute units! " | ||
| "It cannot be larger than 1!") | ||
| if self.Z_min is not None and self.Z_max is not None: | ||
| if self.Z_min >= self.Z_max: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure there is a way to run a SFH with only one metallicity. An obvious way to do that is to set Zmin and Zmax to be equal. However, the >= comparison here will make that impossible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should already be possible with this version. I can imagine two scenarios:
- You have a single metallicity in your population. You can set
dlogZin the SFH_MODEL to determine the bin width for that metallicity bin. Without setting Z_min and Z_max, this should only include that metallicity contribution. Z_min and Z_max will allow you to alter this range (so there's some double functionality there). Additionally, you can attribute all SFR to the one metallicity bin by either setting Z_min and Z_max to 0 and 1, respectively. Or settingnormalise=True. - You have multipke metallicity in your population and you want only 1 metallicity calculated. For this you can use Z_min and Z_max to restrict the metallicity range to the one metallicity bin/range you want.
We're always working with a metallicity bin that our population represents. Is there a use case where we need the specific value at one metallicity without assuming a bin size?
|
@astroJeff @mkruckow I've implemented your recent comments, except for checking the exact warning message. I just check if there's output. |
Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com>
mkruckow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ready to go for me.
* combine SFR_Z_fraction and star_formation_rate into a single function call, which pre-calculate the multiplication for speed improvemen * add correct select_one_met in function * move SFH into separate classes with abstract inheritance * Move SFH to classes (with abstract treatments) + Add Chruslinska+21 SFH models * fix fSFR. Now sums correctly to 1 at each redshift. * add fSFR unit tests * add additional basic tests * fix double naming of SFR * add tests for new SFRs * remove old SFH code; not used anywhere * move std_log_metallicity_history * add dosctring for abstract class * add docstrings * rename variables * add more doc strings * add even more docs * more doc strings * add checks for required parameters in MadauBase * docstrings: * change name of SFR_per_met_per_z function * alter unit tests to adapt to previous changes * change ' to " * cleanup line lengths * change output fSFR and _call__ dosctring to ndarray * add check for model parameters required * restructure + integrate only between Z_min and Z_max + add option normalise * Z_max check * update the SFH to use Z_min and Z_max and normalise. Move the splitting per metallicity bin to its own function. Additionally, revamp the unit tests to be more in style with the other unit tests and adapt them for the new functions and treatment of the metallicity bins. * fix name typo * remove Z_max requirement for Chruslinska * implement Matthias comments * change to rates.MODEL * change comment * add test for get_SFR_per_met_at_z * make sure to test branches * add SFH tests * add space * remove duplicate lines in IllustrisTNG class * move ConcreteSFH into a fixture * Add support for Zmin and Zmax inside bins and inside the same bin. * add doc string + remove select_one_met * replace MODEL with SFH_MODEL * change DEFAULT_MODEL to DEFAULT_SFH_MODEL * add to default Zmin,Zmax=None + normalise=True * update docstrings: * clean up star_formation_history file * update unit tests + implement comments * update call method test * add std_log_metallicity_dist integer support * make explicit regex expression * update unit tests & implement remainder of comments Matthias * cleanup * warning cleanup * add SFHModelWarning + add sort check * change to sphinx reference style * add reference * add check for None output in error * add unit test for unsorted Metalicity bins * suggested change * add new warning class to test * Update posydon/unit_tests/popsyn/test_star_formation_history.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com>
* TransientPopulation overplot crash fix (#374) * check if no binaries are selected for the slice to mitigate crashing * Update plot_pop.py space change * fix get_redshift_from_cosmic_time() function (#381) * Replace job_start for running grids (#380) * turn start+end to end+before_end+now * Reduce number of CPUs for cleanup jobs Usually, cleanup is limited by the file system, hence request less CPUs. * add missing binary states to flow charts and error catching fo future missing states * add verbose block, move return statement * add an escape option if value cannot be found in the grids (#385) * Population() fix for large memory usage when reading files (#386) * add an escape option if value cannot be found in the grids * Fix pd.read_hdf() memory usage + restructure code move select, tail and head into a DFInterface class from which History and Oneline inherit * add init parameter. fix copy bug + generalise (html) repr. * add missing return in Oneline.__get_item__() * replace Oneline slice selection with self.select() * Change docstrings - Add that you can only query where on the index or string columns. - Changed some wrongly named tables in the docstring - Change the example `where` selection. * Initial RLO boundary limit (#389) * Update limits_thresholds.py Add new threshold: MIN_COUNT_INITIAL_RLO_BOUNDARY * Update termination_flags.py Return the default if the initial RLO boundary isn't well enough populated. * Add warning * Update limits_thresholds.py Try larger value. * Small Population fixes (#390) * remove printing for intrinsic rate calculation + do not fail TransientPopulation calculation if empty population is created * fix channel grid_overplotting * Add docstring + change warning * add catch to suppress python warning in detached step (#392) * add warning catch to detached step * update comment * change POSYDON warning type * Add LBV_wind+dedt+hepulse rerun (#393) * Update posydon-run-pipeline enabled LBV_wind+dedt_hepulse rerun and updated associated SHA * Update pipeline_steps.rst added/updated descriptions for new rerun types * Update posydon-run-pipeline updated SHA for rerun after removing age limit stopping conditions * Update pipeline_steps.rst updated description for new hepulse rerun that removes stopping conditions for low mass stars based at TAMS/Hubble time * Update posydon-run-pipeline updated SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * remove failed states from flow and raise POSYDON errors instead * add more info to DCO error message * Update independent_sample.py (#394) Add default value for orbital_scheme and update doc-string * Update posydon-run-pipeline (#396) update SHA for hepulse rerun -- fixing seg faults that could occur when storing variables for point masses * Relax number formating for mesa inputs (#401) * Update posydon-run-grid Always use exponential writing for the `inlist_grid_points` and replace `e` by `d`, which is needed for FORTRAN. * Update posydon-run-grid Ensure, that only the float is in the replacement and adopt other cases where inputs for MESA are written. * Update IF_interpolation.py (#399) * Update IF_interpolation.py Updated k to be a minimum of 3 to prioritize smoothness * Update IF_interpolation.py so k is at least 3 * Update IF_interpolation.py refinement to make k = 3 * Update IF_interpolation.py * Update setup.py Add additional numpy requirement * Add "last" to TF12 for stable MT (#405) * update profile interpolation for consistency with paper (#397) * update for consistency with updated methods for paper * make nan warning more specific * make prediction inputs in linear space to match IF interpolation * add customizable nn shape to composition profiles * streamline Composition code for learn_bounds(), separate H-rich H-burning profiles from H-rich advanced burning profiles, add code to customize neural network shape for composition profiles * set up prediction framework for Composition that creates the 'H+He' profile first and subtracts H profile to get He profile * separate density profiles and composition profiles training * replace np.isnan with pd.isna * change InappropriateValueWarning to IncompletenessWarning in the case of nans in final values * typo * set random seed value to None by default to make it optional, update docstring * change 'lr' variable name to 'learning_rate' * added warning for if stars that should have a flat profile are not flat * eliminated redundant line * fixed docstring for density class * clarified the order of returned objects, added a condition for case where no models are selected for training * added returns so as to not exit functions after posydon warning * tie up loose ends * corrected issue with an error check specific to one parameter * small change to definition of scalars to comply with new pd command * fixed double equal sign that should be single equal sign * fix ref to predicted mass transfer classes * add empty array for predictions * fix issue with predictions * remove unnecessary print statement * rename "stripped_He_Core_H_burning" state and add to flow chart (#404) * stripped_He_Core_H * add "accreted_He_Core_H_burning" state * add rounding for surface_h1, center_h1 values when determining star state * move accreted_He state to list of HMS star states * fix plot defaults * add accreted_He_non_burning state * add states back to plot defaults * add "accreted_He_Core_He_burning" state * remove testing print statement * allow double He-rich star binaries in RLO to merge (#414) * update star states in step_SN (#416) * Automatic testing of installation (#425) * Create continuous_integration.yml Testing installation for mac, ubuntu, windows with python 3.11 (can add other versions). Automatically triggered for all PRs to development and main. * Create install_extras.yml scheduled weekly cronjob to test installation with all extras from setup.py * QA for installation test I am inserting a requirement for a nonexistent package just to make sure my automatic installation test workflow catches it. Will revert this change afterwards. * reverting change for QA it worked! reverting now * Update continuous_integration.yml removing windows * Update continuous_integration.yml remove windows condition * Update install_extras.yml remove windows * always initialize values for separation and orbital period in BinaryStar (#426) * add explicit separation and orbital period initialization in binarystar constructor * add catch if star masses are None * error catch for He-rich stars in RLO onto H-rich stars (#423) * add error catch for He-rich stars in RLO onto H-rich stars in detached step * minor changes * New normalized_pop_mass.py file (#376) * normalized_pop_mass * synthetic * authors added * space added * # added * if statement added * Replacing error with a Warning * df1,df2 added in binarypopulation.py * dataframe handling removed * changed from None to 0.0 * underlying mass calculation separate function * change sum to nansum * add checks for underlying_mass existence * simulated_mass not summed again for each loop * rename df and inclusion of f_bin_nature * inclusion of f_bin nature * getting single and binary mass from the independent sample option * modified warnings * binary fraction correction * store the calculated underlying mass to the file * updated doc-strings and making it consistent at case boundaries * correcting some typos and respecting the 80 characters line length --------- Co-authored-by: Dimitris Souropanis <qmh9626@quser31.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser34.quest.it.northwestern.edu> Co-authored-by: Max Briel <max.briel@gmail.com> Co-authored-by: Eirini <kasdaglie@ufl.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser33.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser32.quest.it.northwestern.edu> * Update README.md (#434) Add v2 paper * update installation test to include M1 and intel chips for macos (#428) * Update continuous_integration.yml add macos-14 github runner which uses the apple silicon M1 chip: https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ * Update continuous_integration.yml macos-13 runs on intel chip, macos-14 runs on apple silicon M1 chip * Update continuous_integration.yml changed the M chip specification from macos-14 to macos-latest * Add default legend titles based on the termination flag (#432) * add default legend titles based on the termination flag * typo * special case of SN_type, CO_type, state * change to release on publish (#452) * Update publish-to-anaconda.yml (#455) * small fix to BBH selection function (#403) * small fix to BBH selection function * rename spin_orbit_tilt to spin_orbit_tilt_at_merger * add docstring info + change function name (not called anywhere) * Tutorial updates with recent PRs + feedback from collaboration meeting (#406) * normalized_pop_mass * synthetic * authors added * space added * # added * if statement added * Replacing error with a Warning * df1,df2 added in binarypopulation.py * dataframe handling removed * changed from None to 0.0 * underlying mass calculation separate function * change sum to nansum * add checks for underlying_mass existence * simulated_mass not summed again for each loop * rename df and inclusion of f_bin_nature * inclusion of f_bin nature * getting single and binary mass from the independent sample option * modified warnings * binary fraction correction * store the calculated underlying mass to the file * remove note on mpi4py installation on tutorial" * update 10 binaries tutorial * remove mpi4py todo. Installtion only required for multi-core MESA runs * add FAQ answer for select columns error: * consistent naming of channels * update default parameters" * Update popsyn script to 5G default * add custom flow example * add memory usage FAQ * add custom step and flow in notebook * change focus of debug population on evolving single binaries * add references to new notebook * remove output of cells; should be added back to make nicer notebooks * clean tutorial output * add additional FAQ and installation issue * clean up documnation for population params file, SingleStar, and BinaryStar * additional changes * change tutorial to 10 binaries + 1 metallicity, as per discussion * remove reference to personal datapath * cleanup bbh notebook * add warning about default values * Update normalized_pop_mass.py make it the same as development. * Update normalized_pop_mass.py * implement comments Matthias + Seth * fixed additional comment * additional missed comments * Update custom_step_and_flow.py * Update step_CEE.py * Update population_params.rst add warning_verbose and error_checking_verbose * Update population_params_default.ini Add error_checking_verbose and warnings_verbose * Update code-questions.rst Add papers + remove example approximation. --------- Co-authored-by: Dimitris Souropanis <qmh9626@quser31.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser34.quest.it.northwestern.edu> Co-authored-by: Eirini <kasdaglie@ufl.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser33.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser32.quest.it.northwestern.edu> * Update step_merged.py (#457) Turn print into ModelError, because variables are otherwise undefined. * fix log vs log10 typo (#460) In the MD/MF metallicity fraction calculation, there was a typo for the outer bin in transforming the absolute metallicity into a log10 value. It was log, but should be log10! * remove "redirect" steps from history dataframe (#421) * skip redirect steps when appending to binary history and step names * skip appending step_times for redirect steps * add "history_verbose" option * add missing verbose params to default .ini file * handle history_verbose setting for all step hooks * remove history_verbose check from pre-step hooks * update docs and .ini file with history_verbose parameter * Merge branch 'development' into camille_remove_redirect_from_df * update binary_star docs * Start to get unit tests back: utils (#382) * rename rae2a to rad2a * add unit_tests: readme, test_constants.py, test_limits_thresholds.py * add template * add authors to ignorereason.py * add test_ignorereason.py * add test_posydonerror.py * edit docstring * add test_posydonwarning.py * update readme * add test_data_download.py * transfer to pytest (outstanding: test_posydonwarning.py, test_data_download.py) * account for the comments of Max * transfer test_posydonwarning.py to pytest * transfer test_data_download.py to pytest * add configfile.py * cleanup * Create test_installation.py using this as a simple example to try out automated testing framework * Create continuous_integration.yml Automatic trigger for tests (currently just installation but can include any combination) for PRs created to main or development. Tests on ubuntu, mac, and windows environments. Currently just testing python 3.11 but can add other versions if desired. * Update continuous_integration.yml fixed path to installation test file * Update continuous_integration.yml making mac the first test out of the three OSes * Delete posydon/unit_tests/test_installation.py realized this could just be included in the github workflow * Update continuous_integration.yml changed to include full posydon installation step to remove redundancy. Currently including all extras in the setup.py but can remove any if needed. * Update continuous_integration.yml removing extras from the every-PR test. I'll move them to a weekly test instead. * Create install_extras.yml scheduled cron job testing installation of setup.py extras, every sunday * Update continuous_integration.yml * Delete .github/workflows/install_extras.yml * Delete .github/workflows/continuous_integration.yml * add test_gridutils.py * add test_common_functions.py * update doc * merge development and update tests; include test in continuous_integration.yml * add pytest/cov install to continuous_integration.yml * add posydon install to unit test run * Change to environment python version For some reason, the environment `pytest` command doesn't get overwritten correctly with the local runner environment one. Probably because the PATH order is weirdly set. Running `pytest` through `python -m` works. * add environment varable exports * Update continuous_integration.yml clarify step name for CI * remove old code * Update continuous_integration.yml adding a piece to enforce minimum coverage of 100% of specified code when running the tests. if the coverage is below 100%, pytest will exit and the github action will fail. 100% coverage means that every line of code of posydon.utils (as specified in --cov=posydon.utils) is run at least once in the test suite execution. * Update README.md typo * Update README.md clarify language about QA for tests * Update README.md typo * Update README.md added info about enforcing 100% coverage in the pytest command * add more about predefined fixtures to the README * comments till test_read_histogram_from_file * comments on test_read_histogram_from_file * comments till test_CO_radius * deal with comments till test_calculate_core_boundary * remaining comments in test_common_functions.py * finish addressing first round of comments by Max * use np as alias for totest.np * fix typo in data_download.py * fix typo in test_common_functions.py * fix typo in docstring of common_functions.py * fix typo in test_common_functions.py * fix typo in common_functions.py * Update test_common_functions.py change naming of data examples to be more descriptive * Update test_common_functions.py fix bug caused by extra spaces * add comments and more names * remove unused bad_profile2 * more cleanup * follow PEP8 strictly, reset attributes calculated for CEE --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * period_change_stabe_MT -> period_change_stable_MT (#467) * PSygrid force int input (#440) * PSygrid force int input force the user to input an integer. This includes numpy versions of int. If this is not forces, the `initial_values` and `final_values` can be loaded with a 1 value array/list, but the `history1`, etc are not loaded with that input. As a result, `None` is returned for those and it looks like the history is empty. * add extra check for `contains` raises an error in index in `__contains__` and `__getitem__` is not an integer * Change error type of IndexError Preferred way to raise error: """if key is a value outside the set of indexes for the sequence (after any special interpretation of negative values), IndexError should be raised. For mapping types, if key is missing (not in the container), KeyError should be raised.""" https://docs.python.org/3/reference/datamodel.html#object.__getitem__ * change to 'index' * edited docstring to match arg name --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * Backpropagate changes on main/max_requirements into development (#456) * Update README.md * Update install.rst * Update install.rst * Adding an option to create a VH diagram w/ BinaryStar objects (#158) * Adding an option to create a VH diagram w/ BinaryStar objects * Update VHdiagram.py * Update VHdiagram.py --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update README.md - main (#188) * Update README.md Update the readme to remove the installation instructions so that we do not have to maintain the same instructions in two places. Currently, the instructions in the readme are not the same as the ones in the documentation. * Update README.md I also edited the text to match the deve version * V1 python_utils fix (#191) * add python_utils==3.5.2 requirement * Update setup.py Limit `more-itertools` to its latest python3.7 version. * Update V1 conda setup (#199) * update conda dependencies for latest python3.7 packages dependencies + remove pyqt5 dependency * update astropy + pyqt5 versions * change pyqt to 5.15.4 * Updates in installation instructions in the V1 documentation (#201) * Updated installation instructions in the v1 documentation * Simplifying sections and removing git-lfs mention * Update install.rst * No change? * Adding OSX-ARM installtion instructions. * Update install.rst Add the conda channels to the OSX-ARM architecture --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * conda_v1 fix (#266) * change dependencies to have a maximum and release the numpy dependency * add maximum to setup.py too * point to updated GH action * Change numpy dependency * fix * change numpy version in setup.py too * solving for an old sk-learn numpy issue * Update publish-to-anaconda.yml (#270) changes publish-to-anaconda to development version. * update v1 for scikit-learn version (#292) * update v1 for scikit-learn version * Update setup.py * Update meta.yaml numpy 1.20 deprecates "np.float", which exists in v1 code * Update setup.py * Update conda version number (#304) This is required to publish Elizabeth's changes to conda * fix maximum requirements * fix scikit-learn version and remove email from AUTHOR_EMAIL. * v1 in mesa_dir the search for "v1/" should be in the full mesa_dir not the dirname * update zenodo link and md5 hash * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * Update meta.yaml * Update meta.yaml * change publish-to-anaconda to publish on a github release publish * typo fixed in documenation * Change installation instructions to specifically request v1.0.4 (#450) * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * publish only to anaconda on releases * fix found typos in v1 documentation * Update publish-to-anaconda.yml (#454) Point towards POSYDON-code/ version of the publish-to-anaconda action. * remove redundant lines in post_processing.py * add e-mail to setup.py * remove updated VH Diagram plotting code for a single binary. Surrounding code has change, see PR#456. * change default mem_per_cpu to 7G" * update version + installation instriction + link to releases + zenodo --------- Co-authored-by: Simone Bavera <32518238+ssbvr@users.noreply.github.com> Co-authored-by: sgossage <seth.gossage@cfa.harvard.edu> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: tassos25 <tassos25@users.noreply.github.com> Co-authored-by: Konstantinos Kovlakas <22239544+kkovlakas@users.noreply.github.com> Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * update zenodo url and md5 (#470) Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * error check for undefined states in BinaryStar (#468) * add error check for undefined states in BinaryStar, add undefined states to flow chart * update posydonerror unit test * update unit test again * remove BinaryStar and SingleStar from posydonerror, move initcond message to BinaryStar * fix unit tests again * Update step_merged.py (#480) Import ModelError in step merged. * No check for WD formation in double CE case (#484) * Update common_functions.py Move double CE into contact detection and return afterwards to skip checks on WD formation. * add tests which would fail on the old code * handle H-rich RLO binaries and clarify verbosity of detached step (#430) * clean-up code and clarify verbosity of matching in detached step * reorganizing some code in detached step, clarifying verbose output * fix bug in matching, add criteria to check for HMS-HMS-RLO binaries in detached step * add list of step names to SimulationProperties * add separate error catch for HMS-HMS binaries in RLO in detached step * Merge remote-tracking branch 'origin/development' into camille_matching_strippedHe_to_Hrich * add ClassificationError to unit tests * remove space at end of line in unit tests * fix unit test * remove classification error from unit tests * fix classification error * fix line length in test_posydonerror.py * Grid slice plotting system selection fix (#475) * replace selection + add docstring * Update plot_pop.py changes: - plot_extension doc string - prop description if None * add missing binaries to UNDEFINED_STATES in flow chart (#489) * add missing binaries to UNDEFINED_STATES in flow chart * add WD systems to undefined states * add for loop for undefined states in flow chart * separate IMFs + create basic tests * add pytest.approx around remaining values * move salpeter tests into its own class * add Kroupa2001 IMF and its unit tests * add flat_mass_ratio dist and Sana12 period * Update issue templates (#491) * Update issue templates * Update bug_report.md * add temp norm_pop.py file to restructure underlying_mass calculation * add single star contribution, works for f_b=1 in sample. Unclear if f_bin!=1 in sample works correctly in original version * Update installation-guide.rst to include note about adding conda-forge (#495) * Update installation-guide.rst to include note about adding conda-forge I came across an issue related to installation. It turns out that many of the required packages specify versions only available on conda-forge which can cause a huge headache for unaware users. I have updated the installation documentation to include this note. * Adding conda-forge documentation to troubleshooting page --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> * add 'm*' to simulation weight * Protect run_psycris_sequence, from misc imports (#436) * add dunder main to run_psycris_sequence, add type checks to cmd args * Add some docs * Delete random file * additional comments in norm_pop * add more dump_rate info to docs (#500) * add dump_rate info to docs and ini file * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * Update population_params.rst * Update code-questions.rst * Update population_params_default.ini --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * replace scipy interp1d with alternatives (#433) * replace all instances of interp1d except for in profile interpolation * remove interp1d from common functions unit test * add parameter type checks to rejection sampler * changes to common functions unit testing * fix unit test * fix unit tests again * define own interp1d and revert replacements * clean out white spaces * replace interp1d in profile_interpolation * readd ClassificationError * add fill_value, left, and right * cleanup * remove import * Update interp1d to include option for fill_value="extrapolate" * edit error message for fill_value * Update test_interpolators.py to include fill_value="extrapolate" * update all to ndarray; add missing unit tests * fix docstring * correct description --------- Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * Add support for unsorted input in new interpolators (#502) * add check for increasing or decreasing arrays. Flip accordingly * add unit test for flipping + add check for x,y being None * remove None check * shuffle stuff around * move tests to init * use np.flip to create a copy of the original data instead of a flipped view. Just in case the data gets changed along the way * implement suggestions * add sorting for non-monotonic values. Required for some step_SN parameters * Update test_interpolators.py * fix typo --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * replace NaN/None in input chi_eff calculation with 0 (#501) * add nan checks for spins + tilts * add docstring * remove np.ndarray wraping" * implement comments on using pd.na: * Update transient_select_funcs.py remove empty line generalize warning text * Update transient_select_funcs.py --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * updating the data_download routines slightly (#496) * updating the data_download routines slightly * Fixing unit tests accordingly * Fixing one more unit test * Adding comment to force unit tests to re-run * Added DataError as a POSYDONError and included raise DataError for missing PATH_TO_POSYDON_DATA environmental variable * revert DataError and use NameError; add unittest * Use FileExistsError --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * rewrite of normalisation into separate components * add TODO+warning that alpha needs to be changed back for the Salpeter IMF * Use of `PATH_*` variables (#505) * update and test config * always import PATHs from config * put the downloaded data on the path without POSYDON_data * use dirname, where POSYDON_data should be skipped * debugging * debugging * use os.path.join * cleanup * Update config.py docstring * Fixes to Troubleshooting & FAQ Docs (#517) * initial read-through fixes * more changes to code-questions docs * Update docs/_source/troubleshooting-faqs/code-questions.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/troubleshooting-faqs/code-questions.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * replace @ symbol --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Add files to installation (#526) * add init files to detect packages; include files in MANIFEST.in * add comment * Fix logic flow in matching (#521) * fix logic flow in matching, clarify matching verbose output * add "center_h1" to matching verbose output * make if/else checks and flow more consistent * add accreted_He_Shell_H_burning stars to flow, detached step (#522) * Issues with undefined values of SN_MODELS (#482) * Update step_mesa.py replace undefined variable key and check fv for CO_type * Update step_mesa.py Check for key and otherwise show warning and set value to None. * Update step_SN.py np.isnan -> pd.isna * Update step_mesa.py change None to np.nan * Update step_mesa.py Set model to None. * Update step_mesa.py ensure None is not overwritten * add end of step prints for verbose * typo * use pa.notna * replace isnan (#527) * Fix logic for single star fraction population normalisation (#509) 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`. * Pulsational Pair-Instability top-down mass loss approach (#417) * 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 * Blandford-Znajek jet energy calculation (#429) * 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> * Split popsyn plotting into separate components for future modularity (#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 (#532) * 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> * replace underlying mass calculation with probability reweight per model * move binary fraction into PDF * remove unneccesary lines * add calculate_model_weights separate * add additional error for impossible reweights * add basic tests for normalisation. These tests reweight a population and sample from the requested reweight population. Then it compares a selection in both populations to see if they're close. I performed a convergence test on the method implemented and the final results converge. * remove old tests * rename func call * add Chabrier2003 IMF * restructure code to an abstract class with sub-classes and add unit_tests for Chabrier IMF * add actual new tests * add Chabrier IMF tests" * dynamical find IMF (primary mass scheme) based on available ones in IMFs.py * add unit tests for the sub-functions in norm_pop.py * add docstrings to different IMFs * small cleanup/addition * flip notation * alter Kroupa2001 IMF calculation * remove old test_weights file * Update setup.py (#536) sphinx at least 8.2.2 * GitHub action fix (#537) * change to v4 * add to CI for testing checkout and setup python versions * change other versions to 'latest' * Update MESA-grid tutorials (#535) * 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 * Modular data download (#507) * 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> * Decouple ECSN treatment from SN_MODELS (#504) * 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 (#512) * add WDs to infer_star_state, incl. testing and new limits * add references * Update setup.py (#541) change >3.10 to >=3.11 * Upgrade setuptools (#542) * create new pyproject.toml; try to reuse setup.py as much as possible * add refs * implement self.mbreak suggestion: * remove duplicate line * change name + pass func * add Return explanation to docstring * cleanup + add period_PDF function. Not yet in weights * set post SN binary to disrupted in case there is a massless_remnant (#548) * Update population_params_default.ini (#544) Update to give the correct usage for the engine if 'other' mechanisms are used * Add check for valid MODELS in posydon-setup-popsyn (#545) * add check for valid MODELS before popsynth setup script runs * move repeated code into a separate function in the MODELS.py file * move repeated code into a separate function in the MODELS.py file * Update posydon/grids/MODELS.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * add the option to add kwargs to primary_mass scheme * add an option to pass parameters to the IMF PDF creation for customisaion of the IMF slopes/breaks etc * Add total_mass_h1 and total_mass_he4 (#529) * add total_mass_h1 and total_mass_he4 (utils, vis not yet checked) * add values to plot defaults * update doc * copy bug correction from PR435 * exclude accreted_He_Core_H_burning state from HRD for single stars * rework model weights in the TransientPopulation to account for double indices in the TransientPopulation * clean up files * add fix for flipped masses in the sampling. Probably because the system was flipped by the population synthesis * add correct size for tmp_model_weights when setting a chunksize smaller than the total population * remove old function + add coverage setting file * add docstrings * Add unit tests: grids (#435) * rename rae2a to rad2a * add unit_tests: readme, test_constants.py, test_limits_thresholds.py * add template * add authors to ignorereason.py * add test_ignorereason.py * add test_posydonerror.py * edit docstring * add test_posydonwarning.py * update readme * add test_data_download.py * transfer to pytest (outstanding: test_posydonwarning.py, test_data_download.py) * account for the comments of Max * transfer test_posydonwarning.py to pytest * transfer test_data_download.py to pytest * add configfile.py * cleanup * Create test_installation.py using this as a simple example to try out automated testing framework * Create continuous_integration.yml Automatic trigger for tests (currently just installation but can include any combination) for PRs created to main or development. Tests on ubuntu, mac, and windows environments. Currently just testing python 3.11 but can add other versions if desired. * Update continuous_integration.yml fixed path to installation test file * Update continuous_integration.yml making mac the first test out of the three OSes * Delete posydon/unit_tests/test_installation.py realized this could just be included in the github workflow * Update continuous_integration.yml changed to include full posydon installation step to remove redundancy. Currently including all extras in the setup.py but can remove any if needed. * Update continuous_integration.yml removing extras from the every-PR test. I'll move them to a weekly test instead. * Create install_extras.yml scheduled cron job testing installation of setup.py extras, every sunday * Update continuous_integration.yml * Delete .github/workflows/install_extras.yml * Delete .github/workflows/continuous_integration.yml * add test_gridutils.py * add test_common_functions.py * update doc * merge development and update tests; include test in continuous_integration.yml * add pytest/cov install to continuous_integration.yml * add posydon install to unit test run * Change to environment python version For some reason, the environment `pytest` command doesn't get overwritten correctly with the local runner environment one. Probably because the PATH order is weirdly set. Running `pytest` through `python -m` works. * add environment varable exports * Update continuous_integration.yml clarify step name for CI * remove old code * start unit tests for grids * add test_termination_flags.py * include new test in CI * fix CI * add test_scrubbing.py * add test_MODELS.py * add test_io.py * make test flexible for different OS * add test_downsampling.py * start with test_psygrid.py * np alias, file+path * more tests on psygrid * small corrections * adopt style * test_join_grids * add/edit docstrings and continue on PSyGrid tests * generate test MESA gird * decide_columns * more special cases of MESA runs * further grid tests * more grid tests * tests till 70 percent coverage * more gird tests * test till 71 percent * finish tests for _create_psygrid * more tests; clarify errors; restructure PSyGrid for testing * correct typo * workaroud for test interactions * more tests * add Error for new_mesa_flag * cleanup * finish PSyGrid class * finish test_psygrid.py, beside one todo * more checks on PSyGrid creation * add first tests of post_processing * remove old test * cleanup * check more errors * more test on post_process_grid * finish PR * cleanup * add SN data to unit tests to avoid download * Update posydon/unit_tests/README.md Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update posydon/unit_tests/README.md Co-authored-by: Seth Gossage <sethg45@gmail.com> * merge development, resolve conlicts, and update README * reword error message of wrong index * make test for missing and new objects more detailed * add Runtimeerror in case a system tool does not work as expected * add fixture to link temporarily SN data if needed --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * remove .coveragerc, because it causes the tests to fail. Put in a different PR * add test_get_MODEL_NAME (#553) * Mesa api doc (#520) * Update fixed.rst Fixing typos and grammar errors in Run a fixed mesa grid * Update inifile.rst * Update inifile.rst * Update fixed.rst typo fix * Update dynamic.rst Change the TODO * Update fixed.rst Bold text * bold removed * ini file replaced with .ini file * Update fixed.rst Changing the ini file to be consistent with other docs * Update inifile.rst changing the ini file * Update dynamic.rst Adding Kyle's paper and POSYDON mailing list * Update docs/_source/components-overview/mesa_grids/fixed.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: dimsour94 <dimitris.souropanis@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Rename step9 to stepF (#558) * rename step9 to stepF * update example INI files * Add conda install of mpi4py (#556) Additionally add macos-13 to run on * FAQ about slow `conda` (#551) * add FAQ about installation instructions * Update installation-issues.rst * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update installation-issues.rst --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Seth Gossage <sethg45@gmail.com> * conform to 80 character limit * add missing doc strings * add valueerror * remove old normalised_pop_mass functions * change to monkey patch * change to np.array return * add m_min m_max checks * use monkeypatch fixture * adapt tests based on comments * implement comments * conform to 90 character line limit * include comment * clean up * fix monkeypatch * add additional mass ratio PDF option + adapt test for it * add unit test invalid mass_ratio scheme defaulting to flat q * add positive mass warning * add CI for IMFs and norm_pop * remove period PDF * correct writing to dataframe * remove deprecated import * fix missing imports * Unifying the code for finding grid boundaries and checking validity in case of ignored data. (#271) * Automatically find boundaries of the grid at the superclass, to avoid code repetition. * Removing unused variable. * Correcting (visual) indendation issues. * Do not use ignored and failed runs to determine the grid boundaries. * Adopting suggestions regarding variable names. * Add check that profile is well defined in SN (#559) * add check for profile * add seth's suggestions * Add posydon-popsyn setup, check & rescue (#550) Renames the `posydon-setup-popsyn` CLI to `posydon-popsyn` and implements the sub-commands `setup`, `check`, and `rescue`. - `setup` performs the setup of a population synthesis run, as before. - `check` verifies a population run and checks if the requested number of binaries is present. - `rescue` allows the user to create resubmission files for failed Slurm array jobs. [commit changes] * restructure + add run check script * rename + adding the rescue option * Add resubmit_slurm.sh submission options * update tutorial with new command name + add new commands * add check if there are failed jobs or not * remove unused imports * add empty missing_indices * update run in rescue script * change path + merge job name * implement comments and improvements from Matthias * 80 character limit + additional doc strings * remove required for already required input * added output for other output too * Update posydon-run-pipeline (#569) * update docs: installation, processing pipeline, ML components (#513) * Update installation-guide.rst -fix typo "instractions" -move environment variables step ahead of download posydon data, which requires the variables to be set * Update pipeline_steps.rst fix typo "girds" * Update processing-pipeline.rst * Update processing-pipeline.rst * Update psygrid.rst for language * fix typo * fix typos * add spaces for readability * Update psygrid.rst language for clarity * Update pipeline_ini.rst Found small typos and made small changes for clarity. I think a lot of this could be rewritten for clarity, but I don't understand this part of the code enough to do that. * Update machine-learning-components.rst Typos * Update initial_final_interp.rst minor changes to IFInterpolator * Update initial_final_interp.rst Typo * Update psygrid.rst to put quotation marks back in to denote strings for the keys * change .ini to *.ini * Update machine-learning-components.rst typo * Update psygrid.rst language for clarity * Update psygrid.rst language for clarity * Update installation-guide.rst for copy edits * add arguments table for join_grids * fix table * fix table * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/components-overview/post_processing/psygrid.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * clarify grid config properties vs physical grid properties * Update posydon-run-pipeline for typos * Update pipeline_steps.rst * Update pipeline_steps.rst language for clarity * Update single_star.rst change star state example * Update binary_star.rst updating star states * Update custom_hooks.rst fix spacing in code example * Update pipeline_steps.rst language for clarity * limit lines to 80 characters * Update pipeline_steps.rst * restrict lines to 80 characters * restrict lines to 80 characters * restrict to 80 characters per line * Update pipeline_ini.rst for line length * Update initial_final_interp.rst for line length * Update pipeline_steps.rst style fix * Update psygrid.rst for style * Update pipeline_ini.rst * Update pipeline_steps.rst for style consistency * Update pipeline_additions.rst for style consistency * Update processing-pipeline.rst for style consistency * Update initial_final_interp.rst for style consistency * Update ProfileInterpolator.rst * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update pipeline_additions.rst for line length * Update pipeline_steps.rst for line length * Update psygrid.rst for line length * Update pipeline_ini.rst for line length * Update initial_final_interp.rst for line length * Update initial_final_interp.rst * Update ProfileInterpolator.rst for line length * Update machine-learning-components.rst for line length * Update pipeline_steps.rst * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update initial_final_interp.rst * Update machine-learning-components.rst --------- Co-authored-by: Philipp Moura Srivastava <philipp.msrivastava@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Kyle Rocha <48293898+ka-rocha@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * Move bin code to utils: compress-mesa (#564) * move code * bug fix * add first tests; restructure command line arguments * outsource helper functions for tests * verbose check * finish test_compress_dir * finish test_set_up_test * take care of comments by Max * add docstring to get_size * add more docstring * add suggestions by Seth * Update install_extras.yml (#576) * Update install_extras.yml (#578) * POSYDON docs build multiple version (#554) * add versioning + automatic fetching of docs * comment out deploy action * remove git fetch * cleanup * remove PATH_TO_POSYDON * add MESA_DIR and PATH_TO_POSYDON_DATA * add reinstall for autodoc * do v1 generation * add v2 + install wheel for python 3.9 * positive grep * add wheel install v1 + remove from v2 * remove development for now * use as path * change out folder * add * change build_path * change build_path again * change checkout + path * add v1 & v2 make documentation * update _build for v1 documentation * show current version in documentation instead of latest * rename folder * remove old unused unstable workflow * Update docs/_source/conf.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * typo * fix typo * remove development doc make from release * remove v2.0.0-dev tag from version TAG list * remove dry-run commands * add v1 and v2 distinction + treat v2.0.0-dev as an indicator for development creation * force remove dirty for current version doc build, because copying files into version necessary * fix * link cleanup * add injection grab * move subprocess * add current version * change old_tags name * change posydon_version old tag version * posydon cleanup too * only apply injection to old v2 verions * add dry-run back in * template -> templates * add symlink process to latest release version * check for all dev tags of v2.X.X versions Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * implement comments * check for latest non-pre-release version * Update .github/workflows/deploy-github-pages-release.yml Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update .github/workflows/deploy-github-pages-release.yml Co-authored-by: Seth Gossage <sethg45@gmail.com> * remove dry-run --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * Hotfixes new documentation build (#585) * Add fetch-tags:true Currently, not all the tags from Github are correctly pulled in this workflow, as such the code fails. * add v for folders + links to make all consistent * Add v for folder creation and in linkage * posydon-popsyn multi-jobID fix (#581) If multiple population synthesis reruns are present, the jobID check was returning a list of one. This should have just been the jobID. This corrects that selection. * Hotfix documentation-build again (#588) Another fix to the building of the development version. This time, entering the git folder I don't understand why this worked locally with Local Github Actions (act) and not on the actual Github Actions. Is the workflow different? * add fetch-depth:0 to documentation workflows (#593) * Bump miniconda version to v3 and add proper bash shell initiation (#594) * bump miniconda version to v3 and add proper bash shell initiation * clean up * remove sourcing conda; already done with bash -el * add pip upgrade back * Update install_extras.yml * remove check on PR * Change ECSN default to Tauris+15 (#571) * change ECSN default and comment defaults in MODELS * function: get_MODEL; update tests * Update population_params_default.ini Add allow_spin_None to default ini file. * Update posydon-popsyn add verbose_on_fail * get at least mass in get_initial_BH_properties * update docs * adopt pre defined SN models; rename MODEL to SN_MODEL * adjust test mass to give BHs; rename prop * update population_params_default.ini to default SN model * change values for Farag matching * refer to v2 interpolators * add back Sukhbold+16-engine * Add supernova engine (#597) * Update SN_MODELS.py Add S19.8 engine, rename SN_models for easier addition of more changes * update docs and ini files * rename SN_models * Add eccentricity as option for parsing grids (#575) * update absolute imports and default ini with some docs * Changed grids.io to parse mesa grid dirs with changing eccentricity * Removed hotfix comments for PR * remove spurious spacing * Updating unit test to correspond to initial eccentricity in filename * Update posydon/unit_tests/grids/test_io.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * change output folder (#595) * F2 f population docs (#525) * Update 10_binaries_pop_syn.ipynb Fix typos * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb test * Update lgrb_pop_syn.ipynb * Update pop_syn.ipynb * Update pop_syn.ipynb * Update bbh_analysis.ipynb * Update custom_step_and_flow.ipynb * Update docs/_source/tutorials-examples/population-synthesis/bbh_analysis.ipynb Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/tutorials-examples/population-synthesis/bbh_analysis.ipynb Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update pop_syn.ipynb * Update bbh_analysis.ipynb - more verbose * Update bbh_analysis.ipynb - clarity * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb clarity * Update bbh_analysis.ipynb addressing a few typos and clarity * Update lgrb_pop_syn.ipynb clarity * Update one_met_pop_syn.ipynb addressed typos and consistency with code updates * Update bbh_analysis.ipynb argument name update * Update one_met_pop_syn.ipynb typo * typo * Update evolve_single_binaries.ipynb typo * Update custom_step_and_flow.ipynb; adding clarity * Update custom_step_and_flow.ipynb small addition to last commit * Update custom_step_and_flow.ipynb * Update custom_step_and_flow.ipynb * some variables are not defined so I removed them. one is introduced later in the tutorial * maybe this change is wrong but I was unable to pip install .[vis] * Update - all but the last cell works with v2 population * added --account argument to posydon-popsyn Quest example. Without this, job submission will fail * Small typo fixes * add pending review changes --------- Co-authored-by: Monica Gallegos-Garcia <monicagallegosgarcia2024@u.northwestern.edu> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * Change supernova models (#598) * Update SN_MODELS.py change S19.8 to W20 * Update population_params_default.ini * Update population_params_end.ini * SFH bug fix, rewrite, and basic tests (#543) * combine SFR_Z_fraction and star_formation_rate into a single function call, which pre-calculate the multiplication for speed improvemen * add correct select_one_met in function * move SFH into separate classes with abstract inheritance * Move SFH to classes (with abstract treatments) + Add Chruslinska+21 SFH models * fix fSFR. Now sums correctly to 1 at each redshift. * add fSFR unit tests * add additional basic tests * fix double naming of SFR * add tests for new SFRs * remove old SFH code; not used anywhere * move std_log_metallicity_history * add dosctring for abstract class * add docstrings * rename variables * add more doc strings * add even more docs * more doc strings * add checks for required parameters in MadauBase * docstrings: * change name of SFR_per_met_per_z function * alter unit tests to adapt to previous changes * change ' to " * cleanup line lengths * change output fSFR and _call__ dosctring to ndarray * add check for model parameters required * restructure + integrate only between Z_min and Z_max + add option normalise * Z_max check * update the SFH to use Z_min and Z_max and normalise. Move the splitting per metallicity bin to its own function. Additionally, revamp the unit tests to be more in style with the other unit tests and adapt them for the new functions and treatment of the metallicity bins. * fix name typo * remove Z_max requirement for Chruslinska * implement Matthias comments * change to rates.MODEL * change comment * add test for get_SFR_per_met_at_z * make sure to test branches * add SFH tests * add space * remove duplicate lines in IllustrisTNG class * move ConcreteSFH into a fixture * Add support for Zmin and Zmax inside bins and inside the same bin. * add doc string + remove select_one_met * replace MODEL with SFH_MODEL * change DEFAULT_MODEL to DEFAULT_SFH_MODEL * add to default Zmin,Zmax=None + normalise=True * update docstrings: * clean up star_formation_history file * update unit tests + implement comments * update call method test * add std_log_metallicity_dist integer support * make explicit regex expression * update unit tests & implement remainder of comments Matthias * cleanup * warning cleanup * add SFHModelWarning + add sort check * change to sphinx reference style * add reference * add check for None output in error * add unit test for unsorted Metalicity bins * suggested change * add new warning class to test * Update posydon/unit_tests/popsyn/test_star_formation_history.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update README.md (#599) * Update README.md * Apply suggestions from Seth Co-authored-by: Seth Gossage <sethg45@gmail.com> --------- Co-authored-by: Seth Gossage <sethg45@gmail.com> * Changes in the MESA documentation (#524) * minor text change in 'I. Running your first MESA simulation using POSYDON' * changes up to 'Run one binary on your laptop for debugging' where I had error with work_dir * partial changes to the tutorial * small last changes in the documentation * adding matthias comment on work dir * Update docs/_source/tutorials-examples/MESA-grids/laptop.ipynb typo Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Re-writing step-CE for improved flow and logic (#574) * change the core radius for the stableMT option * Updating step_CEE.py * Re-writing step_CEE alpha_lambda prescription code * Updating code * updating common_functions list of functions to test * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Removing core_not_replaced_noMT option from documentation * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Updating mass loss due to merger in CEE * Update common_functions.py * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update step_CEE.py * Update step_CEE.py * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Updated due to code review comments and changing CE function names * Missed this previous update * Updating documentation * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update posydon/unit_tests/utils/test_common_functions.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Moving from double quotes to single quotes * Update posydon/binary_evol/CE/step_CEE.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * fix option names as Zepei reported * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * add compt_type to CEE_adjust_binary_upon_merger as requested by me and Max --------- Co-authored-by: ZepeiX <Zepei.Xing@unige.ch> Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * Check for array-like data in `BinaryStar.to_df()` in case of failed binaries (#580) * Update binarystar.py adding a check for array like data and pad w/ nans as before, but with the right data type * Update binarystar.py operate on column element rather than the column itself * Update binarystar.py rename data_len to element_len * initialize V_sys as numpy array, rather than list, to match subsequent data types * added new dtypes in popsyn/io.py: object.string and object.float64 to differentiate subtypes of objects. Dynamically determine filler values when extending failed binary data columns * remove debug print statements and also add in default case if somehow a data column key does not exist in dtype dictionary * remove max_ele_length initialization, superfluous * added new sub dtype dictionary in popsyn/io.py to hold specs on dtypes within an object, now default to NoneTypes in case a definition is not found, which is converted to nan in case of single values (not objects), also now nearest_neighbour_distance is initialized as a float array rather than a string array * added empty string definition for cases of missing dtype definitions * Update posydon/binary_evol/binarystar.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update posydon/binary_evol/binarystar.py Co-authored-by: mkruck…
* TransientPopulation overplot crash fix (#374) * check if no binaries are selected for the slice to mitigate crashing * Update plot_pop.py space change * fix get_redshift_from_cosmic_time() function (#381) * Replace job_start for running grids (#380) * turn start+end to end+before_end+now * Reduce number of CPUs for cleanup jobs Usually, cleanup is limited by the file system, hence request less CPUs. * add missing binary states to flow charts and error catching fo future missing states * add verbose block, move return statement * add an escape option if value cannot be found in the grids (#385) * Population() fix for large memory usage when reading files (#386) * add an escape option if value cannot be found in the grids * Fix pd.read_hdf() memory usage + restructure code move select, tail and head into a DFInterface class from which History and Oneline inherit * add init parameter. fix copy bug + generalise (html) repr. * add missing return in Oneline.__get_item__() * replace Oneline slice selection with self.select() * Change docstrings - Add that you can only query where on the index or string columns. - Changed some wrongly named tables in the docstring - Change the example `where` selection. * Initial RLO boundary limit (#389) * Update limits_thresholds.py Add new threshold: MIN_COUNT_INITIAL_RLO_BOUNDARY * Update termination_flags.py Return the default if the initial RLO boundary isn't well enough populated. * Add warning * Update limits_thresholds.py Try larger value. * Small Population fixes (#390) * remove printing for intrinsic rate calculation + do not fail TransientPopulation calculation if empty population is created * fix channel grid_overplotting * Add docstring + change warning * add catch to suppress python warning in detached step (#392) * add warning catch to detached step * update comment * change POSYDON warning type * Add LBV_wind+dedt+hepulse rerun (#393) * Update posydon-run-pipeline enabled LBV_wind+dedt_hepulse rerun and updated associated SHA * Update pipeline_steps.rst added/updated descriptions for new rerun types * Update posydon-run-pipeline updated SHA for rerun after removing age limit stopping conditions * Update pipeline_steps.rst updated description for new hepulse rerun that removes stopping conditions for low mass stars based at TAMS/Hubble time * Update posydon-run-pipeline updated SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * remove failed states from flow and raise POSYDON errors instead * add more info to DCO error message * Update independent_sample.py (#394) Add default value for orbital_scheme and update doc-string * Update posydon-run-pipeline (#396) update SHA for hepulse rerun -- fixing seg faults that could occur when storing variables for point masses * Relax number formating for mesa inputs (#401) * Update posydon-run-grid Always use exponential writing for the `inlist_grid_points` and replace `e` by `d`, which is needed for FORTRAN. * Update posydon-run-grid Ensure, that only the float is in the replacement and adopt other cases where inputs for MESA are written. * Update IF_interpolation.py (#399) * Update IF_interpolation.py Updated k to be a minimum of 3 to prioritize smoothness * Update IF_interpolation.py so k is at least 3 * Update IF_interpolation.py refinement to make k = 3 * Update IF_interpolation.py * Update setup.py Add additional numpy requirement * Add "last" to TF12 for stable MT (#405) * update profile interpolation for consistency with paper (#397) * update for consistency with updated methods for paper * make nan warning more specific * make prediction inputs in linear space to match IF interpolation * add customizable nn shape to composition profiles * streamline Composition code for learn_bounds(), separate H-rich H-burning profiles from H-rich advanced burning profiles, add code to customize neural network shape for composition profiles * set up prediction framework for Composition that creates the 'H+He' profile first and subtracts H profile to get He profile * separate density profiles and composition profiles training * replace np.isnan with pd.isna * change InappropriateValueWarning to IncompletenessWarning in the case of nans in final values * typo * set random seed value to None by default to make it optional, update docstring * change 'lr' variable name to 'learning_rate' * added warning for if stars that should have a flat profile are not flat * eliminated redundant line * fixed docstring for density class * clarified the order of returned objects, added a condition for case where no models are selected for training * added returns so as to not exit functions after posydon warning * tie up loose ends * corrected issue with an error check specific to one parameter * small change to definition of scalars to comply with new pd command * fixed double equal sign that should be single equal sign * fix ref to predicted mass transfer classes * add empty array for predictions * fix issue with predictions * remove unnecessary print statement * rename "stripped_He_Core_H_burning" state and add to flow chart (#404) * stripped_He_Core_H * add "accreted_He_Core_H_burning" state * add rounding for surface_h1, center_h1 values when determining star state * move accreted_He state to list of HMS star states * fix plot defaults * add accreted_He_non_burning state * add states back to plot defaults * add "accreted_He_Core_He_burning" state * remove testing print statement * allow double He-rich star binaries in RLO to merge (#414) * update star states in step_SN (#416) * Automatic testing of installation (#425) * Create continuous_integration.yml Testing installation for mac, ubuntu, windows with python 3.11 (can add other versions). Automatically triggered for all PRs to development and main. * Create install_extras.yml scheduled weekly cronjob to test installation with all extras from setup.py * QA for installation test I am inserting a requirement for a nonexistent package just to make sure my automatic installation test workflow catches it. Will revert this change afterwards. * reverting change for QA it worked! reverting now * Update continuous_integration.yml removing windows * Update continuous_integration.yml remove windows condition * Update install_extras.yml remove windows * always initialize values for separation and orbital period in BinaryStar (#426) * add explicit separation and orbital period initialization in binarystar constructor * add catch if star masses are None * error catch for He-rich stars in RLO onto H-rich stars (#423) * add error catch for He-rich stars in RLO onto H-rich stars in detached step * minor changes * New normalized_pop_mass.py file (#376) * normalized_pop_mass * synthetic * authors added * space added * # added * if statement added * Replacing error with a Warning * df1,df2 added in binarypopulation.py * dataframe handling removed * changed from None to 0.0 * underlying mass calculation separate function * change sum to nansum * add checks for underlying_mass existence * simulated_mass not summed again for each loop * rename df and inclusion of f_bin_nature * inclusion of f_bin nature * getting single and binary mass from the independent sample option * modified warnings * binary fraction correction * store the calculated underlying mass to the file * updated doc-strings and making it consistent at case boundaries * correcting some typos and respecting the 80 characters line length --------- Co-authored-by: Dimitris Souropanis <qmh9626@quser31.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser34.quest.it.northwestern.edu> Co-authored-by: Max Briel <max.briel@gmail.com> Co-authored-by: Eirini <kasdaglie@ufl.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser33.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser32.quest.it.northwestern.edu> * Update README.md (#434) Add v2 paper * update installation test to include M1 and intel chips for macos (#428) * Update continuous_integration.yml add macos-14 github runner which uses the apple silicon M1 chip: https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ * Update continuous_integration.yml macos-13 runs on intel chip, macos-14 runs on apple silicon M1 chip * Update continuous_integration.yml changed the M chip specification from macos-14 to macos-latest * Add default legend titles based on the termination flag (#432) * add default legend titles based on the termination flag * typo * special case of SN_type, CO_type, state * change to release on publish (#452) * Update publish-to-anaconda.yml (#455) * small fix to BBH selection function (#403) * small fix to BBH selection function * rename spin_orbit_tilt to spin_orbit_tilt_at_merger * add docstring info + change function name (not called anywhere) * Tutorial updates with recent PRs + feedback from collaboration meeting (#406) * normalized_pop_mass * synthetic * authors added * space added * # added * if statement added * Replacing error with a Warning * df1,df2 added in binarypopulation.py * dataframe handling removed * changed from None to 0.0 * underlying mass calculation separate function * change sum to nansum * add checks for underlying_mass existence * simulated_mass not summed again for each loop * rename df and inclusion of f_bin_nature * inclusion of f_bin nature * getting single and binary mass from the independent sample option * modified warnings * binary fraction correction * store the calculated underlying mass to the file * remove note on mpi4py installation on tutorial" * update 10 binaries tutorial * remove mpi4py todo. Installtion only required for multi-core MESA runs * add FAQ answer for select columns error: * consistent naming of channels * update default parameters" * Update popsyn script to 5G default * add custom flow example * add memory usage FAQ * add custom step and flow in notebook * change focus of debug population on evolving single binaries * add references to new notebook * remove output of cells; should be added back to make nicer notebooks * clean tutorial output * add additional FAQ and installation issue * clean up documnation for population params file, SingleStar, and BinaryStar * additional changes * change tutorial to 10 binaries + 1 metallicity, as per discussion * remove reference to personal datapath * cleanup bbh notebook * add warning about default values * Update normalized_pop_mass.py make it the same as development. * Update normalized_pop_mass.py * implement comments Matthias + Seth * fixed additional comment * additional missed comments * Update custom_step_and_flow.py * Update step_CEE.py * Update population_params.rst add warning_verbose and error_checking_verbose * Update population_params_default.ini Add error_checking_verbose and warnings_verbose * Update code-questions.rst Add papers + remove example approximation. --------- Co-authored-by: Dimitris Souropanis <qmh9626@quser31.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser34.quest.it.northwestern.edu> Co-authored-by: Eirini <kasdaglie@ufl.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser33.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser32.quest.it.northwestern.edu> * Update step_merged.py (#457) Turn print into ModelError, because variables are otherwise undefined. * fix log vs log10 typo (#460) In the MD/MF metallicity fraction calculation, there was a typo for the outer bin in transforming the absolute metallicity into a log10 value. It was log, but should be log10! * remove "redirect" steps from history dataframe (#421) * skip redirect steps when appending to binary history and step names * skip appending step_times for redirect steps * add "history_verbose" option * add missing verbose params to default .ini file * handle history_verbose setting for all step hooks * remove history_verbose check from pre-step hooks * update docs and .ini file with history_verbose parameter * Merge branch 'development' into camille_remove_redirect_from_df * update binary_star docs * Start to get unit tests back: utils (#382) * rename rae2a to rad2a * add unit_tests: readme, test_constants.py, test_limits_thresholds.py * add template * add authors to ignorereason.py * add test_ignorereason.py * add test_posydonerror.py * edit docstring * add test_posydonwarning.py * update readme * add test_data_download.py * transfer to pytest (outstanding: test_posydonwarning.py, test_data_download.py) * account for the comments of Max * transfer test_posydonwarning.py to pytest * transfer test_data_download.py to pytest * add configfile.py * cleanup * Create test_installation.py using this as a simple example to try out automated testing framework * Create continuous_integration.yml Automatic trigger for tests (currently just installation but can include any combination) for PRs created to main or development. Tests on ubuntu, mac, and windows environments. Currently just testing python 3.11 but can add other versions if desired. * Update continuous_integration.yml fixed path to installation test file * Update continuous_integration.yml making mac the first test out of the three OSes * Delete posydon/unit_tests/test_installation.py realized this could just be included in the github workflow * Update continuous_integration.yml changed to include full posydon installation step to remove redundancy. Currently including all extras in the setup.py but can remove any if needed. * Update continuous_integration.yml removing extras from the every-PR test. I'll move them to a weekly test instead. * Create install_extras.yml scheduled cron job testing installation of setup.py extras, every sunday * Update continuous_integration.yml * Delete .github/workflows/install_extras.yml * Delete .github/workflows/continuous_integration.yml * add test_gridutils.py * add test_common_functions.py * update doc * merge development and update tests; include test in continuous_integration.yml * add pytest/cov install to continuous_integration.yml * add posydon install to unit test run * Change to environment python version For some reason, the environment `pytest` command doesn't get overwritten correctly with the local runner environment one. Probably because the PATH order is weirdly set. Running `pytest` through `python -m` works. * add environment varable exports * Update continuous_integration.yml clarify step name for CI * remove old code * Update continuous_integration.yml adding a piece to enforce minimum coverage of 100% of specified code when running the tests. if the coverage is below 100%, pytest will exit and the github action will fail. 100% coverage means that every line of code of posydon.utils (as specified in --cov=posydon.utils) is run at least once in the test suite execution. * Update README.md typo * Update README.md clarify language about QA for tests * Update README.md typo * Update README.md added info about enforcing 100% coverage in the pytest command * add more about predefined fixtures to the README * comments till test_read_histogram_from_file * comments on test_read_histogram_from_file * comments till test_CO_radius * deal with comments till test_calculate_core_boundary * remaining comments in test_common_functions.py * finish addressing first round of comments by Max * use np as alias for totest.np * fix typo in data_download.py * fix typo in test_common_functions.py * fix typo in docstring of common_functions.py * fix typo in test_common_functions.py * fix typo in common_functions.py * Update test_common_functions.py change naming of data examples to be more descriptive * Update test_common_functions.py fix bug caused by extra spaces * add comments and more names * remove unused bad_profile2 * more cleanup * follow PEP8 strictly, reset attributes calculated for CEE --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * period_change_stabe_MT -> period_change_stable_MT (#467) * PSygrid force int input (#440) * PSygrid force int input force the user to input an integer. This includes numpy versions of int. If this is not forces, the `initial_values` and `final_values` can be loaded with a 1 value array/list, but the `history1`, etc are not loaded with that input. As a result, `None` is returned for those and it looks like the history is empty. * add extra check for `contains` raises an error in index in `__contains__` and `__getitem__` is not an integer * Change error type of IndexError Preferred way to raise error: """if key is a value outside the set of indexes for the sequence (after any special interpretation of negative values), IndexError should be raised. For mapping types, if key is missing (not in the container), KeyError should be raised.""" https://docs.python.org/3/reference/datamodel.html#object.__getitem__ * change to 'index' * edited docstring to match arg name --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * Backpropagate changes on main/max_requirements into development (#456) * Update README.md * Update install.rst * Update install.rst * Adding an option to create a VH diagram w/ BinaryStar objects (#158) * Adding an option to create a VH diagram w/ BinaryStar objects * Update VHdiagram.py * Update VHdiagram.py --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update README.md - main (#188) * Update README.md Update the readme to remove the installation instructions so that we do not have to maintain the same instructions in two places. Currently, the instructions in the readme are not the same as the ones in the documentation. * Update README.md I also edited the text to match the deve version * V1 python_utils fix (#191) * add python_utils==3.5.2 requirement * Update setup.py Limit `more-itertools` to its latest python3.7 version. * Update V1 conda setup (#199) * update conda dependencies for latest python3.7 packages dependencies + remove pyqt5 dependency * update astropy + pyqt5 versions * change pyqt to 5.15.4 * Updates in installation instructions in the V1 documentation (#201) * Updated installation instructions in the v1 documentation * Simplifying sections and removing git-lfs mention * Update install.rst * No change? * Adding OSX-ARM installtion instructions. * Update install.rst Add the conda channels to the OSX-ARM architecture --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * conda_v1 fix (#266) * change dependencies to have a maximum and release the numpy dependency * add maximum to setup.py too * point to updated GH action * Change numpy dependency * fix * change numpy version in setup.py too * solving for an old sk-learn numpy issue * Update publish-to-anaconda.yml (#270) changes publish-to-anaconda to development version. * update v1 for scikit-learn version (#292) * update v1 for scikit-learn version * Update setup.py * Update meta.yaml numpy 1.20 deprecates "np.float", which exists in v1 code * Update setup.py * Update conda version number (#304) This is required to publish Elizabeth's changes to conda * fix maximum requirements * fix scikit-learn version and remove email from AUTHOR_EMAIL. * v1 in mesa_dir the search for "v1/" should be in the full mesa_dir not the dirname * update zenodo link and md5 hash * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * Update meta.yaml * Update meta.yaml * change publish-to-anaconda to publish on a github release publish * typo fixed in documenation * Change installation instructions to specifically request v1.0.4 (#450) * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * publish only to anaconda on releases * fix found typos in v1 documentation * Update publish-to-anaconda.yml (#454) Point towards POSYDON-code/ version of the publish-to-anaconda action. * remove redundant lines in post_processing.py * add e-mail to setup.py * remove updated VH Diagram plotting code for a single binary. Surrounding code has change, see PR#456. * change default mem_per_cpu to 7G" * update version + installation instriction + link to releases + zenodo --------- Co-authored-by: Simone Bavera <32518238+ssbvr@users.noreply.github.com> Co-authored-by: sgossage <seth.gossage@cfa.harvard.edu> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: tassos25 <tassos25@users.noreply.github.com> Co-authored-by: Konstantinos Kovlakas <22239544+kkovlakas@users.noreply.github.com> Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * update zenodo url and md5 (#470) Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * error check for undefined states in BinaryStar (#468) * add error check for undefined states in BinaryStar, add undefined states to flow chart * update posydonerror unit test * update unit test again * remove BinaryStar and SingleStar from posydonerror, move initcond message to BinaryStar * fix unit tests again * Update step_merged.py (#480) Import ModelError in step merged. * No check for WD formation in double CE case (#484) * Update common_functions.py Move double CE into contact detection and return afterwards to skip checks on WD formation. * add tests which would fail on the old code * handle H-rich RLO binaries and clarify verbosity of detached step (#430) * clean-up code and clarify verbosity of matching in detached step * reorganizing some code in detached step, clarifying verbose output * fix bug in matching, add criteria to check for HMS-HMS-RLO binaries in detached step * add list of step names to SimulationProperties * add separate error catch for HMS-HMS binaries in RLO in detached step * Merge remote-tracking branch 'origin/development' into camille_matching_strippedHe_to_Hrich * add ClassificationError to unit tests * remove space at end of line in unit tests * fix unit test * remove classification error from unit tests * fix classification error * fix line length in test_posydonerror.py * Grid slice plotting system selection fix (#475) * replace selection + add docstring * Update plot_pop.py changes: - plot_extension doc string - prop description if None * add missing binaries to UNDEFINED_STATES in flow chart (#489) * add missing binaries to UNDEFINED_STATES in flow chart * add WD systems to undefined states * add for loop for undefined states in flow chart * separate IMFs + create basic tests * add pytest.approx around remaining values * move salpeter tests into its own class * add Kroupa2001 IMF and its unit tests * add flat_mass_ratio dist and Sana12 period * Update issue templates (#491) * Update issue templates * Update bug_report.md * add temp norm_pop.py file to restructure underlying_mass calculation * add single star contribution, works for f_b=1 in sample. Unclear if f_bin!=1 in sample works correctly in original version * Update installation-guide.rst to include note about adding conda-forge (#495) * Update installation-guide.rst to include note about adding conda-forge I came across an issue related to installation. It turns out that many of the required packages specify versions only available on conda-forge which can cause a huge headache for unaware users. I have updated the installation documentation to include this note. * Adding conda-forge documentation to troubleshooting page --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> * add 'm*' to simulation weight * Protect run_psycris_sequence, from misc imports (#436) * add dunder main to run_psycris_sequence, add type checks to cmd args * Add some docs * Delete random file * additional comments in norm_pop * add more dump_rate info to docs (#500) * add dump_rate info to docs and ini file * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * Update population_params.rst * Update code-questions.rst * Update population_params_default.ini --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * replace scipy interp1d with alternatives (#433) * replace all instances of interp1d except for in profile interpolation * remove interp1d from common functions unit test * add parameter type checks to rejection sampler * changes to common functions unit testing * fix unit test * fix unit tests again * define own interp1d and revert replacements * clean out white spaces * replace interp1d in profile_interpolation * readd ClassificationError * add fill_value, left, and right * cleanup * remove import * Update interp1d to include option for fill_value="extrapolate" * edit error message for fill_value * Update test_interpolators.py to include fill_value="extrapolate" * update all to ndarray; add missing unit tests * fix docstring * correct description --------- Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * Add support for unsorted input in new interpolators (#502) * add check for increasing or decreasing arrays. Flip accordingly * add unit test for flipping + add check for x,y being None * remove None check * shuffle stuff around * move tests to init * use np.flip to create a copy of the original data instead of a flipped view. Just in case the data gets changed along the way * implement suggestions * add sorting for non-monotonic values. Required for some step_SN parameters * Update test_interpolators.py * fix typo --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * replace NaN/None in input chi_eff calculation with 0 (#501) * add nan checks for spins + tilts * add docstring * remove np.ndarray wraping" * implement comments on using pd.na: * Update transient_select_funcs.py remove empty line generalize warning text * Update transient_select_funcs.py --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * updating the data_download routines slightly (#496) * updating the data_download routines slightly * Fixing unit tests accordingly * Fixing one more unit test * Adding comment to force unit tests to re-run * Added DataError as a POSYDONError and included raise DataError for missing PATH_TO_POSYDON_DATA environmental variable * revert DataError and use NameError; add unittest * Use FileExistsError --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * rewrite of normalisation into separate components * add TODO+warning that alpha needs to be changed back for the Salpeter IMF * Use of `PATH_*` variables (#505) * update and test config * always import PATHs from config * put the downloaded data on the path without POSYDON_data * use dirname, where POSYDON_data should be skipped * debugging * debugging * use os.path.join * cleanup * Update config.py docstring * Fixes to Troubleshooting & FAQ Docs (#517) * initial read-through fixes * more changes to code-questions docs * Update docs/_source/troubleshooting-faqs/code-questions.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/troubleshooting-faqs/code-questions.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * replace @ symbol --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Add files to installation (#526) * add init files to detect packages; include files in MANIFEST.in * add comment * Fix logic flow in matching (#521) * fix logic flow in matching, clarify matching verbose output * add "center_h1" to matching verbose output * make if/else checks and flow more consistent * add accreted_He_Shell_H_burning stars to flow, detached step (#522) * Issues with undefined values of SN_MODELS (#482) * Update step_mesa.py replace undefined variable key and check fv for CO_type * Update step_mesa.py Check for key and otherwise show warning and set value to None. * Update step_SN.py np.isnan -> pd.isna * Update step_mesa.py change None to np.nan * Update step_mesa.py Set model to None. * Update step_mesa.py ensure None is not overwritten * add end of step prints for verbose * typo * use pa.notna * replace isnan (#527) * Fix logic for single star fraction population normalisation (#509) 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`. * Pulsational Pair-Instability top-down mass loss approach (#417) * 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 * Blandford-Znajek jet energy calculation (#429) * 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> * Split popsyn plotting into separate components for future modularity (#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 (#532) * 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> * replace underlying mass calculation with probability reweight per model * move binary fraction into PDF * remove unneccesary lines * add calculate_model_weights separate * add additional error for impossible reweights * add basic tests for normalisation. These tests reweight a population and sample from the requested reweight population. Then it compares a selection in both populations to see if they're close. I performed a convergence test on the method implemented and the final results converge. * remove old tests * rename func call * add Chabrier2003 IMF * restructure code to an abstract class with sub-classes and add unit_tests for Chabrier IMF * add actual new tests * add Chabrier IMF tests" * dynamical find IMF (primary mass scheme) based on available ones in IMFs.py * add unit tests for the sub-functions in norm_pop.py * add docstrings to different IMFs * small cleanup/addition * flip notation * alter Kroupa2001 IMF calculation * remove old test_weights file * Update setup.py (#536) sphinx at least 8.2.2 * GitHub action fix (#537) * change to v4 * add to CI for testing checkout and setup python versions * change other versions to 'latest' * Update MESA-grid tutorials (#535) * 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 * Modular data download (#507) * 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> * Decouple ECSN treatment from SN_MODELS (#504) * 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 (#512) * add WDs to infer_star_state, incl. testing and new limits * add references * Update setup.py (#541) change >3.10 to >=3.11 * Upgrade setuptools (#542) * create new pyproject.toml; try to reuse setup.py as much as possible * add refs * implement self.mbreak suggestion: * remove duplicate line * change name + pass func * add Return explanation to docstring * cleanup + add period_PDF function. Not yet in weights * set post SN binary to disrupted in case there is a massless_remnant (#548) * Update population_params_default.ini (#544) Update to give the correct usage for the engine if 'other' mechanisms are used * Add check for valid MODELS in posydon-setup-popsyn (#545) * add check for valid MODELS before popsynth setup script runs * move repeated code into a separate function in the MODELS.py file * move repeated code into a separate function in the MODELS.py file * Update posydon/grids/MODELS.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * add the option to add kwargs to primary_mass scheme * add an option to pass parameters to the IMF PDF creation for customisaion of the IMF slopes/breaks etc * Add total_mass_h1 and total_mass_he4 (#529) * add total_mass_h1 and total_mass_he4 (utils, vis not yet checked) * add values to plot defaults * update doc * copy bug correction from PR435 * exclude accreted_He_Core_H_burning state from HRD for single stars * rework model weights in the TransientPopulation to account for double indices in the TransientPopulation * clean up files * add fix for flipped masses in the sampling. Probably because the system was flipped by the population synthesis * add correct size for tmp_model_weights when setting a chunksize smaller than the total population * remove old function + add coverage setting file * add docstrings * Add unit tests: grids (#435) * rename rae2a to rad2a * add unit_tests: readme, test_constants.py, test_limits_thresholds.py * add template * add authors to ignorereason.py * add test_ignorereason.py * add test_posydonerror.py * edit docstring * add test_posydonwarning.py * update readme * add test_data_download.py * transfer to pytest (outstanding: test_posydonwarning.py, test_data_download.py) * account for the comments of Max * transfer test_posydonwarning.py to pytest * transfer test_data_download.py to pytest * add configfile.py * cleanup * Create test_installation.py using this as a simple example to try out automated testing framework * Create continuous_integration.yml Automatic trigger for tests (currently just installation but can include any combination) for PRs created to main or development. Tests on ubuntu, mac, and windows environments. Currently just testing python 3.11 but can add other versions if desired. * Update continuous_integration.yml fixed path to installation test file * Update continuous_integration.yml making mac the first test out of the three OSes * Delete posydon/unit_tests/test_installation.py realized this could just be included in the github workflow * Update continuous_integration.yml changed to include full posydon installation step to remove redundancy. Currently including all extras in the setup.py but can remove any if needed. * Update continuous_integration.yml removing extras from the every-PR test. I'll move them to a weekly test instead. * Create install_extras.yml scheduled cron job testing installation of setup.py extras, every sunday * Update continuous_integration.yml * Delete .github/workflows/install_extras.yml * Delete .github/workflows/continuous_integration.yml * add test_gridutils.py * add test_common_functions.py * update doc * merge development and update tests; include test in continuous_integration.yml * add pytest/cov install to continuous_integration.yml * add posydon install to unit test run * Change to environment python version For some reason, the environment `pytest` command doesn't get overwritten correctly with the local runner environment one. Probably because the PATH order is weirdly set. Running `pytest` through `python -m` works. * add environment varable exports * Update continuous_integration.yml clarify step name for CI * remove old code * start unit tests for grids * add test_termination_flags.py * include new test in CI * fix CI * add test_scrubbing.py * add test_MODELS.py * add test_io.py * make test flexible for different OS * add test_downsampling.py * start with test_psygrid.py * np alias, file+path * more tests on psygrid * small corrections * adopt style * test_join_grids * add/edit docstrings and continue on PSyGrid tests * generate test MESA gird * decide_columns * more special cases of MESA runs * further grid tests * more grid tests * tests till 70 percent coverage * more gird tests * test till 71 percent * finish tests for _create_psygrid * more tests; clarify errors; restructure PSyGrid for testing * correct typo * workaroud for test interactions * more tests * add Error for new_mesa_flag * cleanup * finish PSyGrid class * finish test_psygrid.py, beside one todo * more checks on PSyGrid creation * add first tests of post_processing * remove old test * cleanup * check more errors * more test on post_process_grid * finish PR * cleanup * add SN data to unit tests to avoid download * Update posydon/unit_tests/README.md Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update posydon/unit_tests/README.md Co-authored-by: Seth Gossage <sethg45@gmail.com> * merge development, resolve conlicts, and update README * reword error message of wrong index * make test for missing and new objects more detailed * add Runtimeerror in case a system tool does not work as expected * add fixture to link temporarily SN data if needed --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * remove .coveragerc, because it causes the tests to fail. Put in a different PR * add test_get_MODEL_NAME (#553) * Mesa api doc (#520) * Update fixed.rst Fixing typos and grammar errors in Run a fixed mesa grid * Update inifile.rst * Update inifile.rst * Update fixed.rst typo fix * Update dynamic.rst Change the TODO * Update fixed.rst Bold text * bold removed * ini file replaced with .ini file * Update fixed.rst Changing the ini file to be consistent with other docs * Update inifile.rst changing the ini file * Update dynamic.rst Adding Kyle's paper and POSYDON mailing list * Update docs/_source/components-overview/mesa_grids/fixed.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: dimsour94 <dimitris.souropanis@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Rename step9 to stepF (#558) * rename step9 to stepF * update example INI files * Add conda install of mpi4py (#556) Additionally add macos-13 to run on * FAQ about slow `conda` (#551) * add FAQ about installation instructions * Update installation-issues.rst * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update installation-issues.rst --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Seth Gossage <sethg45@gmail.com> * conform to 80 character limit * add missing doc strings * add valueerror * remove old normalised_pop_mass functions * change to monkey patch * change to np.array return * add m_min m_max checks * use monkeypatch fixture * adapt tests based on comments * implement comments * conform to 90 character line limit * include comment * clean up * fix monkeypatch * add additional mass ratio PDF option + adapt test for it * add unit test invalid mass_ratio scheme defaulting to flat q * add positive mass warning * add CI for IMFs and norm_pop * remove period PDF * correct writing to dataframe * remove deprecated import * fix missing imports * Unifying the code for finding grid boundaries and checking validity in case of ignored data. (#271) * Automatically find boundaries of the grid at the superclass, to avoid code repetition. * Removing unused variable. * Correcting (visual) indendation issues. * Do not use ignored and failed runs to determine the grid boundaries. * Adopting suggestions regarding variable names. * Add check that profile is well defined in SN (#559) * add check for profile * add seth's suggestions * Add posydon-popsyn setup, check & rescue (#550) Renames the `posydon-setup-popsyn` CLI to `posydon-popsyn` and implements the sub-commands `setup`, `check`, and `rescue`. - `setup` performs the setup of a population synthesis run, as before. - `check` verifies a population run and checks if the requested number of binaries is present. - `rescue` allows the user to create resubmission files for failed Slurm array jobs. [commit changes] * restructure + add run check script * rename + adding the rescue option * Add resubmit_slurm.sh submission options * update tutorial with new command name + add new commands * add check if there are failed jobs or not * remove unused imports * add empty missing_indices * update run in rescue script * change path + merge job name * implement comments and improvements from Matthias * 80 character limit + additional doc strings * remove required for already required input * added output for other output too * Update posydon-run-pipeline (#569) * update docs: installation, processing pipeline, ML components (#513) * Update installation-guide.rst -fix typo "instractions" -move environment variables step ahead of download posydon data, which requires the variables to be set * Update pipeline_steps.rst fix typo "girds" * Update processing-pipeline.rst * Update processing-pipeline.rst * Update psygrid.rst for language * fix typo * fix typos * add spaces for readability * Update psygrid.rst language for clarity * Update pipeline_ini.rst Found small typos and made small changes for clarity. I think a lot of this could be rewritten for clarity, but I don't understand this part of the code enough to do that. * Update machine-learning-components.rst Typos * Update initial_final_interp.rst minor changes to IFInterpolator * Update initial_final_interp.rst Typo * Update psygrid.rst to put quotation marks back in to denote strings for the keys * change .ini to *.ini * Update machine-learning-components.rst typo * Update psygrid.rst language for clarity * Update psygrid.rst language for clarity * Update installation-guide.rst for copy edits * add arguments table for join_grids * fix table * fix table * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/components-overview/post_processing/psygrid.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * clarify grid config properties vs physical grid properties * Update posydon-run-pipeline for typos * Update pipeline_steps.rst * Update pipeline_steps.rst language for clarity * Update single_star.rst change star state example * Update binary_star.rst updating star states * Update custom_hooks.rst fix spacing in code example * Update pipeline_steps.rst language for clarity * limit lines to 80 characters * Update pipeline_steps.rst * restrict lines to 80 characters * restrict lines to 80 characters * restrict to 80 characters per line * Update pipeline_ini.rst for line length * Update initial_final_interp.rst for line length * Update pipeline_steps.rst style fix * Update psygrid.rst for style * Update pipeline_ini.rst * Update pipeline_steps.rst for style consistency * Update pipeline_additions.rst for style consistency * Update processing-pipeline.rst for style consistency * Update initial_final_interp.rst for style consistency * Update ProfileInterpolator.rst * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update pipeline_additions.rst for line length * Update pipeline_steps.rst for line length * Update psygrid.rst for line length * Update pipeline_ini.rst for line length * Update initial_final_interp.rst for line length * Update initial_final_interp.rst * Update ProfileInterpolator.rst for line length * Update machine-learning-components.rst for line length * Update pipeline_steps.rst * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update initial_final_interp.rst * Update machine-learning-components.rst --------- Co-authored-by: Philipp Moura Srivastava <philipp.msrivastava@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Kyle Rocha <48293898+ka-rocha@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * Move bin code to utils: compress-mesa (#564) * move code * bug fix * add first tests; restructure command line arguments * outsource helper functions for tests * verbose check * finish test_compress_dir * finish test_set_up_test * take care of comments by Max * add docstring to get_size * add more docstring * add suggestions by Seth * Update install_extras.yml (#576) * Update install_extras.yml (#578) * POSYDON docs build multiple version (#554) * add versioning + automatic fetching of docs * comment out deploy action * remove git fetch * cleanup * remove PATH_TO_POSYDON * add MESA_DIR and PATH_TO_POSYDON_DATA * add reinstall for autodoc * do v1 generation * add v2 + install wheel for python 3.9 * positive grep * add wheel install v1 + remove from v2 * remove development for now * use as path * change out folder * add * change build_path * change build_path again * change checkout + path * add v1 & v2 make documentation * update _build for v1 documentation * show current version in documentation instead of latest * rename folder * remove old unused unstable workflow * Update docs/_source/conf.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * typo * fix typo * remove development doc make from release * remove v2.0.0-dev tag from version TAG list * remove dry-run commands * add v1 and v2 distinction + treat v2.0.0-dev as an indicator for development creation * force remove dirty for current version doc build, because copying files into version necessary * fix * link cleanup * add injection grab * move subprocess * add current version * change old_tags name * change posydon_version old tag version * posydon cleanup too * only apply injection to old v2 verions * add dry-run back in * template -> templates * add symlink process to latest release version * check for all dev tags of v2.X.X versions Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * implement comments * check for latest non-pre-release version * Update .github/workflows/deploy-github-pages-release.yml Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update .github/workflows/deploy-github-pages-release.yml Co-authored-by: Seth Gossage <sethg45@gmail.com> * remove dry-run --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * Hotfixes new documentation build (#585) * Add fetch-tags:true Currently, not all the tags from Github are correctly pulled in this workflow, as such the code fails. * add v for folders + links to make all consistent * Add v for folder creation and in linkage * posydon-popsyn multi-jobID fix (#581) If multiple population synthesis reruns are present, the jobID check was returning a list of one. This should have just been the jobID. This corrects that selection. * Hotfix documentation-build again (#588) Another fix to the building of the development version. This time, entering the git folder I don't understand why this worked locally with Local Github Actions (act) and not on the actual Github Actions. Is the workflow different? * add fetch-depth:0 to documentation workflows (#593) * Bump miniconda version to v3 and add proper bash shell initiation (#594) * bump miniconda version to v3 and add proper bash shell initiation * clean up * remove sourcing conda; already done with bash -el * add pip upgrade back * Update install_extras.yml * remove check on PR * Change ECSN default to Tauris+15 (#571) * change ECSN default and comment defaults in MODELS * function: get_MODEL; update tests * Update population_params_default.ini Add allow_spin_None to default ini file. * Update posydon-popsyn add verbose_on_fail * get at least mass in get_initial_BH_properties * update docs * adopt pre defined SN models; rename MODEL to SN_MODEL * adjust test mass to give BHs; rename prop * update population_params_default.ini to default SN model * change values for Farag matching * refer to v2 interpolators * add back Sukhbold+16-engine * Add supernova engine (#597) * Update SN_MODELS.py Add S19.8 engine, rename SN_models for easier addition of more changes * update docs and ini files * rename SN_models * Add eccentricity as option for parsing grids (#575) * update absolute imports and default ini with some docs * Changed grids.io to parse mesa grid dirs with changing eccentricity * Removed hotfix comments for PR * remove spurious spacing * Updating unit test to correspond to initial eccentricity in filename * Update posydon/unit_tests/grids/test_io.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * change output folder (#595) * F2 f population docs (#525) * Update 10_binaries_pop_syn.ipynb Fix typos * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb test * Update lgrb_pop_syn.ipynb * Update pop_syn.ipynb * Update pop_syn.ipynb * Update bbh_analysis.ipynb * Update custom_step_and_flow.ipynb * Update docs/_source/tutorials-examples/population-synthesis/bbh_analysis.ipynb Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/tutorials-examples/population-synthesis/bbh_analysis.ipynb Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update pop_syn.ipynb * Update bbh_analysis.ipynb - more verbose * Update bbh_analysis.ipynb - clarity * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb clarity * Update bbh_analysis.ipynb addressing a few typos and clarity * Update lgrb_pop_syn.ipynb clarity * Update one_met_pop_syn.ipynb addressed typos and consistency with code updates * Update bbh_analysis.ipynb argument name update * Update one_met_pop_syn.ipynb typo * typo * Update evolve_single_binaries.ipynb typo * Update custom_step_and_flow.ipynb; adding clarity * Update custom_step_and_flow.ipynb small addition to last commit * Update custom_step_and_flow.ipynb * Update custom_step_and_flow.ipynb * some variables are not defined so I removed them. one is introduced later in the tutorial * maybe this change is wrong but I was unable to pip install .[vis] * Update - all but the last cell works with v2 population * added --account argument to posydon-popsyn Quest example. Without this, job submission will fail * Small typo fixes * add pending review changes --------- Co-authored-by: Monica Gallegos-Garcia <monicagallegosgarcia2024@u.northwestern.edu> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * Change supernova models (#598) * Update SN_MODELS.py change S19.8 to W20 * Update population_params_default.ini * Update population_params_end.ini * SFH bug fix, rewrite, and basic tests (#543) * combine SFR_Z_fraction and star_formation_rate into a single function call, which pre-calculate the multiplication for speed improvemen * add correct select_one_met in function * move SFH into separate classes with abstract inheritance * Move SFH to classes (with abstract treatments) + Add Chruslinska+21 SFH models * fix fSFR. Now sums correctly to 1 at each redshift. * add fSFR unit tests * add additional basic tests * fix double naming of SFR * add tests for new SFRs * remove old SFH code; not used anywhere * move std_log_metallicity_history * add dosctring for abstract class * add docstrings * rename variables * add more doc strings * add even more docs * more doc strings * add checks for required parameters in MadauBase * docstrings: * change name of SFR_per_met_per_z function * alter unit tests to adapt to previous changes * change ' to " * cleanup line lengths * change output fSFR and _call__ dosctring to ndarray * add check for model parameters required * restructure + integrate only between Z_min and Z_max + add option normalise * Z_max check * update the SFH to use Z_min and Z_max and normalise. Move the splitting per metallicity bin to its own function. Additionally, revamp the unit tests to be more in style with the other unit tests and adapt them for the new functions and treatment of the metallicity bins. * fix name typo * remove Z_max requirement for Chruslinska * implement Matthias comments * change to rates.MODEL * change comment * add test for get_SFR_per_met_at_z * make sure to test branches * add SFH tests * add space * remove duplicate lines in IllustrisTNG class * move ConcreteSFH into a fixture * Add support for Zmin and Zmax inside bins and inside the same bin. * add doc string + remove select_one_met * replace MODEL with SFH_MODEL * change DEFAULT_MODEL to DEFAULT_SFH_MODEL * add to default Zmin,Zmax=None + normalise=True * update docstrings: * clean up star_formation_history file * update unit tests + implement comments * update call method test * add std_log_metallicity_dist integer support * make explicit regex expression * update unit tests & implement remainder of comments Matthias * cleanup * warning cleanup * add SFHModelWarning + add sort check * change to sphinx reference style * add reference * add check for None output in error * add unit test for unsorted Metalicity bins * suggested change * add new warning class to test * Update posydon/unit_tests/popsyn/test_star_formation_history.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update README.md (#599) * Update README.md * Apply suggestions from Seth Co-authored-by: Seth Gossage <sethg45@gmail.com> --------- Co-authored-by: Seth Gossage <sethg45@gmail.com> * Changes in the MESA documentation (#524) * minor text change in 'I. Running your first MESA simulation using POSYDON' * changes up to 'Run one binary on your laptop for debugging' where I had error with work_dir * partial changes to the tutorial * small last changes in the documentation * adding matthias comment on work dir * Update docs/_source/tutorials-examples/MESA-grids/laptop.ipynb typo Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Re-writing step-CE for improved flow and logic (#574) * change the core radius for the stableMT option * Updating step_CEE.py * Re-writing step_CEE alpha_lambda prescription code * Updating code * updating common_functions list of functions to test * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Removing core_not_replaced_noMT option from documentation * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Updating mass loss due to merger in CEE * Update common_functions.py * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update step_CEE.py * Update step_CEE.py * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Updated due to code review comments and changing CE function names * Missed this previous update * Updating documentation * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update posydon/unit_tests/utils/test_common_functions.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Moving from double quotes to single quotes * Update posydon/binary_evol/CE/step_CEE.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * fix option names as Zepei reported * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * add compt_type to CEE_adjust_binary_upon_merger as requested by me and Max --------- Co-authored-by: ZepeiX <Zepei.Xing@unige.ch> Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * Check for array-like data in `BinaryStar.to_df()` in case of failed binaries (#580) * Update binarystar.py adding a check for array like data and pad w/ nans as before, but with the right data type * Update binarystar.py operate on column element rather than the column itself * Update binarystar.py rename data_len to element_len * initialize V_sys as numpy array, rather than list, to match subsequent data types * added new dtypes in popsyn/io.py: object.string and object.float64 to differentiate subtypes of objects. Dynamically determine filler values when extending failed binary data columns * remove debug print statements and also add in default case if somehow a data column key does not exist in dtype dictionary * remove max_ele_length initialization, superfluous * added new sub dtype dictionary in popsyn/io.py to hold specs on dtypes within an object, now default to NoneTypes in case a definition is not found, which is converted to nan in case of single values (not objects), also now nearest_neighbour_distance is initialized as a float array rather than a string array * added empty string definition for cases of missing dtype definitions * Update posydon/binary_evol/binarystar.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update posydon/binary_evol/binarystar.py Co-auth…
* TransientPopulation overplot crash fix (#374) * check if no binaries are selected for the slice to mitigate crashing * Update plot_pop.py space change * fix get_redshift_from_cosmic_time() function (#381) * Replace job_start for running grids (#380) * turn start+end to end+before_end+now * Reduce number of CPUs for cleanup jobs Usually, cleanup is limited by the file system, hence request less CPUs. * add missing binary states to flow charts and error catching fo future missing states * add verbose block, move return statement * add an escape option if value cannot be found in the grids (#385) * Population() fix for large memory usage when reading files (#386) * add an escape option if value cannot be found in the grids * Fix pd.read_hdf() memory usage + restructure code move select, tail and head into a DFInterface class from which History and Oneline inherit * add init parameter. fix copy bug + generalise (html) repr. * add missing return in Oneline.__get_item__() * replace Oneline slice selection with self.select() * Change docstrings - Add that you can only query where on the index or string columns. - Changed some wrongly named tables in the docstring - Change the example `where` selection. * Initial RLO boundary limit (#389) * Update limits_thresholds.py Add new threshold: MIN_COUNT_INITIAL_RLO_BOUNDARY * Update termination_flags.py Return the default if the initial RLO boundary isn't well enough populated. * Add warning * Update limits_thresholds.py Try larger value. * Small Population fixes (#390) * remove printing for intrinsic rate calculation + do not fail TransientPopulation calculation if empty population is created * fix channel grid_overplotting * Add docstring + change warning * add catch to suppress python warning in detached step (#392) * add warning catch to detached step * update comment * change POSYDON warning type * Add LBV_wind+dedt+hepulse rerun (#393) * Update posydon-run-pipeline enabled LBV_wind+dedt_hepulse rerun and updated associated SHA * Update pipeline_steps.rst added/updated descriptions for new rerun types * Update posydon-run-pipeline updated SHA for rerun after removing age limit stopping conditions * Update pipeline_steps.rst updated description for new hepulse rerun that removes stopping conditions for low mass stars based at TAMS/Hubble time * Update posydon-run-pipeline updated SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * remove failed states from flow and raise POSYDON errors instead * add more info to DCO error message * Update independent_sample.py (#394) Add default value for orbital_scheme and update doc-string * Update posydon-run-pipeline (#396) update SHA for hepulse rerun -- fixing seg faults that could occur when storing variables for point masses * Relax number formating for mesa inputs (#401) * Update posydon-run-grid Always use exponential writing for the `inlist_grid_points` and replace `e` by `d`, which is needed for FORTRAN. * Update posydon-run-grid Ensure, that only the float is in the replacement and adopt other cases where inputs for MESA are written. * Update IF_interpolation.py (#399) * Update IF_interpolation.py Updated k to be a minimum of 3 to prioritize smoothness * Update IF_interpolation.py so k is at least 3 * Update IF_interpolation.py refinement to make k = 3 * Update IF_interpolation.py * Update setup.py Add additional numpy requirement * Add "last" to TF12 for stable MT (#405) * update profile interpolation for consistency with paper (#397) * update for consistency with updated methods for paper * make nan warning more specific * make prediction inputs in linear space to match IF interpolation * add customizable nn shape to composition profiles * streamline Composition code for learn_bounds(), separate H-rich H-burning profiles from H-rich advanced burning profiles, add code to customize neural network shape for composition profiles * set up prediction framework for Composition that creates the 'H+He' profile first and subtracts H profile to get He profile * separate density profiles and composition profiles training * replace np.isnan with pd.isna * change InappropriateValueWarning to IncompletenessWarning in the case of nans in final values * typo * set random seed value to None by default to make it optional, update docstring * change 'lr' variable name to 'learning_rate' * added warning for if stars that should have a flat profile are not flat * eliminated redundant line * fixed docstring for density class * clarified the order of returned objects, added a condition for case where no models are selected for training * added returns so as to not exit functions after posydon warning * tie up loose ends * corrected issue with an error check specific to one parameter * small change to definition of scalars to comply with new pd command * fixed double equal sign that should be single equal sign * fix ref to predicted mass transfer classes * add empty array for predictions * fix issue with predictions * remove unnecessary print statement * rename "stripped_He_Core_H_burning" state and add to flow chart (#404) * stripped_He_Core_H * add "accreted_He_Core_H_burning" state * add rounding for surface_h1, center_h1 values when determining star state * move accreted_He state to list of HMS star states * fix plot defaults * add accreted_He_non_burning state * add states back to plot defaults * add "accreted_He_Core_He_burning" state * remove testing print statement * allow double He-rich star binaries in RLO to merge (#414) * update star states in step_SN (#416) * Automatic testing of installation (#425) * Create continuous_integration.yml Testing installation for mac, ubuntu, windows with python 3.11 (can add other versions). Automatically triggered for all PRs to development and main. * Create install_extras.yml scheduled weekly cronjob to test installation with all extras from setup.py * QA for installation test I am inserting a requirement for a nonexistent package just to make sure my automatic installation test workflow catches it. Will revert this change afterwards. * reverting change for QA it worked! reverting now * Update continuous_integration.yml removing windows * Update continuous_integration.yml remove windows condition * Update install_extras.yml remove windows * always initialize values for separation and orbital period in BinaryStar (#426) * add explicit separation and orbital period initialization in binarystar constructor * add catch if star masses are None * error catch for He-rich stars in RLO onto H-rich stars (#423) * add error catch for He-rich stars in RLO onto H-rich stars in detached step * minor changes * New normalized_pop_mass.py file (#376) * normalized_pop_mass * synthetic * authors added * space added * # added * if statement added * Replacing error with a Warning * df1,df2 added in binarypopulation.py * dataframe handling removed * changed from None to 0.0 * underlying mass calculation separate function * change sum to nansum * add checks for underlying_mass existence * simulated_mass not summed again for each loop * rename df and inclusion of f_bin_nature * inclusion of f_bin nature * getting single and binary mass from the independent sample option * modified warnings * binary fraction correction * store the calculated underlying mass to the file * updated doc-strings and making it consistent at case boundaries * correcting some typos and respecting the 80 characters line length --------- Co-authored-by: Dimitris Souropanis <qmh9626@quser31.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser34.quest.it.northwestern.edu> Co-authored-by: Max Briel <max.briel@gmail.com> Co-authored-by: Eirini <kasdaglie@ufl.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser33.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser32.quest.it.northwestern.edu> * Update README.md (#434) Add v2 paper * update installation test to include M1 and intel chips for macos (#428) * Update continuous_integration.yml add macos-14 github runner which uses the apple silicon M1 chip: https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ * Update continuous_integration.yml macos-13 runs on intel chip, macos-14 runs on apple silicon M1 chip * Update continuous_integration.yml changed the M chip specification from macos-14 to macos-latest * Add default legend titles based on the termination flag (#432) * add default legend titles based on the termination flag * typo * special case of SN_type, CO_type, state * change to release on publish (#452) * Update publish-to-anaconda.yml (#455) * small fix to BBH selection function (#403) * small fix to BBH selection function * rename spin_orbit_tilt to spin_orbit_tilt_at_merger * add docstring info + change function name (not called anywhere) * Tutorial updates with recent PRs + feedback from collaboration meeting (#406) * normalized_pop_mass * synthetic * authors added * space added * # added * if statement added * Replacing error with a Warning * df1,df2 added in binarypopulation.py * dataframe handling removed * changed from None to 0.0 * underlying mass calculation separate function * change sum to nansum * add checks for underlying_mass existence * simulated_mass not summed again for each loop * rename df and inclusion of f_bin_nature * inclusion of f_bin nature * getting single and binary mass from the independent sample option * modified warnings * binary fraction correction * store the calculated underlying mass to the file * remove note on mpi4py installation on tutorial" * update 10 binaries tutorial * remove mpi4py todo. Installtion only required for multi-core MESA runs * add FAQ answer for select columns error: * consistent naming of channels * update default parameters" * Update popsyn script to 5G default * add custom flow example * add memory usage FAQ * add custom step and flow in notebook * change focus of debug population on evolving single binaries * add references to new notebook * remove output of cells; should be added back to make nicer notebooks * clean tutorial output * add additional FAQ and installation issue * clean up documnation for population params file, SingleStar, and BinaryStar * additional changes * change tutorial to 10 binaries + 1 metallicity, as per discussion * remove reference to personal datapath * cleanup bbh notebook * add warning about default values * Update normalized_pop_mass.py make it the same as development. * Update normalized_pop_mass.py * implement comments Matthias + Seth * fixed additional comment * additional missed comments * Update custom_step_and_flow.py * Update step_CEE.py * Update population_params.rst add warning_verbose and error_checking_verbose * Update population_params_default.ini Add error_checking_verbose and warnings_verbose * Update code-questions.rst Add papers + remove example approximation. --------- Co-authored-by: Dimitris Souropanis <qmh9626@quser31.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser34.quest.it.northwestern.edu> Co-authored-by: Eirini <kasdaglie@ufl.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser33.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser32.quest.it.northwestern.edu> * Update step_merged.py (#457) Turn print into ModelError, because variables are otherwise undefined. * fix log vs log10 typo (#460) In the MD/MF metallicity fraction calculation, there was a typo for the outer bin in transforming the absolute metallicity into a log10 value. It was log, but should be log10! * remove "redirect" steps from history dataframe (#421) * skip redirect steps when appending to binary history and step names * skip appending step_times for redirect steps * add "history_verbose" option * add missing verbose params to default .ini file * handle history_verbose setting for all step hooks * remove history_verbose check from pre-step hooks * update docs and .ini file with history_verbose parameter * Merge branch 'development' into camille_remove_redirect_from_df * update binary_star docs * Start to get unit tests back: utils (#382) * rename rae2a to rad2a * add unit_tests: readme, test_constants.py, test_limits_thresholds.py * add template * add authors to ignorereason.py * add test_ignorereason.py * add test_posydonerror.py * edit docstring * add test_posydonwarning.py * update readme * add test_data_download.py * transfer to pytest (outstanding: test_posydonwarning.py, test_data_download.py) * account for the comments of Max * transfer test_posydonwarning.py to pytest * transfer test_data_download.py to pytest * add configfile.py * cleanup * Create test_installation.py using this as a simple example to try out automated testing framework * Create continuous_integration.yml Automatic trigger for tests (currently just installation but can include any combination) for PRs created to main or development. Tests on ubuntu, mac, and windows environments. Currently just testing python 3.11 but can add other versions if desired. * Update continuous_integration.yml fixed path to installation test file * Update continuous_integration.yml making mac the first test out of the three OSes * Delete posydon/unit_tests/test_installation.py realized this could just be included in the github workflow * Update continuous_integration.yml changed to include full posydon installation step to remove redundancy. Currently including all extras in the setup.py but can remove any if needed. * Update continuous_integration.yml removing extras from the every-PR test. I'll move them to a weekly test instead. * Create install_extras.yml scheduled cron job testing installation of setup.py extras, every sunday * Update continuous_integration.yml * Delete .github/workflows/install_extras.yml * Delete .github/workflows/continuous_integration.yml * add test_gridutils.py * add test_common_functions.py * update doc * merge development and update tests; include test in continuous_integration.yml * add pytest/cov install to continuous_integration.yml * add posydon install to unit test run * Change to environment python version For some reason, the environment `pytest` command doesn't get overwritten correctly with the local runner environment one. Probably because the PATH order is weirdly set. Running `pytest` through `python -m` works. * add environment varable exports * Update continuous_integration.yml clarify step name for CI * remove old code * Update continuous_integration.yml adding a piece to enforce minimum coverage of 100% of specified code when running the tests. if the coverage is below 100%, pytest will exit and the github action will fail. 100% coverage means that every line of code of posydon.utils (as specified in --cov=posydon.utils) is run at least once in the test suite execution. * Update README.md typo * Update README.md clarify language about QA for tests * Update README.md typo * Update README.md added info about enforcing 100% coverage in the pytest command * add more about predefined fixtures to the README * comments till test_read_histogram_from_file * comments on test_read_histogram_from_file * comments till test_CO_radius * deal with comments till test_calculate_core_boundary * remaining comments in test_common_functions.py * finish addressing first round of comments by Max * use np as alias for totest.np * fix typo in data_download.py * fix typo in test_common_functions.py * fix typo in docstring of common_functions.py * fix typo in test_common_functions.py * fix typo in common_functions.py * Update test_common_functions.py change naming of data examples to be more descriptive * Update test_common_functions.py fix bug caused by extra spaces * add comments and more names * remove unused bad_profile2 * more cleanup * follow PEP8 strictly, reset attributes calculated for CEE --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * period_change_stabe_MT -> period_change_stable_MT (#467) * PSygrid force int input (#440) * PSygrid force int input force the user to input an integer. This includes numpy versions of int. If this is not forces, the `initial_values` and `final_values` can be loaded with a 1 value array/list, but the `history1`, etc are not loaded with that input. As a result, `None` is returned for those and it looks like the history is empty. * add extra check for `contains` raises an error in index in `__contains__` and `__getitem__` is not an integer * Change error type of IndexError Preferred way to raise error: """if key is a value outside the set of indexes for the sequence (after any special interpretation of negative values), IndexError should be raised. For mapping types, if key is missing (not in the container), KeyError should be raised.""" https://docs.python.org/3/reference/datamodel.html#object.__getitem__ * change to 'index' * edited docstring to match arg name --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * Backpropagate changes on main/max_requirements into development (#456) * Update README.md * Update install.rst * Update install.rst * Adding an option to create a VH diagram w/ BinaryStar objects (#158) * Adding an option to create a VH diagram w/ BinaryStar objects * Update VHdiagram.py * Update VHdiagram.py --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update README.md - main (#188) * Update README.md Update the readme to remove the installation instructions so that we do not have to maintain the same instructions in two places. Currently, the instructions in the readme are not the same as the ones in the documentation. * Update README.md I also edited the text to match the deve version * V1 python_utils fix (#191) * add python_utils==3.5.2 requirement * Update setup.py Limit `more-itertools` to its latest python3.7 version. * Update V1 conda setup (#199) * update conda dependencies for latest python3.7 packages dependencies + remove pyqt5 dependency * update astropy + pyqt5 versions * change pyqt to 5.15.4 * Updates in installation instructions in the V1 documentation (#201) * Updated installation instructions in the v1 documentation * Simplifying sections and removing git-lfs mention * Update install.rst * No change? * Adding OSX-ARM installtion instructions. * Update install.rst Add the conda channels to the OSX-ARM architecture --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * conda_v1 fix (#266) * change dependencies to have a maximum and release the numpy dependency * add maximum to setup.py too * point to updated GH action * Change numpy dependency * fix * change numpy version in setup.py too * solving for an old sk-learn numpy issue * Update publish-to-anaconda.yml (#270) changes publish-to-anaconda to development version. * update v1 for scikit-learn version (#292) * update v1 for scikit-learn version * Update setup.py * Update meta.yaml numpy 1.20 deprecates "np.float", which exists in v1 code * Update setup.py * Update conda version number (#304) This is required to publish Elizabeth's changes to conda * fix maximum requirements * fix scikit-learn version and remove email from AUTHOR_EMAIL. * v1 in mesa_dir the search for "v1/" should be in the full mesa_dir not the dirname * update zenodo link and md5 hash * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * Update meta.yaml * Update meta.yaml * change publish-to-anaconda to publish on a github release publish * typo fixed in documenation * Change installation instructions to specifically request v1.0.4 (#450) * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * publish only to anaconda on releases * fix found typos in v1 documentation * Update publish-to-anaconda.yml (#454) Point towards POSYDON-code/ version of the publish-to-anaconda action. * remove redundant lines in post_processing.py * add e-mail to setup.py * remove updated VH Diagram plotting code for a single binary. Surrounding code has change, see PR#456. * change default mem_per_cpu to 7G" * update version + installation instriction + link to releases + zenodo --------- Co-authored-by: Simone Bavera <32518238+ssbvr@users.noreply.github.com> Co-authored-by: sgossage <seth.gossage@cfa.harvard.edu> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: tassos25 <tassos25@users.noreply.github.com> Co-authored-by: Konstantinos Kovlakas <22239544+kkovlakas@users.noreply.github.com> Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * update zenodo url and md5 (#470) Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * error check for undefined states in BinaryStar (#468) * add error check for undefined states in BinaryStar, add undefined states to flow chart * update posydonerror unit test * update unit test again * remove BinaryStar and SingleStar from posydonerror, move initcond message to BinaryStar * fix unit tests again * Update step_merged.py (#480) Import ModelError in step merged. * No check for WD formation in double CE case (#484) * Update common_functions.py Move double CE into contact detection and return afterwards to skip checks on WD formation. * add tests which would fail on the old code * handle H-rich RLO binaries and clarify verbosity of detached step (#430) * clean-up code and clarify verbosity of matching in detached step * reorganizing some code in detached step, clarifying verbose output * fix bug in matching, add criteria to check for HMS-HMS-RLO binaries in detached step * add list of step names to SimulationProperties * add separate error catch for HMS-HMS binaries in RLO in detached step * Merge remote-tracking branch 'origin/development' into camille_matching_strippedHe_to_Hrich * add ClassificationError to unit tests * remove space at end of line in unit tests * fix unit test * remove classification error from unit tests * fix classification error * fix line length in test_posydonerror.py * Grid slice plotting system selection fix (#475) * replace selection + add docstring * Update plot_pop.py changes: - plot_extension doc string - prop description if None * add missing binaries to UNDEFINED_STATES in flow chart (#489) * add missing binaries to UNDEFINED_STATES in flow chart * add WD systems to undefined states * add for loop for undefined states in flow chart * separate IMFs + create basic tests * add pytest.approx around remaining values * move salpeter tests into its own class * add Kroupa2001 IMF and its unit tests * add flat_mass_ratio dist and Sana12 period * Update issue templates (#491) * Update issue templates * Update bug_report.md * add temp norm_pop.py file to restructure underlying_mass calculation * add single star contribution, works for f_b=1 in sample. Unclear if f_bin!=1 in sample works correctly in original version * Update installation-guide.rst to include note about adding conda-forge (#495) * Update installation-guide.rst to include note about adding conda-forge I came across an issue related to installation. It turns out that many of the required packages specify versions only available on conda-forge which can cause a huge headache for unaware users. I have updated the installation documentation to include this note. * Adding conda-forge documentation to troubleshooting page --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> * add 'm*' to simulation weight * Protect run_psycris_sequence, from misc imports (#436) * add dunder main to run_psycris_sequence, add type checks to cmd args * Add some docs * Delete random file * additional comments in norm_pop * add more dump_rate info to docs (#500) * add dump_rate info to docs and ini file * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * Update population_params.rst * Update code-questions.rst * Update population_params_default.ini --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * replace scipy interp1d with alternatives (#433) * replace all instances of interp1d except for in profile interpolation * remove interp1d from common functions unit test * add parameter type checks to rejection sampler * changes to common functions unit testing * fix unit test * fix unit tests again * define own interp1d and revert replacements * clean out white spaces * replace interp1d in profile_interpolation * readd ClassificationError * add fill_value, left, and right * cleanup * remove import * Update interp1d to include option for fill_value="extrapolate" * edit error message for fill_value * Update test_interpolators.py to include fill_value="extrapolate" * update all to ndarray; add missing unit tests * fix docstring * correct description --------- Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * Add support for unsorted input in new interpolators (#502) * add check for increasing or decreasing arrays. Flip accordingly * add unit test for flipping + add check for x,y being None * remove None check * shuffle stuff around * move tests to init * use np.flip to create a copy of the original data instead of a flipped view. Just in case the data gets changed along the way * implement suggestions * add sorting for non-monotonic values. Required for some step_SN parameters * Update test_interpolators.py * fix typo --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * replace NaN/None in input chi_eff calculation with 0 (#501) * add nan checks for spins + tilts * add docstring * remove np.ndarray wraping" * implement comments on using pd.na: * Update transient_select_funcs.py remove empty line generalize warning text * Update transient_select_funcs.py --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * updating the data_download routines slightly (#496) * updating the data_download routines slightly * Fixing unit tests accordingly * Fixing one more unit test * Adding comment to force unit tests to re-run * Added DataError as a POSYDONError and included raise DataError for missing PATH_TO_POSYDON_DATA environmental variable * revert DataError and use NameError; add unittest * Use FileExistsError --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * rewrite of normalisation into separate components * add TODO+warning that alpha needs to be changed back for the Salpeter IMF * Use of `PATH_*` variables (#505) * update and test config * always import PATHs from config * put the downloaded data on the path without POSYDON_data * use dirname, where POSYDON_data should be skipped * debugging * debugging * use os.path.join * cleanup * Update config.py docstring * Fixes to Troubleshooting & FAQ Docs (#517) * initial read-through fixes * more changes to code-questions docs * Update docs/_source/troubleshooting-faqs/code-questions.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/troubleshooting-faqs/code-questions.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * replace @ symbol --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Add files to installation (#526) * add init files to detect packages; include files in MANIFEST.in * add comment * Fix logic flow in matching (#521) * fix logic flow in matching, clarify matching verbose output * add "center_h1" to matching verbose output * make if/else checks and flow more consistent * add accreted_He_Shell_H_burning stars to flow, detached step (#522) * Issues with undefined values of SN_MODELS (#482) * Update step_mesa.py replace undefined variable key and check fv for CO_type * Update step_mesa.py Check for key and otherwise show warning and set value to None. * Update step_SN.py np.isnan -> pd.isna * Update step_mesa.py change None to np.nan * Update step_mesa.py Set model to None. * Update step_mesa.py ensure None is not overwritten * add end of step prints for verbose * typo * use pa.notna * replace isnan (#527) * Fix logic for single star fraction population normalisation (#509) 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`. * Pulsational Pair-Instability top-down mass loss approach (#417) * 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 * Blandford-Znajek jet energy calculation (#429) * 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> * Split popsyn plotting into separate components for future modularity (#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 (#532) * 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> * replace underlying mass calculation with probability reweight per model * move binary fraction into PDF * remove unneccesary lines * add calculate_model_weights separate * add additional error for impossible reweights * add basic tests for normalisation. These tests reweight a population and sample from the requested reweight population. Then it compares a selection in both populations to see if they're close. I performed a convergence test on the method implemented and the final results converge. * remove old tests * rename func call * add Chabrier2003 IMF * restructure code to an abstract class with sub-classes and add unit_tests for Chabrier IMF * add actual new tests * add Chabrier IMF tests" * dynamical find IMF (primary mass scheme) based on available ones in IMFs.py * add unit tests for the sub-functions in norm_pop.py * add docstrings to different IMFs * small cleanup/addition * flip notation * alter Kroupa2001 IMF calculation * remove old test_weights file * Update setup.py (#536) sphinx at least 8.2.2 * GitHub action fix (#537) * change to v4 * add to CI for testing checkout and setup python versions * change other versions to 'latest' * Update MESA-grid tutorials (#535) * 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 * Modular data download (#507) * 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> * Decouple ECSN treatment from SN_MODELS (#504) * 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 (#512) * add WDs to infer_star_state, incl. testing and new limits * add references * Update setup.py (#541) change >3.10 to >=3.11 * Upgrade setuptools (#542) * create new pyproject.toml; try to reuse setup.py as much as possible * add refs * implement self.mbreak suggestion: * remove duplicate line * change name + pass func * add Return explanation to docstring * cleanup + add period_PDF function. Not yet in weights * set post SN binary to disrupted in case there is a massless_remnant (#548) * Update population_params_default.ini (#544) Update to give the correct usage for the engine if 'other' mechanisms are used * Add check for valid MODELS in posydon-setup-popsyn (#545) * add check for valid MODELS before popsynth setup script runs * move repeated code into a separate function in the MODELS.py file * move repeated code into a separate function in the MODELS.py file * Update posydon/grids/MODELS.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * add the option to add kwargs to primary_mass scheme * add an option to pass parameters to the IMF PDF creation for customisaion of the IMF slopes/breaks etc * Add total_mass_h1 and total_mass_he4 (#529) * add total_mass_h1 and total_mass_he4 (utils, vis not yet checked) * add values to plot defaults * update doc * copy bug correction from PR435 * exclude accreted_He_Core_H_burning state from HRD for single stars * rework model weights in the TransientPopulation to account for double indices in the TransientPopulation * clean up files * add fix for flipped masses in the sampling. Probably because the system was flipped by the population synthesis * add correct size for tmp_model_weights when setting a chunksize smaller than the total population * remove old function + add coverage setting file * add docstrings * Add unit tests: grids (#435) * rename rae2a to rad2a * add unit_tests: readme, test_constants.py, test_limits_thresholds.py * add template * add authors to ignorereason.py * add test_ignorereason.py * add test_posydonerror.py * edit docstring * add test_posydonwarning.py * update readme * add test_data_download.py * transfer to pytest (outstanding: test_posydonwarning.py, test_data_download.py) * account for the comments of Max * transfer test_posydonwarning.py to pytest * transfer test_data_download.py to pytest * add configfile.py * cleanup * Create test_installation.py using this as a simple example to try out automated testing framework * Create continuous_integration.yml Automatic trigger for tests (currently just installation but can include any combination) for PRs created to main or development. Tests on ubuntu, mac, and windows environments. Currently just testing python 3.11 but can add other versions if desired. * Update continuous_integration.yml fixed path to installation test file * Update continuous_integration.yml making mac the first test out of the three OSes * Delete posydon/unit_tests/test_installation.py realized this could just be included in the github workflow * Update continuous_integration.yml changed to include full posydon installation step to remove redundancy. Currently including all extras in the setup.py but can remove any if needed. * Update continuous_integration.yml removing extras from the every-PR test. I'll move them to a weekly test instead. * Create install_extras.yml scheduled cron job testing installation of setup.py extras, every sunday * Update continuous_integration.yml * Delete .github/workflows/install_extras.yml * Delete .github/workflows/continuous_integration.yml * add test_gridutils.py * add test_common_functions.py * update doc * merge development and update tests; include test in continuous_integration.yml * add pytest/cov install to continuous_integration.yml * add posydon install to unit test run * Change to environment python version For some reason, the environment `pytest` command doesn't get overwritten correctly with the local runner environment one. Probably because the PATH order is weirdly set. Running `pytest` through `python -m` works. * add environment varable exports * Update continuous_integration.yml clarify step name for CI * remove old code * start unit tests for grids * add test_termination_flags.py * include new test in CI * fix CI * add test_scrubbing.py * add test_MODELS.py * add test_io.py * make test flexible for different OS * add test_downsampling.py * start with test_psygrid.py * np alias, file+path * more tests on psygrid * small corrections * adopt style * test_join_grids * add/edit docstrings and continue on PSyGrid tests * generate test MESA gird * decide_columns * more special cases of MESA runs * further grid tests * more grid tests * tests till 70 percent coverage * more gird tests * test till 71 percent * finish tests for _create_psygrid * more tests; clarify errors; restructure PSyGrid for testing * correct typo * workaroud for test interactions * more tests * add Error for new_mesa_flag * cleanup * finish PSyGrid class * finish test_psygrid.py, beside one todo * more checks on PSyGrid creation * add first tests of post_processing * remove old test * cleanup * check more errors * more test on post_process_grid * finish PR * cleanup * add SN data to unit tests to avoid download * Update posydon/unit_tests/README.md Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update posydon/unit_tests/README.md Co-authored-by: Seth Gossage <sethg45@gmail.com> * merge development, resolve conlicts, and update README * reword error message of wrong index * make test for missing and new objects more detailed * add Runtimeerror in case a system tool does not work as expected * add fixture to link temporarily SN data if needed --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * remove .coveragerc, because it causes the tests to fail. Put in a different PR * add test_get_MODEL_NAME (#553) * Mesa api doc (#520) * Update fixed.rst Fixing typos and grammar errors in Run a fixed mesa grid * Update inifile.rst * Update inifile.rst * Update fixed.rst typo fix * Update dynamic.rst Change the TODO * Update fixed.rst Bold text * bold removed * ini file replaced with .ini file * Update fixed.rst Changing the ini file to be consistent with other docs * Update inifile.rst changing the ini file * Update dynamic.rst Adding Kyle's paper and POSYDON mailing list * Update docs/_source/components-overview/mesa_grids/fixed.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: dimsour94 <dimitris.souropanis@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Rename step9 to stepF (#558) * rename step9 to stepF * update example INI files * Add conda install of mpi4py (#556) Additionally add macos-13 to run on * FAQ about slow `conda` (#551) * add FAQ about installation instructions * Update installation-issues.rst * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update installation-issues.rst --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Seth Gossage <sethg45@gmail.com> * conform to 80 character limit * add missing doc strings * add valueerror * remove old normalised_pop_mass functions * change to monkey patch * change to np.array return * add m_min m_max checks * use monkeypatch fixture * adapt tests based on comments * implement comments * conform to 90 character line limit * include comment * clean up * fix monkeypatch * add additional mass ratio PDF option + adapt test for it * add unit test invalid mass_ratio scheme defaulting to flat q * add positive mass warning * add CI for IMFs and norm_pop * remove period PDF * correct writing to dataframe * remove deprecated import * fix missing imports * Unifying the code for finding grid boundaries and checking validity in case of ignored data. (#271) * Automatically find boundaries of the grid at the superclass, to avoid code repetition. * Removing unused variable. * Correcting (visual) indendation issues. * Do not use ignored and failed runs to determine the grid boundaries. * Adopting suggestions regarding variable names. * Add check that profile is well defined in SN (#559) * add check for profile * add seth's suggestions * Add posydon-popsyn setup, check & rescue (#550) Renames the `posydon-setup-popsyn` CLI to `posydon-popsyn` and implements the sub-commands `setup`, `check`, and `rescue`. - `setup` performs the setup of a population synthesis run, as before. - `check` verifies a population run and checks if the requested number of binaries is present. - `rescue` allows the user to create resubmission files for failed Slurm array jobs. [commit changes] * restructure + add run check script * rename + adding the rescue option * Add resubmit_slurm.sh submission options * update tutorial with new command name + add new commands * add check if there are failed jobs or not * remove unused imports * add empty missing_indices * update run in rescue script * change path + merge job name * implement comments and improvements from Matthias * 80 character limit + additional doc strings * remove required for already required input * added output for other output too * Update posydon-run-pipeline (#569) * update docs: installation, processing pipeline, ML components (#513) * Update installation-guide.rst -fix typo "instractions" -move environment variables step ahead of download posydon data, which requires the variables to be set * Update pipeline_steps.rst fix typo "girds" * Update processing-pipeline.rst * Update processing-pipeline.rst * Update psygrid.rst for language * fix typo * fix typos * add spaces for readability * Update psygrid.rst language for clarity * Update pipeline_ini.rst Found small typos and made small changes for clarity. I think a lot of this could be rewritten for clarity, but I don't understand this part of the code enough to do that. * Update machine-learning-components.rst Typos * Update initial_final_interp.rst minor changes to IFInterpolator * Update initial_final_interp.rst Typo * Update psygrid.rst to put quotation marks back in to denote strings for the keys * change .ini to *.ini * Update machine-learning-components.rst typo * Update psygrid.rst language for clarity * Update psygrid.rst language for clarity * Update installation-guide.rst for copy edits * add arguments table for join_grids * fix table * fix table * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/components-overview/post_processing/psygrid.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * clarify grid config properties vs physical grid properties * Update posydon-run-pipeline for typos * Update pipeline_steps.rst * Update pipeline_steps.rst language for clarity * Update single_star.rst change star state example * Update binary_star.rst updating star states * Update custom_hooks.rst fix spacing in code example * Update pipeline_steps.rst language for clarity * limit lines to 80 characters * Update pipeline_steps.rst * restrict lines to 80 characters * restrict lines to 80 characters * restrict to 80 characters per line * Update pipeline_ini.rst for line length * Update initial_final_interp.rst for line length * Update pipeline_steps.rst style fix * Update psygrid.rst for style * Update pipeline_ini.rst * Update pipeline_steps.rst for style consistency * Update pipeline_additions.rst for style consistency * Update processing-pipeline.rst for style consistency * Update initial_final_interp.rst for style consistency * Update ProfileInterpolator.rst * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update pipeline_additions.rst for line length * Update pipeline_steps.rst for line length * Update psygrid.rst for line length * Update pipeline_ini.rst for line length * Update initial_final_interp.rst for line length * Update initial_final_interp.rst * Update ProfileInterpolator.rst for line length * Update machine-learning-components.rst for line length * Update pipeline_steps.rst * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update initial_final_interp.rst * Update machine-learning-components.rst --------- Co-authored-by: Philipp Moura Srivastava <philipp.msrivastava@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Kyle Rocha <48293898+ka-rocha@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * Move bin code to utils: compress-mesa (#564) * move code * bug fix * add first tests; restructure command line arguments * outsource helper functions for tests * verbose check * finish test_compress_dir * finish test_set_up_test * take care of comments by Max * add docstring to get_size * add more docstring * add suggestions by Seth * Update install_extras.yml (#576) * Update install_extras.yml (#578) * POSYDON docs build multiple version (#554) * add versioning + automatic fetching of docs * comment out deploy action * remove git fetch * cleanup * remove PATH_TO_POSYDON * add MESA_DIR and PATH_TO_POSYDON_DATA * add reinstall for autodoc * do v1 generation * add v2 + install wheel for python 3.9 * positive grep * add wheel install v1 + remove from v2 * remove development for now * use as path * change out folder * add * change build_path * change build_path again * change checkout + path * add v1 & v2 make documentation * update _build for v1 documentation * show current version in documentation instead of latest * rename folder * remove old unused unstable workflow * Update docs/_source/conf.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * typo * fix typo * remove development doc make from release * remove v2.0.0-dev tag from version TAG list * remove dry-run commands * add v1 and v2 distinction + treat v2.0.0-dev as an indicator for development creation * force remove dirty for current version doc build, because copying files into version necessary * fix * link cleanup * add injection grab * move subprocess * add current version * change old_tags name * change posydon_version old tag version * posydon cleanup too * only apply injection to old v2 verions * add dry-run back in * template -> templates * add symlink process to latest release version * check for all dev tags of v2.X.X versions Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * implement comments * check for latest non-pre-release version * Update .github/workflows/deploy-github-pages-release.yml Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update .github/workflows/deploy-github-pages-release.yml Co-authored-by: Seth Gossage <sethg45@gmail.com> * remove dry-run --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * Hotfixes new documentation build (#585) * Add fetch-tags:true Currently, not all the tags from Github are correctly pulled in this workflow, as such the code fails. * add v for folders + links to make all consistent * Add v for folder creation and in linkage * posydon-popsyn multi-jobID fix (#581) If multiple population synthesis reruns are present, the jobID check was returning a list of one. This should have just been the jobID. This corrects that selection. * Hotfix documentation-build again (#588) Another fix to the building of the development version. This time, entering the git folder I don't understand why this worked locally with Local Github Actions (act) and not on the actual Github Actions. Is the workflow different? * add fetch-depth:0 to documentation workflows (#593) * Bump miniconda version to v3 and add proper bash shell initiation (#594) * bump miniconda version to v3 and add proper bash shell initiation * clean up * remove sourcing conda; already done with bash -el * add pip upgrade back * Update install_extras.yml * remove check on PR * Change ECSN default to Tauris+15 (#571) * change ECSN default and comment defaults in MODELS * function: get_MODEL; update tests * Update population_params_default.ini Add allow_spin_None to default ini file. * Update posydon-popsyn add verbose_on_fail * get at least mass in get_initial_BH_properties * update docs * adopt pre defined SN models; rename MODEL to SN_MODEL * adjust test mass to give BHs; rename prop * update population_params_default.ini to default SN model * change values for Farag matching * refer to v2 interpolators * add back Sukhbold+16-engine * Add supernova engine (#597) * Update SN_MODELS.py Add S19.8 engine, rename SN_models for easier addition of more changes * update docs and ini files * rename SN_models * Add eccentricity as option for parsing grids (#575) * update absolute imports and default ini with some docs * Changed grids.io to parse mesa grid dirs with changing eccentricity * Removed hotfix comments for PR * remove spurious spacing * Updating unit test to correspond to initial eccentricity in filename * Update posydon/unit_tests/grids/test_io.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * change output folder (#595) * F2 f population docs (#525) * Update 10_binaries_pop_syn.ipynb Fix typos * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb test * Update lgrb_pop_syn.ipynb * Update pop_syn.ipynb * Update pop_syn.ipynb * Update bbh_analysis.ipynb * Update custom_step_and_flow.ipynb * Update docs/_source/tutorials-examples/population-synthesis/bbh_analysis.ipynb Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/tutorials-examples/population-synthesis/bbh_analysis.ipynb Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update pop_syn.ipynb * Update bbh_analysis.ipynb - more verbose * Update bbh_analysis.ipynb - clarity * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb clarity * Update bbh_analysis.ipynb addressing a few typos and clarity * Update lgrb_pop_syn.ipynb clarity * Update one_met_pop_syn.ipynb addressed typos and consistency with code updates * Update bbh_analysis.ipynb argument name update * Update one_met_pop_syn.ipynb typo * typo * Update evolve_single_binaries.ipynb typo * Update custom_step_and_flow.ipynb; adding clarity * Update custom_step_and_flow.ipynb small addition to last commit * Update custom_step_and_flow.ipynb * Update custom_step_and_flow.ipynb * some variables are not defined so I removed them. one is introduced later in the tutorial * maybe this change is wrong but I was unable to pip install .[vis] * Update - all but the last cell works with v2 population * added --account argument to posydon-popsyn Quest example. Without this, job submission will fail * Small typo fixes * add pending review changes --------- Co-authored-by: Monica Gallegos-Garcia <monicagallegosgarcia2024@u.northwestern.edu> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * Change supernova models (#598) * Update SN_MODELS.py change S19.8 to W20 * Update population_params_default.ini * Update population_params_end.ini * SFH bug fix, rewrite, and basic tests (#543) * combine SFR_Z_fraction and star_formation_rate into a single function call, which pre-calculate the multiplication for speed improvemen * add correct select_one_met in function * move SFH into separate classes with abstract inheritance * Move SFH to classes (with abstract treatments) + Add Chruslinska+21 SFH models * fix fSFR. Now sums correctly to 1 at each redshift. * add fSFR unit tests * add additional basic tests * fix double naming of SFR * add tests for new SFRs * remove old SFH code; not used anywhere * move std_log_metallicity_history * add dosctring for abstract class * add docstrings * rename variables * add more doc strings * add even more docs * more doc strings * add checks for required parameters in MadauBase * docstrings: * change name of SFR_per_met_per_z function * alter unit tests to adapt to previous changes * change ' to " * cleanup line lengths * change output fSFR and _call__ dosctring to ndarray * add check for model parameters required * restructure + integrate only between Z_min and Z_max + add option normalise * Z_max check * update the SFH to use Z_min and Z_max and normalise. Move the splitting per metallicity bin to its own function. Additionally, revamp the unit tests to be more in style with the other unit tests and adapt them for the new functions and treatment of the metallicity bins. * fix name typo * remove Z_max requirement for Chruslinska * implement Matthias comments * change to rates.MODEL * change comment * add test for get_SFR_per_met_at_z * make sure to test branches * add SFH tests * add space * remove duplicate lines in IllustrisTNG class * move ConcreteSFH into a fixture * Add support for Zmin and Zmax inside bins and inside the same bin. * add doc string + remove select_one_met * replace MODEL with SFH_MODEL * change DEFAULT_MODEL to DEFAULT_SFH_MODEL * add to default Zmin,Zmax=None + normalise=True * update docstrings: * clean up star_formation_history file * update unit tests + implement comments * update call method test * add std_log_metallicity_dist integer support * make explicit regex expression * update unit tests & implement remainder of comments Matthias * cleanup * warning cleanup * add SFHModelWarning + add sort check * change to sphinx reference style * add reference * add check for None output in error * add unit test for unsorted Metalicity bins * suggested change * add new warning class to test * Update posydon/unit_tests/popsyn/test_star_formation_history.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update README.md (#599) * Update README.md * Apply suggestions from Seth Co-authored-by: Seth Gossage <sethg45@gmail.com> --------- Co-authored-by: Seth Gossage <sethg45@gmail.com> * Changes in the MESA documentation (#524) * minor text change in 'I. Running your first MESA simulation using POSYDON' * changes up to 'Run one binary on your laptop for debugging' where I had error with work_dir * partial changes to the tutorial * small last changes in the documentation * adding matthias comment on work dir * Update docs/_source/tutorials-examples/MESA-grids/laptop.ipynb typo Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Re-writing step-CE for improved flow and logic (#574) * change the core radius for the stableMT option * Updating step_CEE.py * Re-writing step_CEE alpha_lambda prescription code * Updating code * updating common_functions list of functions to test * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Removing core_not_replaced_noMT option from documentation * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Updating mass loss due to merger in CEE * Update common_functions.py * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update step_CEE.py * Update step_CEE.py * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Updated due to code review comments and changing CE function names * Missed this previous update * Updating documentation * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update posydon/unit_tests/utils/test_common_functions.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Moving from double quotes to single quotes * Update posydon/binary_evol/CE/step_CEE.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * fix option names as Zepei reported * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * add compt_type to CEE_adjust_binary_upon_merger as requested by me and Max --------- Co-authored-by: ZepeiX <Zepei.Xing@unige.ch> Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * Check for array-like data in `BinaryStar.to_df()` in case of failed binaries (#580) * Update binarystar.py adding a check for array like data and pad w/ nans as before, but with the right data type * Update binarystar.py operate on column element rather than the column itself * Update binarystar.py rename data_len to element_len * initialize V_sys as numpy array, rather than list, to match subsequent data types * added new dtypes in popsyn/io.py: object.string and object.float64 to differentiate subtypes of objects. Dynamically determine filler values when extending failed binary data columns * remove debug print statements and also add in default case if somehow a data column key does not exist in dtype dictionary * remove max_ele_length initialization, superfluous * added new sub dtype dictionary in popsyn/io.py to hold specs on dtypes within an object, now default to NoneTypes in case a definition is not found, which is converted to nan in case of single values (not objects), also now nearest_neighbour_distance is initialized as a float array rather than a string array * added empty string definition for cases of missing dtype definitions * Update posydon/binary_evol/binarystar.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update posydon/binary_evol/binarystar.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Cancel signal alarm in case binary failed (#608) * cancel the signal alarm * typo fix * remove min m2 * Documentation fixes (#605) * clean up dead links * fix typos * fix more typos * more spelling/wording changes * spelling mistakes + update Collaboration team (name error + core dev team) * fix * more typos * 1_HMS_HMS checked * baic number * fix more typo's and grammar * fix pop_syn notebook * fix pop_syn notebook * collaboration link change + spelling * 10 binaries + custom_steps * revert POSYDON capitalisation * revert POSYDON capitalisation * remove team page and link to website page * typo fix * revert POSYDON accronym capitalisation. * Update docs/_source/index.rst Co-authored-by: Matthias…
* TransientPopulation overplot crash fix (#374) * check if no binaries are selected for the slice to mitigate crashing * Update plot_pop.py space change * fix get_redshift_from_cosmic_time() function (#381) * Replace job_start for running grids (#380) * turn start+end to end+before_end+now * Reduce number of CPUs for cleanup jobs Usually, cleanup is limited by the file system, hence request less CPUs. * add missing binary states to flow charts and error catching fo future missing states * add verbose block, move return statement * add an escape option if value cannot be found in the grids (#385) * Population() fix for large memory usage when reading files (#386) * add an escape option if value cannot be found in the grids * Fix pd.read_hdf() memory usage + restructure code move select, tail and head into a DFInterface class from which History and Oneline inherit * add init parameter. fix copy bug + generalise (html) repr. * add missing return in Oneline.__get_item__() * replace Oneline slice selection with self.select() * Change docstrings - Add that you can only query where on the index or string columns. - Changed some wrongly named tables in the docstring - Change the example `where` selection. * Initial RLO boundary limit (#389) * Update limits_thresholds.py Add new threshold: MIN_COUNT_INITIAL_RLO_BOUNDARY * Update termination_flags.py Return the default if the initial RLO boundary isn't well enough populated. * Add warning * Update limits_thresholds.py Try larger value. * Small Population fixes (#390) * remove printing for intrinsic rate calculation + do not fail TransientPopulation calculation if empty population is created * fix channel grid_overplotting * Add docstring + change warning * add catch to suppress python warning in detached step (#392) * add warning catch to detached step * update comment * change POSYDON warning type * Add LBV_wind+dedt+hepulse rerun (#393) * Update posydon-run-pipeline enabled LBV_wind+dedt_hepulse rerun and updated associated SHA * Update pipeline_steps.rst added/updated descriptions for new rerun types * Update posydon-run-pipeline updated SHA for rerun after removing age limit stopping conditions * Update pipeline_steps.rst updated description for new hepulse rerun that removes stopping conditions for low mass stars based at TAMS/Hubble time * Update posydon-run-pipeline updated SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * Update posydon-run-pipeline update SHA * remove failed states from flow and raise POSYDON errors instead * add more info to DCO error message * Update independent_sample.py (#394) Add default value for orbital_scheme and update doc-string * Update posydon-run-pipeline (#396) update SHA for hepulse rerun -- fixing seg faults that could occur when storing variables for point masses * Relax number formating for mesa inputs (#401) * Update posydon-run-grid Always use exponential writing for the `inlist_grid_points` and replace `e` by `d`, which is needed for FORTRAN. * Update posydon-run-grid Ensure, that only the float is in the replacement and adopt other cases where inputs for MESA are written. * Update IF_interpolation.py (#399) * Update IF_interpolation.py Updated k to be a minimum of 3 to prioritize smoothness * Update IF_interpolation.py so k is at least 3 * Update IF_interpolation.py refinement to make k = 3 * Update IF_interpolation.py * Update setup.py Add additional numpy requirement * Add "last" to TF12 for stable MT (#405) * update profile interpolation for consistency with paper (#397) * update for consistency with updated methods for paper * make nan warning more specific * make prediction inputs in linear space to match IF interpolation * add customizable nn shape to composition profiles * streamline Composition code for learn_bounds(), separate H-rich H-burning profiles from H-rich advanced burning profiles, add code to customize neural network shape for composition profiles * set up prediction framework for Composition that creates the 'H+He' profile first and subtracts H profile to get He profile * separate density profiles and composition profiles training * replace np.isnan with pd.isna * change InappropriateValueWarning to IncompletenessWarning in the case of nans in final values * typo * set random seed value to None by default to make it optional, update docstring * change 'lr' variable name to 'learning_rate' * added warning for if stars that should have a flat profile are not flat * eliminated redundant line * fixed docstring for density class * clarified the order of returned objects, added a condition for case where no models are selected for training * added returns so as to not exit functions after posydon warning * tie up loose ends * corrected issue with an error check specific to one parameter * small change to definition of scalars to comply with new pd command * fixed double equal sign that should be single equal sign * fix ref to predicted mass transfer classes * add empty array for predictions * fix issue with predictions * remove unnecessary print statement * rename "stripped_He_Core_H_burning" state and add to flow chart (#404) * stripped_He_Core_H * add "accreted_He_Core_H_burning" state * add rounding for surface_h1, center_h1 values when determining star state * move accreted_He state to list of HMS star states * fix plot defaults * add accreted_He_non_burning state * add states back to plot defaults * add "accreted_He_Core_He_burning" state * remove testing print statement * allow double He-rich star binaries in RLO to merge (#414) * update star states in step_SN (#416) * Automatic testing of installation (#425) * Create continuous_integration.yml Testing installation for mac, ubuntu, windows with python 3.11 (can add other versions). Automatically triggered for all PRs to development and main. * Create install_extras.yml scheduled weekly cronjob to test installation with all extras from setup.py * QA for installation test I am inserting a requirement for a nonexistent package just to make sure my automatic installation test workflow catches it. Will revert this change afterwards. * reverting change for QA it worked! reverting now * Update continuous_integration.yml removing windows * Update continuous_integration.yml remove windows condition * Update install_extras.yml remove windows * always initialize values for separation and orbital period in BinaryStar (#426) * add explicit separation and orbital period initialization in binarystar constructor * add catch if star masses are None * error catch for He-rich stars in RLO onto H-rich stars (#423) * add error catch for He-rich stars in RLO onto H-rich stars in detached step * minor changes * New normalized_pop_mass.py file (#376) * normalized_pop_mass * synthetic * authors added * space added * # added * if statement added * Replacing error with a Warning * df1,df2 added in binarypopulation.py * dataframe handling removed * changed from None to 0.0 * underlying mass calculation separate function * change sum to nansum * add checks for underlying_mass existence * simulated_mass not summed again for each loop * rename df and inclusion of f_bin_nature * inclusion of f_bin nature * getting single and binary mass from the independent sample option * modified warnings * binary fraction correction * store the calculated underlying mass to the file * updated doc-strings and making it consistent at case boundaries * correcting some typos and respecting the 80 characters line length --------- Co-authored-by: Dimitris Souropanis <qmh9626@quser31.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser34.quest.it.northwestern.edu> Co-authored-by: Max Briel <max.briel@gmail.com> Co-authored-by: Eirini <kasdaglie@ufl.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser33.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser32.quest.it.northwestern.edu> * Update README.md (#434) Add v2 paper * update installation test to include M1 and intel chips for macos (#428) * Update continuous_integration.yml add macos-14 github runner which uses the apple silicon M1 chip: https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ * Update continuous_integration.yml macos-13 runs on intel chip, macos-14 runs on apple silicon M1 chip * Update continuous_integration.yml changed the M chip specification from macos-14 to macos-latest * Add default legend titles based on the termination flag (#432) * add default legend titles based on the termination flag * typo * special case of SN_type, CO_type, state * change to release on publish (#452) * Update publish-to-anaconda.yml (#455) * small fix to BBH selection function (#403) * small fix to BBH selection function * rename spin_orbit_tilt to spin_orbit_tilt_at_merger * add docstring info + change function name (not called anywhere) * Tutorial updates with recent PRs + feedback from collaboration meeting (#406) * normalized_pop_mass * synthetic * authors added * space added * # added * if statement added * Replacing error with a Warning * df1,df2 added in binarypopulation.py * dataframe handling removed * changed from None to 0.0 * underlying mass calculation separate function * change sum to nansum * add checks for underlying_mass existence * simulated_mass not summed again for each loop * rename df and inclusion of f_bin_nature * inclusion of f_bin nature * getting single and binary mass from the independent sample option * modified warnings * binary fraction correction * store the calculated underlying mass to the file * remove note on mpi4py installation on tutorial" * update 10 binaries tutorial * remove mpi4py todo. Installtion only required for multi-core MESA runs * add FAQ answer for select columns error: * consistent naming of channels * update default parameters" * Update popsyn script to 5G default * add custom flow example * add memory usage FAQ * add custom step and flow in notebook * change focus of debug population on evolving single binaries * add references to new notebook * remove output of cells; should be added back to make nicer notebooks * clean tutorial output * add additional FAQ and installation issue * clean up documnation for population params file, SingleStar, and BinaryStar * additional changes * change tutorial to 10 binaries + 1 metallicity, as per discussion * remove reference to personal datapath * cleanup bbh notebook * add warning about default values * Update normalized_pop_mass.py make it the same as development. * Update normalized_pop_mass.py * implement comments Matthias + Seth * fixed additional comment * additional missed comments * Update custom_step_and_flow.py * Update step_CEE.py * Update population_params.rst add warning_verbose and error_checking_verbose * Update population_params_default.ini Add error_checking_verbose and warnings_verbose * Update code-questions.rst Add papers + remove example approximation. --------- Co-authored-by: Dimitris Souropanis <qmh9626@quser31.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser34.quest.it.northwestern.edu> Co-authored-by: Eirini <kasdaglie@ufl.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser33.quest.it.northwestern.edu> Co-authored-by: Dimitris Souropanis <qmh9626@quser32.quest.it.northwestern.edu> * Update step_merged.py (#457) Turn print into ModelError, because variables are otherwise undefined. * fix log vs log10 typo (#460) In the MD/MF metallicity fraction calculation, there was a typo for the outer bin in transforming the absolute metallicity into a log10 value. It was log, but should be log10! * remove "redirect" steps from history dataframe (#421) * skip redirect steps when appending to binary history and step names * skip appending step_times for redirect steps * add "history_verbose" option * add missing verbose params to default .ini file * handle history_verbose setting for all step hooks * remove history_verbose check from pre-step hooks * update docs and .ini file with history_verbose parameter * Merge branch 'development' into camille_remove_redirect_from_df * update binary_star docs * Start to get unit tests back: utils (#382) * rename rae2a to rad2a * add unit_tests: readme, test_constants.py, test_limits_thresholds.py * add template * add authors to ignorereason.py * add test_ignorereason.py * add test_posydonerror.py * edit docstring * add test_posydonwarning.py * update readme * add test_data_download.py * transfer to pytest (outstanding: test_posydonwarning.py, test_data_download.py) * account for the comments of Max * transfer test_posydonwarning.py to pytest * transfer test_data_download.py to pytest * add configfile.py * cleanup * Create test_installation.py using this as a simple example to try out automated testing framework * Create continuous_integration.yml Automatic trigger for tests (currently just installation but can include any combination) for PRs created to main or development. Tests on ubuntu, mac, and windows environments. Currently just testing python 3.11 but can add other versions if desired. * Update continuous_integration.yml fixed path to installation test file * Update continuous_integration.yml making mac the first test out of the three OSes * Delete posydon/unit_tests/test_installation.py realized this could just be included in the github workflow * Update continuous_integration.yml changed to include full posydon installation step to remove redundancy. Currently including all extras in the setup.py but can remove any if needed. * Update continuous_integration.yml removing extras from the every-PR test. I'll move them to a weekly test instead. * Create install_extras.yml scheduled cron job testing installation of setup.py extras, every sunday * Update continuous_integration.yml * Delete .github/workflows/install_extras.yml * Delete .github/workflows/continuous_integration.yml * add test_gridutils.py * add test_common_functions.py * update doc * merge development and update tests; include test in continuous_integration.yml * add pytest/cov install to continuous_integration.yml * add posydon install to unit test run * Change to environment python version For some reason, the environment `pytest` command doesn't get overwritten correctly with the local runner environment one. Probably because the PATH order is weirdly set. Running `pytest` through `python -m` works. * add environment varable exports * Update continuous_integration.yml clarify step name for CI * remove old code * Update continuous_integration.yml adding a piece to enforce minimum coverage of 100% of specified code when running the tests. if the coverage is below 100%, pytest will exit and the github action will fail. 100% coverage means that every line of code of posydon.utils (as specified in --cov=posydon.utils) is run at least once in the test suite execution. * Update README.md typo * Update README.md clarify language about QA for tests * Update README.md typo * Update README.md added info about enforcing 100% coverage in the pytest command * add more about predefined fixtures to the README * comments till test_read_histogram_from_file * comments on test_read_histogram_from_file * comments till test_CO_radius * deal with comments till test_calculate_core_boundary * remaining comments in test_common_functions.py * finish addressing first round of comments by Max * use np as alias for totest.np * fix typo in data_download.py * fix typo in test_common_functions.py * fix typo in docstring of common_functions.py * fix typo in test_common_functions.py * fix typo in common_functions.py * Update test_common_functions.py change naming of data examples to be more descriptive * Update test_common_functions.py fix bug caused by extra spaces * add comments and more names * remove unused bad_profile2 * more cleanup * follow PEP8 strictly, reset attributes calculated for CEE --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * period_change_stabe_MT -> period_change_stable_MT (#467) * PSygrid force int input (#440) * PSygrid force int input force the user to input an integer. This includes numpy versions of int. If this is not forces, the `initial_values` and `final_values` can be loaded with a 1 value array/list, but the `history1`, etc are not loaded with that input. As a result, `None` is returned for those and it looks like the history is empty. * add extra check for `contains` raises an error in index in `__contains__` and `__getitem__` is not an integer * Change error type of IndexError Preferred way to raise error: """if key is a value outside the set of indexes for the sequence (after any special interpretation of negative values), IndexError should be raised. For mapping types, if key is missing (not in the container), KeyError should be raised.""" https://docs.python.org/3/reference/datamodel.html#object.__getitem__ * change to 'index' * edited docstring to match arg name --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * Backpropagate changes on main/max_requirements into development (#456) * Update README.md * Update install.rst * Update install.rst * Adding an option to create a VH diagram w/ BinaryStar objects (#158) * Adding an option to create a VH diagram w/ BinaryStar objects * Update VHdiagram.py * Update VHdiagram.py --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update README.md - main (#188) * Update README.md Update the readme to remove the installation instructions so that we do not have to maintain the same instructions in two places. Currently, the instructions in the readme are not the same as the ones in the documentation. * Update README.md I also edited the text to match the deve version * V1 python_utils fix (#191) * add python_utils==3.5.2 requirement * Update setup.py Limit `more-itertools` to its latest python3.7 version. * Update V1 conda setup (#199) * update conda dependencies for latest python3.7 packages dependencies + remove pyqt5 dependency * update astropy + pyqt5 versions * change pyqt to 5.15.4 * Updates in installation instructions in the V1 documentation (#201) * Updated installation instructions in the v1 documentation * Simplifying sections and removing git-lfs mention * Update install.rst * No change? * Adding OSX-ARM installtion instructions. * Update install.rst Add the conda channels to the OSX-ARM architecture --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * conda_v1 fix (#266) * change dependencies to have a maximum and release the numpy dependency * add maximum to setup.py too * point to updated GH action * Change numpy dependency * fix * change numpy version in setup.py too * solving for an old sk-learn numpy issue * Update publish-to-anaconda.yml (#270) changes publish-to-anaconda to development version. * update v1 for scikit-learn version (#292) * update v1 for scikit-learn version * Update setup.py * Update meta.yaml numpy 1.20 deprecates "np.float", which exists in v1 code * Update setup.py * Update conda version number (#304) This is required to publish Elizabeth's changes to conda * fix maximum requirements * fix scikit-learn version and remove email from AUTHOR_EMAIL. * v1 in mesa_dir the search for "v1/" should be in the full mesa_dir not the dirname * update zenodo link and md5 hash * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * Update meta.yaml * Update meta.yaml * change publish-to-anaconda to publish on a github release publish * typo fixed in documenation * Change installation instructions to specifically request v1.0.4 (#450) * change installation instructions to specifically request v1.0.4 for installation (this version) * update index.rst year * add licence date change * add change in conf.py of year * year change in LICENSE.md * publish only to anaconda on releases * fix found typos in v1 documentation * Update publish-to-anaconda.yml (#454) Point towards POSYDON-code/ version of the publish-to-anaconda action. * remove redundant lines in post_processing.py * add e-mail to setup.py * remove updated VH Diagram plotting code for a single binary. Surrounding code has change, see PR#456. * change default mem_per_cpu to 7G" * update version + installation instriction + link to releases + zenodo --------- Co-authored-by: Simone Bavera <32518238+ssbvr@users.noreply.github.com> Co-authored-by: sgossage <seth.gossage@cfa.harvard.edu> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: tassos25 <tassos25@users.noreply.github.com> Co-authored-by: Konstantinos Kovlakas <22239544+kkovlakas@users.noreply.github.com> Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * update zenodo url and md5 (#470) Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * error check for undefined states in BinaryStar (#468) * add error check for undefined states in BinaryStar, add undefined states to flow chart * update posydonerror unit test * update unit test again * remove BinaryStar and SingleStar from posydonerror, move initcond message to BinaryStar * fix unit tests again * Update step_merged.py (#480) Import ModelError in step merged. * No check for WD formation in double CE case (#484) * Update common_functions.py Move double CE into contact detection and return afterwards to skip checks on WD formation. * add tests which would fail on the old code * handle H-rich RLO binaries and clarify verbosity of detached step (#430) * clean-up code and clarify verbosity of matching in detached step * reorganizing some code in detached step, clarifying verbose output * fix bug in matching, add criteria to check for HMS-HMS-RLO binaries in detached step * add list of step names to SimulationProperties * add separate error catch for HMS-HMS binaries in RLO in detached step * Merge remote-tracking branch 'origin/development' into camille_matching_strippedHe_to_Hrich * add ClassificationError to unit tests * remove space at end of line in unit tests * fix unit test * remove classification error from unit tests * fix classification error * fix line length in test_posydonerror.py * Grid slice plotting system selection fix (#475) * replace selection + add docstring * Update plot_pop.py changes: - plot_extension doc string - prop description if None * add missing binaries to UNDEFINED_STATES in flow chart (#489) * add missing binaries to UNDEFINED_STATES in flow chart * add WD systems to undefined states * add for loop for undefined states in flow chart * separate IMFs + create basic tests * add pytest.approx around remaining values * move salpeter tests into its own class * add Kroupa2001 IMF and its unit tests * add flat_mass_ratio dist and Sana12 period * Update issue templates (#491) * Update issue templates * Update bug_report.md * add temp norm_pop.py file to restructure underlying_mass calculation * add single star contribution, works for f_b=1 in sample. Unclear if f_bin!=1 in sample works correctly in original version * Update installation-guide.rst to include note about adding conda-forge (#495) * Update installation-guide.rst to include note about adding conda-forge I came across an issue related to installation. It turns out that many of the required packages specify versions only available on conda-forge which can cause a huge headache for unaware users. I have updated the installation documentation to include this note. * Adding conda-forge documentation to troubleshooting page --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> * add 'm*' to simulation weight * Protect run_psycris_sequence, from misc imports (#436) * add dunder main to run_psycris_sequence, add type checks to cmd args * Add some docs * Delete random file * additional comments in norm_pop * add more dump_rate info to docs (#500) * add dump_rate info to docs and ini file * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * Update population_params.rst * Update code-questions.rst * Update population_params_default.ini --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * replace scipy interp1d with alternatives (#433) * replace all instances of interp1d except for in profile interpolation * remove interp1d from common functions unit test * add parameter type checks to rejection sampler * changes to common functions unit testing * fix unit test * fix unit tests again * define own interp1d and revert replacements * clean out white spaces * replace interp1d in profile_interpolation * readd ClassificationError * add fill_value, left, and right * cleanup * remove import * Update interp1d to include option for fill_value="extrapolate" * edit error message for fill_value * Update test_interpolators.py to include fill_value="extrapolate" * update all to ndarray; add missing unit tests * fix docstring * correct description --------- Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * Add support for unsorted input in new interpolators (#502) * add check for increasing or decreasing arrays. Flip accordingly * add unit test for flipping + add check for x,y being None * remove None check * shuffle stuff around * move tests to init * use np.flip to create a copy of the original data instead of a flipped view. Just in case the data gets changed along the way * implement suggestions * add sorting for non-monotonic values. Required for some step_SN parameters * Update test_interpolators.py * fix typo --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> * replace NaN/None in input chi_eff calculation with 0 (#501) * add nan checks for spins + tilts * add docstring * remove np.ndarray wraping" * implement comments on using pd.na: * Update transient_select_funcs.py remove empty line generalize warning text * Update transient_select_funcs.py --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * updating the data_download routines slightly (#496) * updating the data_download routines slightly * Fixing unit tests accordingly * Fixing one more unit test * Adding comment to force unit tests to re-run * Added DataError as a POSYDONError and included raise DataError for missing PATH_TO_POSYDON_DATA environmental variable * revert DataError and use NameError; add unittest * Use FileExistsError --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * rewrite of normalisation into separate components * add TODO+warning that alpha needs to be changed back for the Salpeter IMF * Use of `PATH_*` variables (#505) * update and test config * always import PATHs from config * put the downloaded data on the path without POSYDON_data * use dirname, where POSYDON_data should be skipped * debugging * debugging * use os.path.join * cleanup * Update config.py docstring * Fixes to Troubleshooting & FAQ Docs (#517) * initial read-through fixes * more changes to code-questions docs * Update docs/_source/troubleshooting-faqs/code-questions.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/troubleshooting-faqs/code-questions.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * replace @ symbol --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Add files to installation (#526) * add init files to detect packages; include files in MANIFEST.in * add comment * Fix logic flow in matching (#521) * fix logic flow in matching, clarify matching verbose output * add "center_h1" to matching verbose output * make if/else checks and flow more consistent * add accreted_He_Shell_H_burning stars to flow, detached step (#522) * Issues with undefined values of SN_MODELS (#482) * Update step_mesa.py replace undefined variable key and check fv for CO_type * Update step_mesa.py Check for key and otherwise show warning and set value to None. * Update step_SN.py np.isnan -> pd.isna * Update step_mesa.py change None to np.nan * Update step_mesa.py Set model to None. * Update step_mesa.py ensure None is not overwritten * add end of step prints for verbose * typo * use pa.notna * replace isnan (#527) * Fix logic for single star fraction population normalisation (#509) 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`. * Pulsational Pair-Instability top-down mass loss approach (#417) * 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 * Blandford-Znajek jet energy calculation (#429) * 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> * Split popsyn plotting into separate components for future modularity (#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 (#532) * 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> * replace underlying mass calculation with probability reweight per model * move binary fraction into PDF * remove unneccesary lines * add calculate_model_weights separate * add additional error for impossible reweights * add basic tests for normalisation. These tests reweight a population and sample from the requested reweight population. Then it compares a selection in both populations to see if they're close. I performed a convergence test on the method implemented and the final results converge. * remove old tests * rename func call * add Chabrier2003 IMF * restructure code to an abstract class with sub-classes and add unit_tests for Chabrier IMF * add actual new tests * add Chabrier IMF tests" * dynamical find IMF (primary mass scheme) based on available ones in IMFs.py * add unit tests for the sub-functions in norm_pop.py * add docstrings to different IMFs * small cleanup/addition * flip notation * alter Kroupa2001 IMF calculation * remove old test_weights file * Update setup.py (#536) sphinx at least 8.2.2 * GitHub action fix (#537) * change to v4 * add to CI for testing checkout and setup python versions * change other versions to 'latest' * Update MESA-grid tutorials (#535) * 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 * Modular data download (#507) * 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> * Decouple ECSN treatment from SN_MODELS (#504) * 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 (#512) * add WDs to infer_star_state, incl. testing and new limits * add references * Update setup.py (#541) change >3.10 to >=3.11 * Upgrade setuptools (#542) * create new pyproject.toml; try to reuse setup.py as much as possible * add refs * implement self.mbreak suggestion: * remove duplicate line * change name + pass func * add Return explanation to docstring * cleanup + add period_PDF function. Not yet in weights * set post SN binary to disrupted in case there is a massless_remnant (#548) * Update population_params_default.ini (#544) Update to give the correct usage for the engine if 'other' mechanisms are used * Add check for valid MODELS in posydon-setup-popsyn (#545) * add check for valid MODELS before popsynth setup script runs * move repeated code into a separate function in the MODELS.py file * move repeated code into a separate function in the MODELS.py file * Update posydon/grids/MODELS.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * add the option to add kwargs to primary_mass scheme * add an option to pass parameters to the IMF PDF creation for customisaion of the IMF slopes/breaks etc * Add total_mass_h1 and total_mass_he4 (#529) * add total_mass_h1 and total_mass_he4 (utils, vis not yet checked) * add values to plot defaults * update doc * copy bug correction from PR435 * exclude accreted_He_Core_H_burning state from HRD for single stars * rework model weights in the TransientPopulation to account for double indices in the TransientPopulation * clean up files * add fix for flipped masses in the sampling. Probably because the system was flipped by the population synthesis * add correct size for tmp_model_weights when setting a chunksize smaller than the total population * remove old function + add coverage setting file * add docstrings * Add unit tests: grids (#435) * rename rae2a to rad2a * add unit_tests: readme, test_constants.py, test_limits_thresholds.py * add template * add authors to ignorereason.py * add test_ignorereason.py * add test_posydonerror.py * edit docstring * add test_posydonwarning.py * update readme * add test_data_download.py * transfer to pytest (outstanding: test_posydonwarning.py, test_data_download.py) * account for the comments of Max * transfer test_posydonwarning.py to pytest * transfer test_data_download.py to pytest * add configfile.py * cleanup * Create test_installation.py using this as a simple example to try out automated testing framework * Create continuous_integration.yml Automatic trigger for tests (currently just installation but can include any combination) for PRs created to main or development. Tests on ubuntu, mac, and windows environments. Currently just testing python 3.11 but can add other versions if desired. * Update continuous_integration.yml fixed path to installation test file * Update continuous_integration.yml making mac the first test out of the three OSes * Delete posydon/unit_tests/test_installation.py realized this could just be included in the github workflow * Update continuous_integration.yml changed to include full posydon installation step to remove redundancy. Currently including all extras in the setup.py but can remove any if needed. * Update continuous_integration.yml removing extras from the every-PR test. I'll move them to a weekly test instead. * Create install_extras.yml scheduled cron job testing installation of setup.py extras, every sunday * Update continuous_integration.yml * Delete .github/workflows/install_extras.yml * Delete .github/workflows/continuous_integration.yml * add test_gridutils.py * add test_common_functions.py * update doc * merge development and update tests; include test in continuous_integration.yml * add pytest/cov install to continuous_integration.yml * add posydon install to unit test run * Change to environment python version For some reason, the environment `pytest` command doesn't get overwritten correctly with the local runner environment one. Probably because the PATH order is weirdly set. Running `pytest` through `python -m` works. * add environment varable exports * Update continuous_integration.yml clarify step name for CI * remove old code * start unit tests for grids * add test_termination_flags.py * include new test in CI * fix CI * add test_scrubbing.py * add test_MODELS.py * add test_io.py * make test flexible for different OS * add test_downsampling.py * start with test_psygrid.py * np alias, file+path * more tests on psygrid * small corrections * adopt style * test_join_grids * add/edit docstrings and continue on PSyGrid tests * generate test MESA gird * decide_columns * more special cases of MESA runs * further grid tests * more grid tests * tests till 70 percent coverage * more gird tests * test till 71 percent * finish tests for _create_psygrid * more tests; clarify errors; restructure PSyGrid for testing * correct typo * workaroud for test interactions * more tests * add Error for new_mesa_flag * cleanup * finish PSyGrid class * finish test_psygrid.py, beside one todo * more checks on PSyGrid creation * add first tests of post_processing * remove old test * cleanup * check more errors * more test on post_process_grid * finish PR * cleanup * add SN data to unit tests to avoid download * Update posydon/unit_tests/README.md Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update posydon/unit_tests/README.md Co-authored-by: Seth Gossage <sethg45@gmail.com> * merge development, resolve conlicts, and update README * reword error message of wrong index * make test for missing and new objects more detailed * add Runtimeerror in case a system tool does not work as expected * add fixture to link temporarily SN data if needed --------- Co-authored-by: Elizabeth Teng <41969755+elizabethteng@users.noreply.github.com> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * remove .coveragerc, because it causes the tests to fail. Put in a different PR * add test_get_MODEL_NAME (#553) * Mesa api doc (#520) * Update fixed.rst Fixing typos and grammar errors in Run a fixed mesa grid * Update inifile.rst * Update inifile.rst * Update fixed.rst typo fix * Update dynamic.rst Change the TODO * Update fixed.rst Bold text * bold removed * ini file replaced with .ini file * Update fixed.rst Changing the ini file to be consistent with other docs * Update inifile.rst changing the ini file * Update dynamic.rst Adding Kyle's paper and POSYDON mailing list * Update docs/_source/components-overview/mesa_grids/fixed.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: dimsour94 <dimitris.souropanis@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Rename step9 to stepF (#558) * rename step9 to stepF * update example INI files * Add conda install of mpi4py (#556) Additionally add macos-13 to run on * FAQ about slow `conda` (#551) * add FAQ about installation instructions * Update installation-issues.rst * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> * Update docs/_source/troubleshooting-faqs/installation-issues.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update installation-issues.rst --------- Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: Seth Gossage <sethg45@gmail.com> * conform to 80 character limit * add missing doc strings * add valueerror * remove old normalised_pop_mass functions * change to monkey patch * change to np.array return * add m_min m_max checks * use monkeypatch fixture * adapt tests based on comments * implement comments * conform to 90 character line limit * include comment * clean up * fix monkeypatch * add additional mass ratio PDF option + adapt test for it * add unit test invalid mass_ratio scheme defaulting to flat q * add positive mass warning * add CI for IMFs and norm_pop * remove period PDF * correct writing to dataframe * remove deprecated import * fix missing imports * Unifying the code for finding grid boundaries and checking validity in case of ignored data. (#271) * Automatically find boundaries of the grid at the superclass, to avoid code repetition. * Removing unused variable. * Correcting (visual) indendation issues. * Do not use ignored and failed runs to determine the grid boundaries. * Adopting suggestions regarding variable names. * Add check that profile is well defined in SN (#559) * add check for profile * add seth's suggestions * Add posydon-popsyn setup, check & rescue (#550) Renames the `posydon-setup-popsyn` CLI to `posydon-popsyn` and implements the sub-commands `setup`, `check`, and `rescue`. - `setup` performs the setup of a population synthesis run, as before. - `check` verifies a population run and checks if the requested number of binaries is present. - `rescue` allows the user to create resubmission files for failed Slurm array jobs. [commit changes] * restructure + add run check script * rename + adding the rescue option * Add resubmit_slurm.sh submission options * update tutorial with new command name + add new commands * add check if there are failed jobs or not * remove unused imports * add empty missing_indices * update run in rescue script * change path + merge job name * implement comments and improvements from Matthias * 80 character limit + additional doc strings * remove required for already required input * added output for other output too * Update posydon-run-pipeline (#569) * update docs: installation, processing pipeline, ML components (#513) * Update installation-guide.rst -fix typo "instractions" -move environment variables step ahead of download posydon data, which requires the variables to be set * Update pipeline_steps.rst fix typo "girds" * Update processing-pipeline.rst * Update processing-pipeline.rst * Update psygrid.rst for language * fix typo * fix typos * add spaces for readability * Update psygrid.rst language for clarity * Update pipeline_ini.rst Found small typos and made small changes for clarity. I think a lot of this could be rewritten for clarity, but I don't understand this part of the code enough to do that. * Update machine-learning-components.rst Typos * Update initial_final_interp.rst minor changes to IFInterpolator * Update initial_final_interp.rst Typo * Update psygrid.rst to put quotation marks back in to denote strings for the keys * change .ini to *.ini * Update machine-learning-components.rst typo * Update psygrid.rst language for clarity * Update psygrid.rst language for clarity * Update installation-guide.rst for copy edits * add arguments table for join_grids * fix table * fix table * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/components-overview/post_processing/psygrid.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * clarify grid config properties vs physical grid properties * Update posydon-run-pipeline for typos * Update pipeline_steps.rst * Update pipeline_steps.rst language for clarity * Update single_star.rst change star state example * Update binary_star.rst updating star states * Update custom_hooks.rst fix spacing in code example * Update pipeline_steps.rst language for clarity * limit lines to 80 characters * Update pipeline_steps.rst * restrict lines to 80 characters * restrict lines to 80 characters * restrict to 80 characters per line * Update pipeline_ini.rst for line length * Update initial_final_interp.rst for line length * Update pipeline_steps.rst style fix * Update psygrid.rst for style * Update pipeline_ini.rst * Update pipeline_steps.rst for style consistency * Update pipeline_additions.rst for style consistency * Update processing-pipeline.rst for style consistency * Update initial_final_interp.rst for style consistency * Update ProfileInterpolator.rst * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/components-overview/post_processing/pipeline/pipeline_steps.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update pipeline_additions.rst for line length * Update pipeline_steps.rst for line length * Update psygrid.rst for line length * Update pipeline_ini.rst for line length * Update initial_final_interp.rst for line length * Update initial_final_interp.rst * Update ProfileInterpolator.rst for line length * Update machine-learning-components.rst for line length * Update pipeline_steps.rst * Update docs/_source/components-overview/post_processing/pipeline_ini.rst Co-authored-by: Seth Gossage <sethg45@gmail.com> * Update initial_final_interp.rst * Update machine-learning-components.rst --------- Co-authored-by: Philipp Moura Srivastava <philipp.msrivastava@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Kyle Rocha <48293898+ka-rocha@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * Move bin code to utils: compress-mesa (#564) * move code * bug fix * add first tests; restructure command line arguments * outsource helper functions for tests * verbose check * finish test_compress_dir * finish test_set_up_test * take care of comments by Max * add docstring to get_size * add more docstring * add suggestions by Seth * Update install_extras.yml (#576) * Update install_extras.yml (#578) * POSYDON docs build multiple version (#554) * add versioning + automatic fetching of docs * comment out deploy action * remove git fetch * cleanup * remove PATH_TO_POSYDON * add MESA_DIR and PATH_TO_POSYDON_DATA * add reinstall for autodoc * do v1 generation * add v2 + install wheel for python 3.9 * positive grep * add wheel install v1 + remove from v2 * remove development for now * use as path * change out folder * add * change build_path * change build_path again * change checkout + path * add v1 & v2 make documentation * update _build for v1 documentation * show current version in documentation instead of latest * rename folder * remove old unused unstable workflow * Update docs/_source/conf.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * typo * fix typo * remove development doc make from release * remove v2.0.0-dev tag from version TAG list * remove dry-run commands * add v1 and v2 distinction + treat v2.0.0-dev as an indicator for development creation * force remove dirty for current version doc build, because copying files into version necessary * fix * link cleanup * add injection grab * move subprocess * add current version * change old_tags name * change posydon_version old tag version * posydon cleanup too * only apply injection to old v2 verions * add dry-run back in * template -> templates * add symlink process to latest release version * check for all dev tags of v2.X.X versions Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * implement comments * check for latest non-pre-release version * Update .github/workflows/deploy-github-pages-release.yml Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update .github/workflows/deploy-github-pages-release.yml Co-authored-by: Seth Gossage <sethg45@gmail.com> * remove dry-run --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> * Hotfixes new documentation build (#585) * Add fetch-tags:true Currently, not all the tags from Github are correctly pulled in this workflow, as such the code fails. * add v for folders + links to make all consistent * Add v for folder creation and in linkage * posydon-popsyn multi-jobID fix (#581) If multiple population synthesis reruns are present, the jobID check was returning a list of one. This should have just been the jobID. This corrects that selection. * Hotfix documentation-build again (#588) Another fix to the building of the development version. This time, entering the git folder I don't understand why this worked locally with Local Github Actions (act) and not on the actual Github Actions. Is the workflow different? * add fetch-depth:0 to documentation workflows (#593) * Bump miniconda version to v3 and add proper bash shell initiation (#594) * bump miniconda version to v3 and add proper bash shell initiation * clean up * remove sourcing conda; already done with bash -el * add pip upgrade back * Update install_extras.yml * remove check on PR * Change ECSN default to Tauris+15 (#571) * change ECSN default and comment defaults in MODELS * function: get_MODEL; update tests * Update population_params_default.ini Add allow_spin_None to default ini file. * Update posydon-popsyn add verbose_on_fail * get at least mass in get_initial_BH_properties * update docs * adopt pre defined SN models; rename MODEL to SN_MODEL * adjust test mass to give BHs; rename prop * update population_params_default.ini to default SN model * change values for Farag matching * refer to v2 interpolators * add back Sukhbold+16-engine * Add supernova engine (#597) * Update SN_MODELS.py Add S19.8 engine, rename SN_models for easier addition of more changes * update docs and ini files * rename SN_models * Add eccentricity as option for parsing grids (#575) * update absolute imports and default ini with some docs * Changed grids.io to parse mesa grid dirs with changing eccentricity * Removed hotfix comments for PR * remove spurious spacing * Updating unit test to correspond to initial eccentricity in filename * Update posydon/unit_tests/grids/test_io.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: Jeff Andrews <jeffrey.andrews@ufl.edu> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * change output folder (#595) * F2 f population docs (#525) * Update 10_binaries_pop_syn.ipynb Fix typos * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb test * Update lgrb_pop_syn.ipynb * Update pop_syn.ipynb * Update pop_syn.ipynb * Update bbh_analysis.ipynb * Update custom_step_and_flow.ipynb * Update docs/_source/tutorials-examples/population-synthesis/bbh_analysis.ipynb Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update docs/_source/tutorials-examples/population-synthesis/bbh_analysis.ipynb Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update pop_syn.ipynb * Update bbh_analysis.ipynb - more verbose * Update bbh_analysis.ipynb - clarity * Update bbh_analysis.ipynb * Update bbh_analysis.ipynb clarity * Update bbh_analysis.ipynb addressing a few typos and clarity * Update lgrb_pop_syn.ipynb clarity * Update one_met_pop_syn.ipynb addressed typos and consistency with code updates * Update bbh_analysis.ipynb argument name update * Update one_met_pop_syn.ipynb typo * typo * Update evolve_single_binaries.ipynb typo * Update custom_step_and_flow.ipynb; adding clarity * Update custom_step_and_flow.ipynb small addition to last commit * Update custom_step_and_flow.ipynb * Update custom_step_and_flow.ipynb * some variables are not defined so I removed them. one is introduced later in the tutorial * maybe this change is wrong but I was unable to pip install .[vis] * Update - all but the last cell works with v2 population * added --account argument to posydon-popsyn Quest example. Without this, job submission will fail * Small typo fixes * add pending review changes --------- Co-authored-by: Monica Gallegos-Garcia <monicagallegosgarcia2024@u.northwestern.edu> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: Seth Gossage <sethg45@gmail.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> * Change supernova models (#598) * Update SN_MODELS.py change S19.8 to W20 * Update population_params_default.ini * Update population_params_end.ini * SFH bug fix, rewrite, and basic tests (#543) * combine SFR_Z_fraction and star_formation_rate into a single function call, which pre-calculate the multiplication for speed improvemen * add correct select_one_met in function * move SFH into separate classes with abstract inheritance * Move SFH to classes (with abstract treatments) + Add Chruslinska+21 SFH models * fix fSFR. Now sums correctly to 1 at each redshift. * add fSFR unit tests * add additional basic tests * fix double naming of SFR * add tests for new SFRs * remove old SFH code; not used anywhere * move std_log_metallicity_history * add dosctring for abstract class * add docstrings * rename variables * add more doc strings * add even more docs * more doc strings * add checks for required parameters in MadauBase * docstrings: * change name of SFR_per_met_per_z function * alter unit tests to adapt to previous changes * change ' to " * cleanup line lengths * change output fSFR and _call__ dosctring to ndarray * add check for model parameters required * restructure + integrate only between Z_min and Z_max + add option normalise * Z_max check * update the SFH to use Z_min and Z_max and normalise. Move the splitting per metallicity bin to its own function. Additionally, revamp the unit tests to be more in style with the other unit tests and adapt them for the new functions and treatment of the metallicity bins. * fix name typo * remove Z_max requirement for Chruslinska * implement Matthias comments * change to rates.MODEL * change comment * add test for get_SFR_per_met_at_z * make sure to test branches * add SFH tests * add space * remove duplicate lines in IllustrisTNG class * move ConcreteSFH into a fixture * Add support for Zmin and Zmax inside bins and inside the same bin. * add doc string + remove select_one_met * replace MODEL with SFH_MODEL * change DEFAULT_MODEL to DEFAULT_SFH_MODEL * add to default Zmin,Zmax=None + normalise=True * update docstrings: * clean up star_formation_history file * update unit tests + implement comments * update call method test * add std_log_metallicity_dist integer support * make explicit regex expression * update unit tests & implement remainder of comments Matthias * cleanup * warning cleanup * add SFHModelWarning + add sort check * change to sphinx reference style * add reference * add check for None output in error * add unit test for unsorted Metalicity bins * suggested change * add new warning class to test * Update posydon/unit_tests/popsyn/test_star_formation_history.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update README.md (#599) * Update README.md * Apply suggestions from Seth Co-authored-by: Seth Gossage <sethg45@gmail.com> --------- Co-authored-by: Seth Gossage <sethg45@gmail.com> * Changes in the MESA documentation (#524) * minor text change in 'I. Running your first MESA simulation using POSYDON' * changes up to 'Run one binary on your laptop for debugging' where I had error with work_dir * partial changes to the tutorial * small last changes in the documentation * adding matthias comment on work dir * Update docs/_source/tutorials-examples/MESA-grids/laptop.ipynb typo Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Re-writing step-CE for improved flow and logic (#574) * change the core radius for the stableMT option * Updating step_CEE.py * Re-writing step_CEE alpha_lambda prescription code * Updating code * updating common_functions list of functions to test * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Removing core_not_replaced_noMT option from documentation * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Updating mass loss due to merger in CEE * Update common_functions.py * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update step_CEE.py * Update step_CEE.py * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Updated due to code review comments and changing CE function names * Missed this previous update * Updating documentation * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update posydon/unit_tests/utils/test_common_functions.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Moving from double quotes to single quotes * Update posydon/binary_evol/CE/step_CEE.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * fix option names as Zepei reported * Update docs/_source/components-overview/pop_syn/population_params.rst Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * add compt_type to CEE_adjust_binary_upon_merger as requested by me and Max --------- Co-authored-by: ZepeiX <Zepei.Xing@unige.ch> Co-authored-by: astroJeff <andrews.jeff@gmail.com> Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> Co-authored-by: mkruckow <Matthias.Kruckow@unige.ch> Co-authored-by: Max <14039563+maxbriel@users.noreply.github.com> * Check for array-like data in `BinaryStar.to_df()` in case of failed binaries (#580) * Update binarystar.py adding a check for array like data and pad w/ nans as before, but with the right data type * Update binarystar.py operate on column element rather than the column itself * Update binarystar.py rename data_len to element_len * initialize V_sys as numpy array, rather than list, to match subsequent data types * added new dtypes in popsyn/io.py: object.string and object.float64 to differentiate subtypes of objects. Dynamically determine filler values when extending failed binary data columns * remove debug print statements and also add in default case if somehow a data column key does not exist in dtype dictionary * remove max_ele_length initialization, superfluous * added new sub dtype dictionary in popsyn/io.py to hold specs on dtypes within an object, now default to NoneTypes in case a definition is not found, which is converted to nan in case of single values (not objects), also now nearest_neighbour_distance is initialized as a float array rather than a string array * added empty string definition for cases of missing dtype definitions * Update posydon/binary_evol/binarystar.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Update posydon/binary_evol/binarystar.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> * Cancel signal alarm in case binary failed (#608) * cancel the signal alarm * typo fix * remove min m2 * Documentation fixes (#605) * clean up dead links * fix typos * fix more typos * more spelling/wording changes * spelling mistakes + update Collaboration team (name error + core dev team) * fix * more typos * 1_HMS_HMS checked * baic number * fix more typo's and grammar * fix pop_syn notebook * fix pop_syn notebook * collaboration link change + spelling * 10 binaries + custom_steps * revert POSYDON capitalisation * revert POSYDON capitalisation * remove team page and link to website page * typo fix * revert POSYDON accronym capitalisation. * Update docs/_source/index.rst Co-authored-by: Matthias…
* combine SFR_Z_fraction and star_formation_rate into a single function call, which pre-calculate the multiplication for speed improvemen * add correct select_one_met in function * move SFH into separate classes with abstract inheritance * Move SFH to classes (with abstract treatments) + Add Chruslinska+21 SFH models * fix fSFR. Now sums correctly to 1 at each redshift. * add fSFR unit tests * add additional basic tests * fix double naming of SFR * add tests for new SFRs * remove old SFH code; not used anywhere * move std_log_metallicity_history * add dosctring for abstract class * add docstrings * rename variables * add more doc strings * add even more docs * more doc strings * add checks for required parameters in MadauBase * docstrings: * change name of SFR_per_met_per_z function * alter unit tests to adapt to previous changes * change ' to " * cleanup line lengths * change output fSFR and _call__ dosctring to ndarray * add check for model parameters required * restructure + integrate only between Z_min and Z_max + add option normalise * Z_max check * update the SFH to use Z_min and Z_max and normalise. Move the splitting per metallicity bin to its own function. Additionally, revamp the unit tests to be more in style with the other unit tests and adapt them for the new functions and treatment of the metallicity bins. * fix name typo * remove Z_max requirement for Chruslinska * implement Matthias comments * change to rates.MODEL * change comment * add test for get_SFR_per_met_at_z * make sure to test branches * add SFH tests * add space * remove duplicate lines in IllustrisTNG class * move ConcreteSFH into a fixture * Add support for Zmin and Zmax inside bins and inside the same bin. * add doc string + remove select_one_met * replace MODEL with SFH_MODEL * change DEFAULT_MODEL to DEFAULT_SFH_MODEL * add to default Zmin,Zmax=None + normalise=True * update docstrings: * clean up star_formation_history file * update unit tests + implement comments * update call method test * add std_log_metallicity_dist integer support * make explicit regex expression * update unit tests & implement remainder of comments Matthias * cleanup * warning cleanup * add SFHModelWarning + add sort check * change to sphinx reference style * add reference * add check for None output in error * add unit test for unsorted Metalicity bins * suggested change * add new warning class to test * Update posydon/unit_tests/popsyn/test_star_formation_history.py Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com> --------- Co-authored-by: mkruckow <122798003+mkruckow@users.noreply.github.com>
Rewrite of star formation histories
This is a rewrite of the star formation histories to different classes that allows for "easier" adding of new SFHs. To this end, I've created the following additional classes:
Available SFHs (in brackets is what it inherits from)
New SFHs:
Calling a class with the redshift and metallicity bins will return the CSFRD per redshift bin per metallicity bin.
For an example, see
SFR_per_Z_at_z(z, met_bins, MODEL).These models can be called with
get_SFH_modelusing the MODEL parameter. Adding the model here allows it to be used in the cosmic_weights calculation.Bug fix
While working on this, I noticed 2 bugs in the fraction SFR per metallicity calculation.
Tests
I've added a few basic tests to check that:
std_log_metallicity_distis giving back the right values__call__method of the classes returns the right multiplied values.These are not meant to be complete tests but should provide a basis to build on. I do not have the time available to focus on these though.