Skip to content

Commit

Permalink
(compasUtils) merge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
themikelau committed Dec 4, 2023
2 parents 26d75d9 + e39c6b7 commit 50051ea
Show file tree
Hide file tree
Showing 317 changed files with 35,876 additions and 42,002 deletions.
17 changes: 17 additions & 0 deletions .dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
parms
hist
tHeI
thei
Hist
vie
mye
NWO
nd
lamda
bject
accreting
accrete
accreted
YHe
yhe

71 changes: 65 additions & 6 deletions .github/workflows/compas-compile-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,75 @@
name: COMPAS compile test

on: [pull_request]
on:
workflow_dispatch: # allow manual triggering of this workflow
pull_request: # run workflow when PRs made to dev (if following files changed)
branches:
- dev
paths: ['src/**', "compas_python_utils/**", "py_tests/**", ".github/workflows/**"]
push: # always run workflow on push to the following branch
branches:
- dev

jobs:
compas:
name: Build COMPAS
runs-on: ubuntu-18.04
runs-on: ${{ matrix.os}}
container: ${{matrix.container}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies

- name: Install dependencies
run: sudo apt install g++ libboost-all-dev libgsl-dev libhdf5-serial-dev
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu-20')
run: |
cd misc/cicd-scripts
chmod 755 linux-dependencies
./linux-dependencies
- name: Build Compas
run: cd src && make -j $(nproc) -f Makefile
run: |
cd src && make -j $(nproc) -f Makefile
./COMPAS -v
- name: Run example COMPAS job
run: |
pip install --upgrade pip
pip install -e .[dev]
export COMPAS_ROOT_DIR=${GITHUB_WORKSPACE}
cd ${GITHUB_WORKSPACE}/misc/examples/methods_paper_plots/detailed_evolution
chmod 755 run.sh
cat run.sh
./run.sh
- name: Run pytests
# Run tests and collect coverage data
run: |
cd ${GITHUB_WORKSPACE}
export COMPAS_ROOT_DIR=${GITHUB_WORKSPACE}
jupyter-kernelspec list
pytest --cov=compas_python_utils/ py_tests/ -m 'not webtest'
pytest --cov=compas_python_utils/ --cov-append py_tests/ -m webtest
coverage html
coverage-badge -o coverage_badge.svg -f
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: |
htmlcov/
coverage_badge.svg
- name: Archive COMPAS run data
uses: actions/upload-artifact@v3
with:
name: COMPAS-run-artifacts
path: |
py_tests/test_artifacts
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
release:
name: Build Docker image and push to DockerHub
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/latex-compile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ name: LaTeX compile test

on:
pull_request:
paths: ['main/**'] # only changes to src/ trigger this workflow
push:
branches: [dev]
branches: [dev]
paths: ['main/**']


jobs:
latex:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/precommit-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: precommit checks

on:
push:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: pre-commit/action@v3.0.0
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
ehthumbs.db
Thumbs.db


# Compiled source
*.egg-info/
*.com
*.class
*.dll
Expand All @@ -21,6 +23,9 @@ Thumbs.db
__pycache__/
COMPAS_Output*/
output*/
*.coverage
test_artifacts/

COMPAS
*.log
*.aux
Expand All @@ -37,8 +42,7 @@ COMPAS

# docs html
*_build

*.vscode

Makefile-reinhold
.gitignore
/utils/examples/*.ipynb
/utils/examples/*.h5
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
default_language_version:
python: python3
repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell # Spellchecker
args: [--ignore-words=.dictionary.txt, --skip, '*.eps,*.svg,*.ipynb,./misc/*,paper.md,./online-docs/index.rst']
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the online-docs/ directory with Sphinx
sphinx:
builder: html
configuration: online-docs/conf.py

# Build only html documentation (specificall, don't build PDF!)
formats: []

# Set the version of Python and other tools you might need
python:
install:
- requirements: requirements.txt
- method: pip
path: .
extra_requirements:
- docs
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN apt-get update && apt-get install -y \

# RUN pip install numpy awscli
RUN pip3 install numpy
RUN pip3 install pyyaml

# Copy only the source required to compile COMPAS
COPY src/ src/
Expand Down
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[//]: ## (grip -b README.md)

![COMPASlogo](docs/media/COMPASlogo.png)
![COMPASlogo](utils/COMPAS-logo/fullCompasLogo.png)

# Compact Object Mergers: Population Astrophysics & Statistics

[![Documentation](https://img.shields.io/badge/Documentation-latest-orange.svg?style=flat)](https://github.com/TeamCOMPAS/COMPAS/blob/Documentation/COMPAS_Documentation.pdf)

[//]: ## (Outline features)
COMPAS is a publicly available rapid binary population synthesis code (https://compas.science/) that is designed so that evolution prescriptions and model parameters are easily
adjustable. COMPAS draws properties for a binary star system from a set of initial distributions, and evolves it from zero-age main sequence to the end of its life as two compact
Expand All @@ -20,26 +18,33 @@ Please email your queries to compas-user@googlegroups.com. You are also welcome
## Acknowledgements
If you use this code or parts of this code for results presented in a scientific publication, we would greatly appreciate if you send us your paper reference and make your input settings and output data publicly available by uploading it to the [COMPAS Zenodo community](https://zenodo.org/communities/compas/). Please also kindly include citations to our COMPAS methods paper https://ui.adsabs.harvard.edu/abs/2021arXiv210910352T/abstract. As the public COMPAS code is a product of work by the entire COMPAS collaboration over many years, we kindly request that, in recognition of this team effort, the paper is cited as “Team COMPAS: J. Riley et al.”. An example bibtex code is:


@ARTICLE{COMPAS:2021methodsPaper,
author = {{\noopsort{Team COMPAS}}{Team COMPAS: J. Riley} and {Riley}, Jeff and {Agrawal}, Poojan and {Barrett}, Jim W. and {Boyett}, Kristan N.~K. and {Broekgaarden}, Floor S. and {Chattopadhyay}, Debatri and {Gaebel}, Sebastian M. and {Gittins}, Fabian and {Hirai}, Ryosuke and {Howitt}, George and {Justham}, Stephen and {Khandelwal}, Lokesh and {Kummer}, Floris and {Lau}, Mike Y.~M. and {Mandel}, Ilya and {de Mink}, Selma E. and {Neijssel}, Coenraad and {Riley}, Tim and {van Son}, Lieke and {Stevenson}, Simon and {Vigna-Gomez}, Alejandro and {Vinciguerra}, Serena and {Wagg}, Tom and {Willcox}, Reinhold},
title = "{Rapid stellar and binary population synthesis with COMPAS}",
journal = {arXiv e-prints},
keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Solar and Stellar Astrophysics},
year = 2021,
month = sep,
eid = {arXiv:2109.10352},
pages = {arXiv:2109.10352},
@ARTICLE{2022ApJS..258...34R,
author = {{Riley}, Jeff and {Agrawal}, Poojan and {Barrett}, Jim W. and {Boyett}, Kristan N.~K. and {Broekgaarden}, Floor S. and {Chattopadhyay}, Debatri and {Gaebel}, Sebastian M. and {Gittins}, Fabian and {Hirai}, Ryosuke and {Howitt}, George and {Justham}, Stephen and {Khandelwal}, Lokesh and {Kummer}, Floris and {Lau}, Mike Y.~M. and {Mandel}, Ilya and {de Mink}, Selma E. and {Neijssel}, Coenraad and {Riley}, Tim and {van Son}, Lieke and {Stevenson}, Simon and {Vigna-G{\'o}mez}, Alejandro and {Vinciguerra}, Serena and {Wagg}, Tom and {Willcox}, Reinhold and {Team Compas}},
title = "{Rapid Stellar and Binary Population Synthesis with COMPAS}",
journal = {\apjs},
keywords = {1622, 154, 1108, 162, Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Solar and Stellar Astrophysics},
year = 2022,
month = feb,
volume = {258},
number = {2},
eid = {34},
pages = {34},
doi = {10.3847/1538-4365/ac416c},
archivePrefix = {arXiv},
eprint = {2109.10352},
primaryClass = {astro-ph.IM},
adsurl = {https://ui.adsabs.harvard.edu/abs/2021arXiv210910352T},
adsurl = {https://ui.adsabs.harvard.edu/abs/2022ApJS..258...34R},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Note that the preferred acknowledgement relies on \noopsort; to make it work, you'll have to include the following line at the start of your bibtex file:

Note that the preferred acknowledgement relies on \noopsort and cites the paper as TEAM COMPAS; Riley et al.; to make it work, you'll have to include the following line at the start of your bibtex file:
@PREAMBLE{ {\providecommand{\noopsort}[1]{}} }

and change the author line in the bib entry to:

author = {{\noopsort{Team COMPAS}}{Team COMPAS: Riley, J.} and {Agrawal}, Poojan and {Barrett}, Jim W. and {Boyett}, Kristan N.~K. and {Broekgaarden}, Floor S. and {Chattopadhyay}, Debatri and {Gaebel}, Sebastian M. and {Gittins}, Fabian and {Hirai}, Ryosuke and {Howitt}, George and {Justham}, Stephen and {Khandelwal}, Lokesh and {Kummer}, Floris and {Lau}, Mike Y.~M. and {Mandel}, Ilya and {de Mink}, Selma E. and {Neijssel}, Coenraad and {Riley}, Tim and {van Son}, Lieke and {Stevenson}, Simon and {Vigna-Gomez}, Alejandro and {Vinciguerra}, Serena and {Wagg}, Tom and {Willcox}, Reinhold}



In addition, we suggest to kindly include the two following papers:
Expand Down
11 changes: 11 additions & 0 deletions compas_python_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

__all__ = []

__author__ = "Team COMPAS"
__email__ = "compas email"
__uri__ = "https://github.com/TeamCOMPAS/COMPAS"
__license__ = "MIT"
__description__ = "COMPAS"
__copyright__ = "Copyright 2022 COMPAS developers"
__contributors__ = "https://github.com/TeamCOMPAS/COMPAS/graphs/contributors"
__version__ = "0.0.1"
Loading

0 comments on commit 50051ea

Please sign in to comment.