Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:TeamCOMPAS/COMPAS into event-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
themikelau committed Dec 4, 2023
2 parents 50051ea + 9fa0baf commit 7fde047
Show file tree
Hide file tree
Showing 40 changed files with 1,393 additions and 1,821 deletions.
1 change: 0 additions & 1 deletion .dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ accrete
accreted
YHe
yhe

2 changes: 1 addition & 1 deletion .github/workflows/compas-compile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ jobs:
with:
name: COMPAS-run-artifacts
path: |
py_tests/test_artifacts
py_tests/test_artifacts
2 changes: 2 additions & 0 deletions .github/workflows/precommit-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ jobs:
with:
python-version: 3.8
- uses: pre-commit/[email protected]


13 changes: 6 additions & 7 deletions compas_python_utils/preprocessing/compasConfigDefault.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##~!!~## COMPAS option values
##~!!~## File Created Wed Nov 1 11:25:11 2023 by COMPAS v02.40.00
##~!!~## File Created Tue Oct 31 04:36:43 2023 by COMPAS v02.40.00
##~!!~##
##~!!~## The default COMPAS YAML file (``compasConfigDefault.yaml``), as distributed, has
##~!!~## all COMPAS option entries commented so that the COMPAS default value for the
Expand Down Expand Up @@ -47,6 +47,9 @@ booleanChoices:
# --common-envelope-lambda-nanjing-use-rejuvenated-mass: False # Default: False
# --revised-energy-formalism-nandez-ivanova: False # Default: False

### TIDES
# --enable-tides: False # Default: False

### SUPERNOVAE, KICKS AND REMNANTS
# --allow-non-stripped-ECSN: False # Default: False
# --pair-instability-supernovae: True # Default: True
Expand Down Expand Up @@ -96,7 +99,7 @@ numericalChoices:
# --rotational-frequency: 0.000000 # Default: 0.000000
# --rotational-frequency-1: 0.000000 # Default: 0.000000
# --rotational-frequency-2: 0.000000 # Default: 0.000000
# --wolf-rayet-multiplier: 1.000000 # Default: 1.000000
# --wolf-rayet-multiplier: 0.100000 # Default: 0.100000

### BINARY PROPERTIES
# --eccentricity: 0.000000 # Default: 0.000000 # eccentricity for BSE
Expand Down Expand Up @@ -213,11 +216,7 @@ stringChoices:
# --envelope-state-prescription: 'LEGACY' # Default: 'LEGACY' # Options: ['FIXED_TEMPERATURE','HURLEY','LEGACY']
# --initial-mass-function: 'KROUPA' # Default: 'KROUPA' # Options: ['KROUPA','UNIFORM','POWERLAW','SALPETER']
# --luminous-blue-variable-prescription: 'HURLEY_ADD' # Default: 'HURLEY_ADD' # Options: ['BELCZYNSKI','HURLEY','HURLEY_ADD','NONE']
# --mass-loss-prescription: 'FLEXIBLE2023' # Default: 'FLEXIBLE2023' # Options: ['FLEXIBLE2023','BELCZYNSKI2010','HURLEY','NONE']
# --OB-mass-loss: 'VINK2021' # Default: 'VINK2021' # Options: ['KRTICKA2018','BJORKLUND2022','VINK2021','VINK2001','NONE']
# --RSG-mass-loss: 'DECIN2023' # Default: 'DECIN2023' # Options: ['NJ90','KEE2021','YANG2023','DECIN2023','BEASOR2020','VINKSABHAHIT2023','NONE']
# --VMS-mass-loss: 'SABHAHIT2023' # Default: 'SABHAHIT2023' # Options: ['SABHAHIT2023','BESTENLEHNER2020','VINK2011','NONE']
# --WR-mass-loss: 'SANDERVINK2023' # Default: 'SANDERVINK2023' # Options: ['SHENAR2019','SANDERVINK2023','BELCZYNSKI2010']
# --mass-loss-prescription: 'VINK' # Default: 'VINK' # Options: ['VINK','HURLEY','NONE']
# --metallicity-distribution: 'ZSOLAR' # Default: 'ZSOLAR' # Options: ['LOGUNIFORM','ZSOLAR']
# --pulsational-pair-instability-prescription: 'MARCHANT' # Default: 'MARCHANT' # Options: ['FARMER','MARCHANT','STARTRACK','COMPAS']

