Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

astrosylva

astrosylva

PyPI version Python versions Documentation Status CI License: MIT

Carry merger trees from the forest to Galacticus.

A Python library and CLI that converts halo merger-tree catalogues into the Galacticus HDF5 input format.

Supports:

  • Consistent-Trees (Rockstar pipeline; forests.list + locations.dat + tree_*.dat)
  • LHaloTree (Millennium-style binary)
  • SubLink (IllustrisTNG-style HDF5)
  • AHF (Amiga Halo Finder MergerTree output)

This package is a Python port of the original C utility rockstar2galacticus. The legacy C sources are preserved at galacticusorg/rockstar2galacticus for reference; new development happens here in src/astrosylva/.

Install

pip install astrosylva

Or, from a checkout:

pip install -e ".[dev]"

Quickstart

astrosylva convert config.yaml

A minimal config:

reader:
  name: consistent_trees
  source:
    input_path: ./Illustris-3/tree/trees/
    forests_path: ./Illustris-3/tree/forests.list
    locations_path: ./Illustris-3/tree/locations.dat
  options:
    host_source: pid           # or "upid"
    scale_radius_source: rs    # or "rs_klypin"

writer:
  output_path: galacticus_illustris3.hdf5

metadata:
  cosmology:
    HubbleParam: 0.704
    Omega0: 0.2726
    OmegaLambda: 0.7274
    OmegaBaryon: 0.0456
    sigma_8: 0.809
  simulation:
    boxSize: 75000.0
    simulationCode: AREPO
    startRedshift: 127.0
  groupFinder:
    groupFinderCode: rockstar
    minimumParticleNumber: 10
  haloTrees:
    haloMassesIncludeSubhalos: 1
    forestsAreSelfContained: 1
    treesHaveSubhalos: 1
    velocitiesIncludeHubbleFlow: 0

Values that the reader can introspect from the input data (e.g. cosmological parameters from a Consistent-Trees header) override the metadata block; conflicts emit a MetadataConflictWarning showing both values.

CLI

Command What it does
astrosylva convert <config.yaml> Run the full conversion.
astrosylva readers List discovered readers (entry-point plugins).
astrosylva validate <config.yaml> Parse and validate the config without writing.

Implementation status

Reader Status Notes
Consistent-Trees Implemented Full port; column lookup is name-based.
AHF Experimental .AHF_halos + .AHF_mtree; union-find forests.
SubLink Experimental HDF5; multi-chunk, FOF host resolution.
LHaloTree Experimental Millennium binary; multi-chunk; some proxies.

The Galacticus writer emits formatVersion = 2, matching the legacy C tool's output layout byte-for-byte (group structure, dataset names, attribute names).

License

MIT — see LICENSE.

Contributing

Bug reports, feature requests, and pull requests welcome. See CONTRIBUTING.md for the dev-loop guide and CONTRIBUTORS.md for credits.

Metadata

Release files for astrosylva 0.1.0a2

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

Source distribution (sdist)

Source distribution for astrosylva 0.1.0a2
File Size Uploaded
astrosylva-0.1.0a2.tar.gz 58.2 kB Details

Built distribution (wheel)

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

Total release size: 96.0 kB

Release files / astrosylva-0.1.0a2.tar.gz

Download URL astrosylva-0.1.0a2.tar.gz
Size 58.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c5a399d12cbdfc262b220e06f14798252c4bc1f9f295de97f927d922f7f073be
BLAKE2b-256 checksum
How to use checksums
9407f7ab3fb89229b9472094072e8e9e645f69295ae467be9c4530f05b9f0e22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log

Release files / astrosylva-0.1.0a2-py3-none-any.whl

Download URL astrosylva-0.1.0a2-py3-none-any.whl
Size 37.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b87d4a514f3bb987bdc07646bcac44f5fa7ded60a6d9c03693f04af524e29209
BLAKE2b-256 checksum
How to use checksums
926424d105c030f7538c2cad4720dad3bdbab5864ff06b454231b5dc39b5855e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 19, 2026.

Transparency log
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