Skip to main content

An extension of yt for working with merger-tree data.

Project description

ytree

CircleCI codecov Documentation Status PyPI version DOI yt-project

This is ytree, a yt extension for working with merger tree data.

Structure formation in cosmology proceeds in a hierarchical fashion, where dark matter halos grow via mergers with other halos. This type of evolution can be conceptualized as a tree, with small branches connecting to successively larger ones, and finally to the trunk. A merger tree describes the growth of halos in a cosmological simulation by linking a halo appearing in a given snapshot to its direct ancestors in a previous snapshot and its descendent in the next snapshot.

Merger trees are computationally expensive to generate and a great number of codes exist for computing them. However, each of these codes saves the resulting data to a different format. ytree is Python package for reading and working with merger tree data from multiple formats. If you are already familiar with using yt to analyze snapshots from cosmological simulations, then think of ytree as the yt of merger trees.

To load a merger tree data set with ytree and print the masses of all the halos in a single tree, one could do:

>>> import ytree
>>> a = ytree.load('tree_0_0_0.dat')
>>> my_tree = a[0]
>>> print(my_tree['tree', 'mass'].to('Msun'))
[6.57410072e+14 6.57410072e+14 6.53956835e+14 6.50071942e+14 ...
 2.60575540e+12 2.17122302e+12 2.17122302e+12] Msun

A list of all currently supported formats can be found in the online documentation. If you would like to see support added for another format, we would be happy to work with you to make it happen. In principle, any type of tree-like data where an object has one or more ancestors and a single descendent can be supported.

Installation

ytree can be installed with pip:

pip install ytree

To get the development version, clone this repository and install like this:

git clone https://github.com/ytree-project/ytree
cd ytree
pip install -e .

Getting Started

The ytree documentation will walk you through installation, get you started analyzing merger trees, and help you become a contributor to the project. Have a look!

Sample Data

Sample data for all merger tree formats supported by ytree is available on the yt Hub in the ytree data collection.

Contributing

ytree would be much better with your contribution! As an extension of the yt Project, we follow the yt guidelines for contributing.

Citing ytree

If you use ytree in your work, please cite the following:

Smith et al., (2019). ytree: A Python package for analyzing merger trees.
Journal of Open Source Software, 4(44), 1881,
https://doi.org/10.21105/joss.01881

For BibTeX users:

  @article{ytree,
    doi = {10.21105/joss.01881},
    url = {https://doi.org/10.21105/joss.01881},
    year  = {2019},
    month = {dec},
    publisher = {The Open Journal},
    volume = {4},
    number = {44},
    pages = {1881},
    author = {Britton D. Smith and Meagan Lang},
    title = {ytree: A Python package for analyzing merger trees},
    journal = {Journal of Open Source Software}
  }

If you would like to also cite the specific version of ytree used in your work, include the following reference:

@software{britton_smith_2021_5336665,
  author       = {Britton Smith and
                  Meagan Lang and
                  Juanjo Bazán},
  title        = {ytree-project/ytree: ytree 3.1 Release},
  month        = aug,
  year         = 2021,
  publisher    = {Zenodo},
  version      = {ytree-3.1.0},
  doi          = {10.5281/zenodo.5336665},
  url          = {https://doi.org/10.5281/zenodo.5336665}
}

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ytree-3.1.1.tar.gz (804.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ytree-3.1.1-py3-none-any.whl (121.4 kB view details)

Uploaded Python 3

File details

Details for the file ytree-3.1.1.tar.gz.

File metadata

  • Download URL: ytree-3.1.1.tar.gz
  • Upload date:
  • Size: 804.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ytree-3.1.1.tar.gz
Algorithm Hash digest
SHA256 d970c6e7ef3d9ae3a46b67ad17a338409ecff1e452a6e3dfec949fb37783f6d6
MD5 348f3b150f2e3a5d335e44af971828ac
BLAKE2b-256 4c19ea1fc198cd0e60437684ba7969604d25004844cb1ec371455536d3c4e0c2

See more details on using hashes here.

File details

Details for the file ytree-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: ytree-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 121.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for ytree-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c30fccab136086e4ece52258095c2dae4eada5897f8f263a0cb7c7af92b2e293
MD5 644a284fb51bb4a4572bf690fa34badf
BLAKE2b-256 1d3d285308c97f8dc372087177b7f199f7bbb272852ea5d2eca541142e3ed064

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page