Skip to main content
Pre-release

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

OpenCosmo


CI PyPI - Version Conda Version GitHub License

The OpenCosmo Python Toolkit provides utilities for reading, writing and manipulating data from cosmological simulations produced by the Cosmolgical Physics and Advanced Computing (CPAC) group at Argonne National Laboratory. It can be used to work with smaller quantities data retrieved with the CosmoExplorer, as well as the much larget datasets these queries draw from. The OpenCosmo toolkit integrates with standard tools such as AstroPy, and allows you to manipulate data in a fully-consistent cosmological context.

Installation

The OpenCosmo library is available for Python 3.12 and up on Linux and MacOS (and Windows via WSL). It can be installed easily with pip:

pip install opencosmo

There's a good chance the default version of Python on your system is less than 3.12. Whether or not this is the case, we recommend installing opencosmo into a virtual environment. If you're using Conda, you can create a new environment and install opencosmo into it automatically:

conda create -n opencosmo_env conda-forge::opencosmo
conda activate opencosmo_env

or if you already have a virtual environment to use:

conda install conda-forge::opencosmo

If you plan to use opencosmo in a Jupyter notebook, you can install the ipykernel package to make the environment available as a kernel:

pip install ipykernel # can also be installed with conda
python -m ipykernel install --user --name=opencosmo

Be sure you have run the "activate" command shown above before running the ipykernel command.

Getting Started

To get started, download the "haloproperites.hdf5" from the OpenCosmo Google Drive. This file contains properties of dark-matter halos from a small hydrodynamical simulation run with HACC. You can easily open the data with the open command:

import opencosmo as oc

dataset = oc.open("haloproperties.hdf5")
print(dataset)
OpenCosmo Dataset (length=237441)
Cosmology: FlatLambdaCDM(name=None, H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.3096446816186967, Tcmb0=<Quantity 0. K>, Neff=3.04, m_nu=None, Ob0=0.04897468161869667)
First 10 rows:
block fof_halo_1D_vel_disp fof_halo_center_x ... sod_halo_sfr unique_tag
             km / s               Mpc        ... solMass / yr
int32       float32             float32      ...   float32      int64
----- -------------------- ----------------- ... ------------ ----------
    0            32.088795         1.4680439 ...       -101.0      21674
    0             41.14525        0.19616994 ...       -101.0      44144
    0             73.82962         1.5071135 ...    3.1447952      48226
    0             31.17231         0.7526525 ...       -101.0      58472
    0            23.038841         5.3246417 ...       -101.0      60550
    0            37.071426         0.5153746 ...       -101.0     537760
    0            26.203058         2.1734374 ...       -101.0     542858
    0              78.7636         2.1477687 ...          0.0     548994
    0             37.12636         6.9660196 ...       -101.0     571540
    0             58.09235          6.072006 ...    1.5439711     576648

The open function returns a Dataset object, which can retrieve the relevant data from disk with a simple method call. It also holds metadata about the simulation, such as the comsology. You can easily access the data and cosmology as Astropy objects:

dataset.get_data()
dataset.cosmology

The first will return an astropy table of the data, with all associated units already applied. The second will return the astropy cosmology object that represents the cosmology the simulation was run with.

Basic Querying

Although you can access data directly, opencosmo provides tools for querying and transforming the data in a fully cosmology-aware context. For example, suppose we wanted to plot the concentration-mass relationship for the halos in our simulation above a certain mass. One way to perform this would be as follows:

dataset = dataset
    .filter(oc.col("fof_halo_mass") > 1e13)
    .take(1000, at="random")
    .select(("fof_halo_mass", "sod_halo_cdelta"))

print(dataset)
OpenCosmo Dataset (length=1000)
Cosmology: FlatLambdaCDM(name=None, H0=<Quantity 67.66 km / (Mpc s)>, Om0=0.3096446816186967, Tcmb0=<Quantity 0. K>, Neff=3.04, m_nu=None, Ob0=0.04897468161869667)
First 10 rows:
 fof_halo_mass   sod_halo_cdelta
    solMass
    float32          float32
---------------- ---------------
11220446000000.0       4.5797048
17266723000000.0       7.4097505
51242150000000.0       1.8738283
70097712000000.0       4.2764015
51028305000000.0        2.678151
11960567000000.0       3.9594727
15276915000000.0        5.793542
16002001000000.0       2.4318497
47030307000000.0       3.7146702
15839942000000.0        3.245569

