/GC_formation_model

A post-processing model for globular cluster formation in cosmological simulations.

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

GC_formation_model

version license workflows

A post-processing model for globular cluster formation in cosmological simulations.

The code is open source under a BSD 3-Clause License, which allows you to redistribute and modify the code with moderate limitations. If you use this code for a publication, we kindly request you to cite the following original papers.

We also provide a toolkit for parallelization. If you are planning to use the toolkit, please contact us for access!

Background

This is a long developing project starting from Muratov & Gnedin (2010). Some important milestones are Li & Gnedin (2014), Choksi, Gnedin, & Li (2018), Chen & Gnedin (2022), and Chen & Gnedin (2023). This version is the most recent model by Chen & Gnedin (2024a).

Install

We have tested GC_formation_model on python >= 3.8. However, lower versions may also work. The prerequisites of this package are

numpy
scipy
h5py

To download the packge, git clone the source code from GitHub:

$ git clone https://github.com/ybillchen/GC_formation_model.git

Next, cd the folder and use pip to install it:

$ cd GC_formation_model/
$ pip install -e .

The -e command allows you to make changes to the code.

Usage

To start with, let's run the model with default parameters

>>> from GC_formation_model import run
>>> from params_example import params
>>> run(params)

You may want to use your own paramters. Then simply replace params_example with the name of your paramter file.

Contribute

Feel free to dive in! Raise an issue or submit pull requests.

Pull request protocol

We recommend you to contribute code to GC_formation_model following GitHub flow. To summarize, you submit a pull request via the following steps:

  1. Clone the repository.
  2. Create and checkout a new branch. For example, a new branch called new_feature.
  3. Make changes on new_feature and never touch the main branch again until you are ready to merge.
  4. When you feel ready, submit a pull request on GitHub.
  5. There may be conflicts. If so, you need to
    1. Checkout the main branch and pull from origin.
    2. Rebase new_feature on main and address the conflicts (recommended).
    3. Alternatively, you can compare new_feature with main and fix all conflicts.
    4. Your pull request will update automatically.
  6. If your pull request is approved, we will squash and merge your commits.
  7. We will delete new_feature on GitHub when it's merged. You can choose to delete it loacally as well.

NOTE: Any slight modification may entirely change the random number generation! To keep repeatability of the model, please construct a new random generator for the need of new random numbers

Maintainers