Skip to main content

MiSTree

MiSTree Version PyPI version Python Version Support Ubuntu MacOS Windows coverage License: MIT status ascl DOI Binder

Introduction

The minimum spanning tree (MST), a graph constructed from a distribution of points, draws lines between pairs of points so that all points are linked in a single skeletal structure that contains no loops and has minimal total edge length. The MST has been used in a broad range of scientific fields such as particle physics, in astronomy and cosmology. Its success in these fields has been driven by its sensitivity to the spatial distribution of points and the patterns within. MiSTree, a public Python package, allows a user to construct the MST in a variety of coordinates systems, including Celestial coordinates used in astronomy. The package enables the MST to be constructed quickly by initially using a k-nearest neighbour graph (k NN, rather than a matrix of pairwise distances) which is then fed to Kruskal's algorithm to construct the MST. MiSTree enables a user to measure the statistics of the MST and provides classes for binning the MST statistics (into histograms) and plotting the distributions. Applying the MST will enable the inclusion of high-order statistics information from the cosmic web which can provide additional information to improve cosmological parameter constraints. This information has not been fully exploited due to the computational cost of calculating N-point statistics. MiSTree was designed to be used in cosmology but could be used in any field which requires extracting non-Gaussian information from point distributions.

Dependencies

  • numpy
  • numba
  • matplotlib
  • scipy
  • scikit-learn

For testing you will require nose or pytest.

Installation

MiSTree can be installed as follows:

pip install mistree [--user]

The --user is optional and only required if you don’t have write permission. If you are using a windows machine this may not work, in this case (or as an alternative to pip) clone the repository,

git clone https://github.com/knaidoo29/mistree.git
cd mistree

and install by either running

pip install . [--user]

or

python setup.py build
python setup.py install

Similarly, if you would like to work and edit mistree you can clone the repository and install an editable version:

git clone https://github.com/knaidoo29/mistree.git
cd mistree
pip install -e . [--user]

From the mistree directory you can then test the install using nose:

python setup.py test

or using pytest:

python -m pytest

You should now be able to import the module:

import mistree as mist

Documentation

In depth documentation and tutorials are provided here.

Tutorials

The tutorials in the documentation are supplied as ipython notebooks which can be downloaded from here or can be run online using binder.

Citing

You can cite MiSTree using the following BibTex:

@ARTICLE{Naidoo2019,
       author = {{Naidoo}, Krishna},
        title = "{MiSTree: a Python package for constructing and analysing Minimum Spanning Trees}",
      journal = {The Journal of Open Source Software},
         year = "2019",
        month = "Oct",
       volume = {4},
       number = {42},
          eid = {1721},
        pages = {1721},
          doi = {10.21105/joss.01721},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2019JOSS....4.1721N}
}

Support

If you have any issues with the code or want to suggest ways to improve it please open a new issue (here) or (if you don't have a github account) email krishna.naidoo.11@ucl.ac.uk.

Release files for mistree 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mistree 2.0.0
File Interpreter ABI Platform
mistree-2.0.0-py3-none-any.whl Python 3 none any Details

Release files / mistree-2.0.0-py3-none-any.whl

Download URL mistree-2.0.0-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00b5b136e15a123205f1737d25834dc751522058387337aa5324e773490912b2
BLAKE2b-256 checksum
How to use checksums
568435e875e9c13f7682698314f2ff86a716c24539160f3c0e72655a9c4d35d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.18

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file

1.2.2

2 release files

1.2.1

2 release files

1.2.0

3 release files

1.1.3

3 release files

1.1.2

2 release files

1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page