We could then plot the data, or perform further transformations. This is cool on its own, but the real power of opencosmo comes from its ability to work with different data types. Go ahead and download the "haloparticles" file from the OpenCosmo Google Drive and try the following:

import opencosmo as oc

data = oc.open("haloproperties.hdf5", "haloparticles.hdf5")

This will return a data collection that will allow you to query and transform the data as before, but will associate the halos with their particles.

data = data
    .filter(oc.col("fof_halo_mass") > 1e13)
    .take(1000, at="random")

for halo in data.halos():
    halo_properties = halo["halo_properties"]
    dm_particles = halo["dm_particles"]
    star_particles = halo["star_particles"]

In each iteration, "halo properties" will be a dictionary containing the properties of the halo (such as its total mass), while "dm_particles" and "star_particles" will be OpenCosmo datasets containing the dark matter and stars associated with the halo, respectively. Because these are just like the dataset object we saw eariler, we can further query and transform the particles as needed for our analysis. For more details on how to use the library, check out the full documentation.

Testing

To run tests, first download the test data from Google Drive. Extract it into test_data/ at the repository root, or set OPENCOSMO_DATA_PATH to an extracted data directory elsewhere. See test/TEST_DATA.md for the expected layout. Then run the tests with pytest:

export OPENCOSMO_DATA_PATH=/path/to/data
# From the repository root
pytest --ignore test/parallel 

Although opencosmo does support multi-core processing via MPI, the default installation does not include the necessary dependencies to work in an MPI environment. If you need these capabilities, check out the guide in our documentation.

Contributing

We welcome bug reports and feature requests from the community. If you would like to contribute to the project, please check out the contributing guide for more information.

Citation

If you use OpenCosmo in your work, please cite the release paper in any publications:

@article{wells2026_opencosmo,
      title={OpenCosmo: Community Portal and Analysis Framework for Flagship Cosmological Simulations}, 
      author={Patrick R. Wells and Michael Buelhmann and Patricia Larsen and William M. Hicks and Manpreet Dhillon and Idunnuoluwa A. Adeniji and Katrin Heitmann and Salman Habib and Benoit Côté and Thomas Uram and Gideon McFarland and Andrew Hearin and Ezar Shinabro and Michael E. Papka},
      year={2026},
      eprint={2607.16059},
      archivePrefix={arXiv},
      primaryClass={astro-ph.IM},
      url={https://arxiv.org/abs/2607.16059}, 
}

Metadata

Release files for opencosmo 1.5.0b1

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

Built distributions (wheels)

Table of built distributions (wheels) for opencosmo 1.5.0b1
File Actions
opencosmo-1.5.0b1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details for opencosmo-1.5.0b1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
opencosmo-1.5.0b1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ ARM64 Details for opencosmo-1.5.0b1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
opencosmo-1.5.0b1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for opencosmo-1.5.0b1-cp314-cp314-macosx_11_0_arm64.whl
opencosmo-1.5.0b1-cp314-cp314-macosx_10_12_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.12+ x86-64 Details for opencosmo-1.5.0b1-cp314-cp314-macosx_10_12_x86_64.whl
opencosmo-1.5.0b1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for opencosmo-1.5.0b1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
opencosmo-1.5.0b1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details for opencosmo-1.5.0b1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
opencosmo-1.5.0b1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for opencosmo-1.5.0b1-cp313-cp313-macosx_11_0_arm64.whl
opencosmo-1.5.0b1-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details for opencosmo-1.5.0b1-cp313-cp313-macosx_10_12_x86_64.whl
opencosmo-1.5.0b1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for opencosmo-1.5.0b1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
opencosmo-1.5.0b1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details for opencosmo-1.5.0b1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
opencosmo-1.5.0b1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for opencosmo-1.5.0b1-cp312-cp312-macosx_11_0_arm64.whl
opencosmo-1.5.0b1-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for opencosmo-1.5.0b1-cp312-cp312-macosx_10_12_x86_64.whl

Total release size: 9.7 MB

Release files / opencosmo-1.5.0b1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL opencosmo-1.5.0b1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 837.5 kB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e3ce001c25423fe2d8d57b5765ae29b6884efab2a5a67a1e820b1b050f0d426d
BLAKE2b-256 checksum
How to use checksums
bfc8b3b49fe4d02155576a2828de2c70cbe879529899b550cac0fe74120f773a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL opencosmo-1.5.0b1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 824.4 kB
Tags CPython 3.14 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
50a2bbb0e7e2c2cd66d3e2397531a94b670f9e62d20a1aff6734128e8edd1716
BLAKE2b-256 checksum
How to use checksums
b01bb6360a8860bac230e7fff971eb7dd90a68e62f5a55831f3f82d52734ceb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp314-cp314-macosx_11_0_arm64.whl

Download URL opencosmo-1.5.0b1-cp314-cp314-macosx_11_0_arm64.whl
Size 780.8 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
052766b50a491680e3f6fd9b342131c5e1fcfd310c175cdcf28190dd4e3f7a8e
BLAKE2b-256 checksum
How to use checksums
9b4b9b8fe74a7534260231c838be42ca84bb22f3499da45b101f3212283c150e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp314-cp314-macosx_10_12_x86_64.whl

Download URL opencosmo-1.5.0b1-cp314-cp314-macosx_10_12_x86_64.whl
Size 796.3 kB
Tags CPython 3.14 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
5b998c09f68759fc4e86d339bee279ba613212ba967ff535db1ac444fd1110bf
BLAKE2b-256 checksum
How to use checksums
23d5b0abe3a45798223f41de675f43aa555f4c9d223b5c84d187fcee9cb02725
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL opencosmo-1.5.0b1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 835.7 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4947b35a44b6ce8bca67f4b59452cba74b5f81d7a4c2ba2c97f68e74cc7d97cd
BLAKE2b-256 checksum
How to use checksums
817b9090466bfe8916a8d332e11cbac8aa5b7f6369c9d120de6e80c3938a08ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL opencosmo-1.5.0b1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 822.0 kB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
c6be3546c220b2ef1433a4f397f10fb4037db3bb136be2f2271468de7a821d83
BLAKE2b-256 checksum
How to use checksums
294b67e7f5ba74d7622ca6b018b482236ddac372162f3ddecddef7d1a8763ecd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp313-cp313-macosx_11_0_arm64.whl

Download URL opencosmo-1.5.0b1-cp313-cp313-macosx_11_0_arm64.whl
Size 777.2 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
89d391c707156235f3b8ffd50ad071c3a2298548d6985a7a0693ba97d4b3b44a
BLAKE2b-256 checksum
How to use checksums
921af5397f511d7a29da0aa4e85ef4fc04e654fd23b2f24a68504fe53dcd48a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp313-cp313-macosx_10_12_x86_64.whl

Download URL opencosmo-1.5.0b1-cp313-cp313-macosx_10_12_x86_64.whl
Size 793.1 kB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ce6c55b907fa296817ae797b781e84152e17ab4efc070ce4b3694680459a3785
BLAKE2b-256 checksum
How to use checksums
3ecd2c69bf5d15ddcc68c9c45ddb34f428d8e1a3ad56e52b3eb9b717ac56784b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL opencosmo-1.5.0b1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 835.5 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
5e0d724a7755be29df0d2cfce836c3c5455cb968ec21519b5f9ae93508ca0560
BLAKE2b-256 checksum
How to use checksums
27cb5d0221586d9f9f27fa54b2c8fa041b814ff4d0c0e8422cba4e96a6910d7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL opencosmo-1.5.0b1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 821.3 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
c390967dcc38959c1c80d272e3adb278ce767198c98e0a7ef72c02e1c9195986
BLAKE2b-256 checksum
How to use checksums
670cf8b6db1174e2c016d2b9976151ba8a6db5da1b3ae9463eeb8ee8a703bb34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp312-cp312-macosx_11_0_arm64.whl

Download URL opencosmo-1.5.0b1-cp312-cp312-macosx_11_0_arm64.whl
Size 778.2 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
75db288594084c5d32f865cf1a4940daeb81adce6d87f8a208b83b8049609a68
BLAKE2b-256 checksum
How to use checksums
b2d990f56d23cc59e6593075f68f122b14c25ac08ebbe54dc1e0d2a15c24261d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / opencosmo-1.5.0b1-cp312-cp312-macosx_10_12_x86_64.whl

Download URL opencosmo-1.5.0b1-cp312-cp312-macosx_10_12_x86_64.whl
Size 792.1 kB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
71d3cb953673275df8d22397535f650b79cec96c1cb3cb0777fe47d108dcc80d
BLAKE2b-256 checksum
How to use checksums
ae46fd71139504f1f9b475041673052f44bc79ad4aaa174eb3c297b8ccd68a7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for opencosmo 1.5.0b1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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