Skip to main content

planit

Tests Coverage License: GPL v3

The Planetary Impact Toolkit provides tools for accessing, manipulating, and analysing smoothed particle hydrodynamcis (SPH) impact simulation data, and creating planets for SPH impact simulations.

Philip J. Carter (p.carter@bristol.ac.uk)
Sarah T. Stewart (sstewa56@asu.edu)
Simon J. Lock (s.lock@bristol.ac.uk)

Overview

planit currently supports the SPH codes Gadget2-planetary, pkdgrav3, and SWIFT.

makeplanet provides functions for generating adiabatic 1D planet structures and converting these into (unequilibrated) SPH planets.
snaptools provides the Snapshot class for holding input and output files, calculating remnant masses, and vapor fractions.
impacttools provides the Impact class for loading and plotting snapshots produced by an impact simulation.
eos provides classes and functions for accessing and using equations of state.
plotting provides functions to assist with making plots.
utils provides additional utility functions for analysis.

Installation

planit is available in PyPI and can be installed with pip install planit.

Equations of State (EoS)

planit currently includes the following EoS:

They can be accessed using the names given above (as well as some variations) or using the corresponding SWIFT/WoMa or EOSLib ID number.
User supplied SESAME tables can also be loaded into one of five custom slots (see below).

Planet generation

planit.makeplanet differs from other planet creation code in that produces planets with isentropic layers, integrates outwards from the centre of the planet, and ensures the requested mass and component mass fractions are matched (within tolerance). The default behaviour prevents the unphyiscal scenario of a core cooler than the mantle at the core-mantle boundary.

Custom SESAME EoS tables

planit supports custom tables in the same SESAME-style layout used by its bundled ANEOS and 5-phase-water tables. A table directory must contain all of these files:

  • NEW-SESAME-STD.TXT
  • NEW-SESAME-STD-NOTENSION.TXT
  • NEW-SESAME-EXT.TXT

Use User0 through User4 to choose the corresponding reserved SWIFT/WoMa ID: User0 = 900, User1 = 901, User2 = 902, User3 = 903, and User4 = 904. The IDs can also be passed to select() in place of the slot names.

from planit import eos

table = eos.select(
    "User0",
    eosname="MyMaterial",
    eosdir="/path/to/my-sesame-table",  # trailing slash is optional
)

print(table.MODELNAME)  # MyMaterial
print(table.womaID)     # 900

# Use the loaded table in the usual way.
eos_passer = table.make_passer_class()
internal_energy = eos.tabinterp.from_rhoT("U", 1.0, 300.0, eos_passer)

The first load for a slot requires both eosname and eosdir. Subsequent eos.select("User0") calls return that slot's cached table. Passing both arguments again deliberately replaces the slot, but only after the new table has loaded successfully; a failed replacement raises an error and leaves the previous cached table available. Passing just one argument, or reading a slot that was never loaded, raises a clear ValueError instead of returning an uninitialised table.

The loader validates the directory and file names, but it does not validate the physical quality or full internal consistency of a table. NEW-SESAME-EXT.TXT is required, so a minimal standard SESAME 201/301 file alone is not sufficient. Custom tables are cached only in the current Python process, and there are only five simultaneous custom slots.

Metadata

Release files for planit 1.3.0

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

Source distribution (sdist)

Source distribution for planit 1.3.0
File Size Uploaded Provenance Actions
planit-1.3.0.tar.gz 75.4 MB With provenance Details for planit-1.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 150.8 MB

Release files / planit-1.3.0.tar.gz

Download URL planit-1.3.0.tar.gz
Size 75.4 MB
Tags Source
SHA-256 checksum
How to use checksums
e3356bb65250f73d195dc22b6f6de2caa0d07cf5726100da58c8c988e28607fc
BLAKE2b-256 checksum
How to use checksums
4d3f76149eb981f0dbbe977283b7a26749b3fa4d39eac21e50cefdc28fbdc841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Release files / planit-1.3.0-py3-none-any.whl

Download URL planit-1.3.0-py3-none-any.whl
Size 75.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c1c8440b00e35e0834ca1bf53a3a15f5e0e0d5bc84f6d00c716b8a586c7a5507
BLAKE2b-256 checksum
How to use checksums
eda4794dae34c86fd7a87e0d1fff27c48bdf9be2585295175ddf8bf1d9e359ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Security for planit 1.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for planit-1.3.0.tar.gz

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 Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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