Expand Down
3 changes: 3 additions & 0 deletions examples/methods_paper_plots/detailed_evolution/Grid_demo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--initial-mass-1 35.0 --initial-mass-2 31.0 --metallicity 0.001 --eccentricity 0.000000e+00 --semi-major-axis 3.5 --kick-magnitude-1 0 --kick-magnitude-2 0
--initial-mass-1 35.0 --initial-mass-2 31.0 --metallicity 0.001 --eccentricity 0.000000e+00 --semi-major-axis 3.5 --kick-magnitude-1 0 --kick-magnitude-2 0

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##~!!~## COMPAS option values
##~!!~## File Created Wed Nov 1 11:22:29 2023 by COMPAS v02.40.00
##~!!~## File Created Tue Oct 31 10:11:32 2023 by COMPAS v02.40.00
##~!!~##
##~!!~## The default COMPAS YAML file (``compasConfigDefault.yaml``), as distributed, has
##~!!~## all COMPAS option entries commented so that the COMPAS default value for the
Expand All @@ -10,7 +10,7 @@ booleanChoices:

### LOGISTICS
# --debug-to-file: False # Default: False
# --detailed-output: False # Default: False # WARNING! this creates a data heavy file
--detailed-output: True # Default: False # WARNING! this creates a data heavy file
# --enable-warnings: False # Default: False # option to enable/disable warning messages
# --errors-to-file: False # Default: False
# --evolve-unbound-systems: True # Default: True
Expand Down Expand Up @@ -47,6 +47,9 @@ booleanChoices:
# --common-envelope-lambda-nanjing-use-rejuvenated-mass: False # Default: False
# --revised-energy-formalism-nandez-ivanova: False # Default: False

### TIDES
# --enable-tides: False # Default: False

### SUPERNOVAE, KICKS AND REMNANTS
# --allow-non-stripped-ECSN: False # Default: False
# --pair-instability-supernovae: True # Default: True
Expand Down Expand Up @@ -96,7 +99,7 @@ numericalChoices:
# --rotational-frequency: 0.000000 # Default: 0.000000
# --rotational-frequency-1: 0.000000 # Default: 0.000000
# --rotational-frequency-2: 0.000000 # Default: 0.000000
# --wolf-rayet-multiplier: 1.000000 # Default: 1.000000
# --wolf-rayet-multiplier: 0.100000 # Default: 0.100000

### BINARY PROPERTIES
# --eccentricity: 0.000000 # Default: 0.000000 # eccentricity for BSE
Expand Down Expand Up @@ -202,7 +205,7 @@ stringChoices:

