Welcome to ytree’s documentation!

ytree is a merger-tree code based on the yt analysis toolkit. ytree can create merger-trees from Gadget FoF/Subfind catalogs, either for all halos or for a specific set of halos. ytree is able to load in merger-tree from the following formats:

All formats can be saved with a universal format that can be reloaded with ytree. Individual trees for single halos can also be saved. Similar to yt, fields queried for halos or trees are returned with units.


ytree’s main dependency is yt. Once you have installed yt following the instructions here, ytree can be installed using pip.

pip install ytree

If you’d like to install the development version or don’t want to use pip, the mercurial repository for ytree can be found here. To clone the repositry, just do:

hg clone https://bitbucket.org/brittonsmith/ytree

Then, install with one of the following two methods:

cd ytree
python setup.py develop


cd ytree
pip install -e .

What version do I have?

To see what version of ytree you are using, do the following:

import ytree
print (ytree.__version__)


Since ytree is heavily based on yt, the best way to get help is by joining the yt users list. Feel free to post any questions or ideas for development.

Citing ytree

If you use ytree in your work, please cite it as “ytree, written by Britton smith” with a footnote pointing to http://ytree.readthedocs.io.