ytree

ytree: A Python package for analyzing merger trees - Published in JOSS (2019)

https://github.com/ytree-project/ytree

Science Score: 98.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 7 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

analysis astronomy astrophysics data merger-trees python simulations trees
Last synced: 4 months ago · JSON representation ·

Repository

A Python package for analyzing tree data and especially merger trees.

Basic Info
  • Host: GitHub
  • Owner: ytree-project
  • License: other
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 3.51 MB
Statistics
  • Stars: 16
  • Watchers: 6
  • Forks: 10
  • Open Issues: 5
  • Releases: 14
Topics
analysis astronomy astrophysics data merger-trees python simulations trees
Created over 8 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

ytree

CircleCI codecov pre-commit.ci status Documentation Status Supported Python Versions PyPI version Anaconda-Server Badge DOI DOI yt-project

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

Generally speaking, tree data defines a one-directional relationship between a series of objects. In trees, objects can have one or more ancestors, but only a single descendent.

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('tree000.dat') mytree = 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 or conda:

pip installation

pip install ytree

conda installation

conda install conda-forge::ytree

source installation

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 it. Citation instructions can be found here.

Resources

Owner

  • Name: ytree-project
  • Login: ytree-project
  • Kind: organization

JOSS Publication

ytree: A Python package for analyzing merger trees
Published
December 18, 2019
Volume 4, Issue 44, Page 1881
Authors
Britton D. Smith ORCID
University of Edinburgh
Meagan Lang ORCID
University of Illinois at Urbana-Champaign
Editor
Juanjo Bazán ORCID
Tags
astronomy astrophysics merger tree structure formation galaxies

Citation (CITATION.rst)

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_2025_17045610,
    author       = {Britton Smith and
                    Meagan Lang and
                    John Wise and
                    Juanjo Bazán},
    title        = {ytree-project/ytree: ytree 3.3.1 Release},
    month        = sep,
    year         = 2025,
    publisher    = {Zenodo},
    version      = {ytree-3.3.1},
    doi          = {10.5281/zenodo.17045610},
    url          = {https://doi.org/10.5281/zenodo.17045610},
  }

GitHub Events

Total
  • Create event: 3
  • Release event: 2
  • Issues event: 3
  • Watch event: 3
  • Delete event: 1
  • Issue comment event: 6
  • Push event: 19
  • Pull request event: 38
Last Year
  • Create event: 3
  • Release event: 2
  • Issues event: 3
  • Watch event: 3
  • Delete event: 2
  • Issue comment event: 6
  • Push event: 20
  • Pull request event: 39

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 1,308
  • Total Committers: 4
  • Avg Commits per committer: 327.0
  • Development Distribution Score (DDS): 0.032
Past Year
  • Commits: 13
  • Committers: 1
  • Avg Commits per committer: 13.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Britton Smith b****h@g****m 1,266
langmm c****8@g****m 40
Juanjo Bazán j****n@g****m 1
John Wise j****7 1

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 24
  • Total pull requests: 120
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 7
  • Total pull request authors: 4
  • Average comments per issue: 3.29
  • Average comments per pull request: 0.74
  • Merged pull requests: 101
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 2
  • Pull requests: 30
  • Average time to close issues: N/A
  • Average time to close pull requests: about 19 hours
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.03
  • Merged pull requests: 23
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • brittonsmith (12)
  • TobiBu (5)
  • manodeep (3)
  • PauCaBu (1)
  • cspotz (1)
  • Morkney (1)
  • milanq14 (1)
Pull Request Authors
  • brittonsmith (116)
  • matthewturk (2)
  • jwise77 (1)
  • dependabot[bot] (1)
Top Labels
Issue Labels
enhancement (11) bug (6) frontends (4) documentation (3) testing (3) infrastructure (2) ci (2) help wanted (1) back burner (1)
Pull Request Labels
enhancement (23) infrastructure (17) ci (17) bug (14) releases (13) documentation (11) frontends (11) testing (10) project (5) dependencies (3) github_actions (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 264 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 27
  • Total maintainers: 1
pypi.org: ytree

A Python package for analyzing tree data and especially merger trees.

  • Versions: 25
  • Dependent Packages: 0
  • Dependent Repositories: 3
  • Downloads: 264 Last month
Rankings
Dependent repos count: 9.0%
Dependent packages count: 10.0%
Forks count: 11.9%
Stargazers count: 14.9%
Average: 15.1%
Downloads: 29.8%
Maintainers (1)
Last synced: 4 months ago
conda-forge.org: ytree
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Forks count: 42.2%
Average: 44.1%
Stargazers count: 48.9%
Dependent packages count: 51.2%
Last synced: 4 months ago

Dependencies

.github/workflows/python-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish v1.5.0 composite
pyproject.toml pypi
  • configparser *
  • h5py *
  • more_itertools >=8.4
  • numpy *
  • unyt >=3.0.1
  • yt >=4.2