### LOGISTICS
# --add-options-to-sysparms: 'GRID' # Default: 'GRID' # Options: ['NEVER','GRID','ALWAYS']
# --grid: '' # Default: '' # grid file name (e.g. 'mygrid.txt')
--grid: 'Grid_demo.txt' # Default: '' # grid file name (e.g. 'mygrid.txt')
# --mode: 'BSE' # Default: 'BSE' # Options: ['BSE','SSE'] # evolving single (SSE) or binary stars (BSE)
# --notes: { } # Default: { }
# --notes-hdrs: { } # Default: { }
Expand All @@ -213,11 +216,7 @@ stringChoices:
# --envelope-state-prescription: 'LEGACY' # Default: 'LEGACY' # Options: ['FIXED_TEMPERATURE','HURLEY','LEGACY']
# --initial-mass-function: 'KROUPA' # Default: 'KROUPA' # Options: ['KROUPA','UNIFORM','POWERLAW','SALPETER']
# --luminous-blue-variable-prescription: 'HURLEY_ADD' # Default: 'HURLEY_ADD' # Options: ['BELCZYNSKI','HURLEY','HURLEY_ADD','NONE']
# --mass-loss-prescription: 'FLEXIBLE2023' # Default: 'FLEXIBLE2023' # Options: ['FLEXIBLE2023','BELCZYNSKI2010','HURLEY','NONE']
# --OB-mass-loss: 'VINK2021' # Default: 'VINK2021' # Options: ['KRTICKA2018','BJORKLUND2022','VINK2021','VINK2001','NONE']
# --RSG-mass-loss: 'DECIN2023' # Default: 'DECIN2023' # Options: ['NJ90','KEE2021','YANG2023','DECIN2023','BEASOR2020','VINKSABHAHIT2023','NONE']
# --VMS-mass-loss: 'SABHAHIT2023' # Default: 'SABHAHIT2023' # Options: ['SABHAHIT2023','BESTENLEHNER2020','VINK2011','NONE']
# --WR-mass-loss: 'SANDERVINK2023' # Default: 'SANDERVINK2023' # Options: ['SHENAR2019','SANDERVINK2023','BELCZYNSKI2010']
# --mass-loss-prescription: 'VINK' # Default: 'VINK' # Options: ['VINK','HURLEY','NONE']
# --metallicity-distribution: 'ZSOLAR' # Default: 'ZSOLAR' # Options: ['LOGUNIFORM','ZSOLAR']
# --pulsational-pair-instability-prescription: 'MARCHANT' # Default: 'MARCHANT' # Options: ['FARMER','MARCHANT','STARTRACK','COMPAS']

Expand Down
17 changes: 10 additions & 7 deletions online-docs/pages/Getting started/dev-git-workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Contents of this document
`Day to Day Commands <#day-to-day-commands>`__


`Lifetime of a Project <#lifetime-of-a-project>`__
`Lifetime of a New Feature <#lifetime-of-a-new-feature>`__


`COMPAS Git Workflow <#the-compas-git-workflow>`__
Expand All @@ -27,7 +27,7 @@ Contents of this document


Introduction
============
------------

Git & Github for COMPAS developers

Expand Down Expand Up @@ -117,7 +117,7 @@ which is in common use in industry.


Getting Set Up
==============
--------------

**Step-by-step directions for how to configure your local and remote git
repositories**
Expand Down Expand Up @@ -215,6 +215,7 @@ homepage <https://compas.science/>`__ for an up-to-date list).


Fork the main repo
------------------


As a COMPAS developer, you are highly encouraged to create your own
Expand Down Expand Up @@ -262,7 +263,7 @@ The ``<fork-nickname>`` is your choice, but should be informative, e.g


Day to Day commands
===================
-------------------

Basic commands for navigating local git

Expand Down Expand Up @@ -461,6 +462,7 @@ preferred text editor.


Deleting branches
-----------------


You should become comfortable deleting branches, or else your repos
Expand Down Expand Up @@ -607,6 +609,7 @@ which will have an output that looks similar to:


git pull
--------


If you have a branch which is "behind" the remote branch it is tracking
Expand Down Expand Up @@ -697,7 +700,7 @@ called the "upstream" branch) with:


Lifetime of a New Feature
=========================
-------------------------

New feature branches

Expand Down Expand Up @@ -808,7 +811,7 @@ before accepting it, so keep an eye on the pull request conversation.


The COMPAS Git Workflow
=======================
-----------------------

The above sections go over many of the available git commands that you
might find useful.
Expand Down Expand Up @@ -868,7 +871,7 @@ comparisons of key plots from different papers.


Terminology
===========
-----------

- **Commit**: A single commit records a collection of edits to one or
more files, with an associated commit message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ Default = 0.0
Multiplication factor for Eddington accretion for NS & BH (i.e. > 1 is super-eddington and 0 is no accretion). |br|
Default = 1.0

**--enable-tides** |br|
Enables tides. |br|
Default = FALSE

**--enable-warnings** |br|
Display warning messages to stdout. |br|
Default = FALSE
Expand Down Expand Up @@ -935,12 +939,6 @@ Default = 10

:ref:`Back to Top <options-props-top>`

**--OB-mass-loss** |br|
Main sequence mass loss prescription. |br|
Options: { NONE, VINK2001, VINK2021, BJORKLUND2022, KRTICKA2018 } |br|
NONE turns off mass loss for main sequence stars. Also available are Vink (2001, previous default), Vink (2021), Bjorklund (2022), and Krticka (2018). |br|
Default = VINK2021

**--orbital-period** |br|
Initial orbital period for a binary star when evolving in BSE mode (days). |br|
Used only if the semi-major axis is not specified via ``--semi-major-axis``. |br|
Expand Down Expand Up @@ -1107,12 +1105,6 @@ Options: { ZERO, HURLEY, VLTFLAMES } |br|
``ZERO`` sets all initial rotational velocities to 0, while ``HURLEY`` and ``VLTFLAMES`` sample them from the Hurley, Pols, Tout (2000) and Ramirez-Agudelo et al. (2013,2015), respectively |br|
Default = ZERO

**--RSG-mass-loss** |br|
Red supergiant mass loss prescription. |br|
Options: { NONE, VINKSABHAHIT2023, BEASOR2020, DECIN2023, YANG2023, KEE2021, NJ90 } |br|
NONE turns off mass loss for giant (CHeB, FGB, AGB, TPAGB stellar types) stars below the RSG_MAXIMUM_TEMP. Also available are Vink and Sabhahit (2023), Beasor et al. (2020), Decin et al. (2023), Yang et al. (2023), Kee et. al (2021), and Nieuwenhuijzen and de Jager (1990, previous default). |br|
Default = DECIN2023

.. _options-props-S:

:ref:`Back to Top <options-props-top>`
Expand Down Expand Up @@ -1181,12 +1173,6 @@ Default = TRUE
**--version [ -v ]** |br|
Prints COMPAS version string.

**--VMS-mass-loss** |br|
Very massive main sequence mass loss prescription. |br|
Options: { NONE, VINK2011, SABHAHIT2023, BESTENLEHNER2020 } |br|
Applied above the VERY_MASSIVE_MINIMUM_MASS (100 Msol by default). NONE turns off mass loss. Also available are Vink (2011), Bestenlehner (2020), and Sabhahit (2023). |br|
Default = SABHAHIT2023

.. _options-props-W:

:ref:`Back to Top <options-props-top>`
Expand All @@ -1196,12 +1182,6 @@ Multiplicative constant for Wolf Rayet winds. Note that wind mass loss will also
``overall-wind-mass-loss-multiplier``. |br|
Default = 1.0

**--WR-mass-loss** |br|
Wolf-Rayet mass loss prescription. |br|
Options: { BELCZYNSKI2010, SANDERVINK2023, SHENAR2019 } |br|
Selects between Belczynski (2010), Sander and Vink (2021 updated), and Shenar (2019). |br|
Default = SANDERVINK2023

.. _options-props-X:
.. _options-props-Y:

Expand Down Expand Up @@ -1259,8 +1239,7 @@ Go to :ref:`the top of this page <options-props-top>` for the full alphabetical

--use-mass-loss, --check-photon-tiring-limit, --cool-wind-mass-loss-multiplier, --luminous-blue-variable-prescription,
--luminous-blue-variable-multiplier, --mass-loss-prescription, --overall-wind-mass-loss-multiplier, --wolf-rayet-multiplier,
--expel-convective-envelope-above-luminosity-threshold, --luminosity-to-mass-threshold,
--OB-mass-loss, --RSG-mass-loss, --VMS-mass-loss, --WR-mass-loss
--expel-convective-envelope-above-luminosity-threshold, --luminosity-to-mass-threshold

--chemically-homogeneous-evolution

Expand All @@ -1281,7 +1260,7 @@ Go to :ref:`the top of this page <options-props-top>` for the full alphabetical
--mass-transfer-rejuvenation-prescription, --mass-transfer-thermal-limit-accretor, --mass-transfer-thermal-limit-C, --retain-core-mass-during-caseA-mass-transfer,
--stellar-zeta-prescription, --zeta-adiabatic-arbitrary, --zeta-main-sequence, --zeta-radiative-giant-star

--circulariseBinaryDuringMassTransfer, --angular-momentum-conservation-during-circularisation
--circulariseBinaryDuringMassTransfer, --angular-momentum-conservation-during-circularisation, --enable-tides

--envelope-state-prescription, --common-envelope-alpha, --common-envelope-alpha-thermal, --common-envelope-formalism,
--common-envelope-lambda-prescription, --common-envelope-lambda,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ specify the values of the program options.

An example Python script is provided in the COMPAS suite on github: ``runSubmit.py``. Additionally, the default COMPAS options are specified on ``compasConfigDefault.yaml``. Users should copy the ``runSubmit.py`` and ``runSubmit.py`` scripts and modify the ``compasConfigDefault.yaml`` copy to match their experimental requirements. Refer to the :doc:`Getting started guide <../../Getting started/getting-started>` for more details.

To run COMPAS via Python using the ``runSubmit.py`` script provided, set the shell environment variable ``COMPAS-ROOT-DIR``
To run COMPAS via Python using the ``runSubmit.py`` script provided, set the shell environment variable ``COMPAS_ROOT_DIR``
to the parent directory of the directory in which the COMPAS executable resides, then type `python /path-to-runSubmit/runSubmit.py`.
For example, for Ubuntu Linux, type::

Expand Down
5 changes: 5 additions & 0 deletions online-docs/pages/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Following is a brief list of important updates to the COMPAS code. A complete r

**LATEST RELEASE** |br|

**02.41.00 Nov 02, 2023**

* Added a naive tides implementation.
* Added program option ``enable-tides`` to enable the tides implementation (default is ``false``).

**02.40.00 Oct 20, 2023**

* Added ``FLEXIBLE2023`` as a new default, and ``BELCZYNSKI2010`` as a replacement for the previous ``VINK`` mass loss prescription. The following new sub-wrappers are overridden when selecting ``BELCZYNSKI2010``:
Expand Down
17 changes: 10 additions & 7 deletions py_tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import os
from typing import Any, Dict

import subprocess
import h5py
import pytest
from compas_python_utils.cosmic_integration.binned_cosmic_integrator.bbh_population import \
generate_mock_bbh_population_file

HERE = os.path.dirname(__file__)
DETAILED_EVOLUTION_PATH = os.path.join(
HERE, "../misc/examples/methods_paper_plots/detailed_evolution"
)

TEST_CONFIG_DIR = os.path.join(HERE, "test_data")
TEST_CONFIG_FNAME = os.path.join(TEST_CONFIG_DIR, "fiducial_bbh_config.yaml")
TEST_ARCHIVE_DIR = os.path.join(HERE, "test_artifacts")


Expand All @@ -21,16 +20,20 @@ def example_compas_output_path(clean=False):
(This is a fixture so it can passed as a parameter to other tests)
"""
compas_data_path = os.path.join(
DETAILED_EVOLUTION_PATH, "COMPAS_Output/COMPAS_Output.h5"
TEST_CONFIG_DIR, "COMPAS_Output/COMPAS_Output.h5"
)

if not os.path.exists(compas_data_path) or clean: # Check if path exists
curr_dir = os.getcwd()
os.chdir(DETAILED_EVOLUTION_PATH)
os.system("python runSubmitDemo.py")
os.chdir(TEST_CONFIG_DIR)
cmd = f"compas_run_submit {TEST_CONFIG_FNAME}"
# run the command in shell "compas_run_submit {TEST_CONFIG_FNAME}" with subprocess
subprocess.run(cmd, shell=True, check=True)

os.chdir(curr_dir)
print("Generated COMPAS test data")


return compas_data_path


Expand Down
10 changes: 7 additions & 3 deletions py_tests/test_data/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Test Data

This folder contains all the COMPAS test data generated manually by running:
This folder contains COMPAS configs used for testing.
COMPAS is run from within the pytest environment and the output is cached for the remainder of the tests.

The pytest runs the following command:
```bash
bash generate_test_data.sh
compas_run_submit fiducial_bbh_configs.yaml
```

These files may need to be periodically updated if the COMPAS code changes.
The pytest cache is _not_ cleared locally (but will be cleared on the CI server).
Hence, this may need to be rerun locally if changes are made to COMPAS.
Loading

0 comments on commit 7fde047

Please sign in to comment.