Skip to main content

SWIFT-Emulator

Documentation Status Test Status PyPI version status

The SWIFT-emulator (henceforth 'the emulator') was initially designed for SWIFT outputs, and includes utilities to read and write SWIFT data.

The emulator can be used used to predict outputs of simulations without having to run them, by employing Gaussian Process Regression with george and sensitivity analysis with SALib.

Dcumentation is available at ReadTheDocs.

Predicting Simulations

The emulator can predict a given scaling relation (the relationship between two output variables in a simulation, for instance the masses of galaxies and their size) when varying the underlying physical model simulated in a continuous way.

As an example from cosmological simulations, imagine varing the energy that supernovae release when they explode as a parameter x. This affects both the sizes and masses of galaxies. The emulator, using a few 'base' simulations, performed with the real code, at various values of x spaced evenly throughout the viable region, can predict what the shape of the relationship between mass and size would be at other values of x, given that it has been trained on the base simulation outputs.

Why SWIFT Emulator?

The emulator works at a much higher level than other Gaussian Process Regression libraries, such as george (which it is built on).

Working with base machine learning libraries can be tricky, as it typically requries knowledge of how to structure input arrays in a specific way (both for training and prediction). They also rarely also include model design routines. Additionally, validation and visualisation routines are typically missing.

The SWIFT Emulator package provides a one-stop solution, with a consistent API, for developing a model design, running it (if using SWIFT), reading in data ( again if using SWIFT), building an emulation model, validating said model, comparing the model against ground-truth data across parameter space (e.g. observations), and visualising the results.

Installation

The package can be installed easily from PyPI under the name swiftemulator, so:

pip3 install swiftemulator

This will install all necessary dependencies.

The package can be installed from source, by cloning the repository and then using pip install -e . for development purposes.

Requirements

The package requires a number of numerical and experimental design packages. These have been tested (and are continuously tested) using GitHub actions CI to use the latest versions available on PyPI. See requirements.txt for details for the packages required to develop SWIFT-Emulator. The packages will be installed automatically by pip when installing from PyPI.

Authors

  • Roi Kugel (@Moyoxkit)
  • Josh Borrow (@jborrow)

Release files for swiftemulator 1.3.1

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

Source distribution (sdist)

Source distribution for swiftemulator 1.3.1
File Size Uploaded
swiftemulator-1.3.1.tar.gz 55.9 kB Details

Built distribution (wheel)

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

Total release size: 129.9 kB

Release files / swiftemulator-1.3.1.tar.gz

Download URL swiftemulator-1.3.1.tar.gz
Size 55.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0be37fdc156ace7f24356f1fdb88666dda8d067d82df60e2b488c65331a2dc6d
BLAKE2b-256 checksum
How to use checksums
aeae6976fc10c9c7d10efd5ad49139ce96e8d2fc7bc87cc594ee904d3d780c4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.22

Release files / swiftemulator-1.3.1-py3-none-any.whl

Download URL swiftemulator-1.3.1-py3-none-any.whl
Size 73.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ef0465847377bfa3bf2f33e93e31ec2dc146f832aff3c31438bc6f2c0ff3eb7
BLAKE2b-256 checksum
How to use checksums
29c589645e19849334245a191ba0c8084bc5ed0cd76f9b53213d672e308316ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.4.22

Release history Release notifications | RSS feed

This release

1.3.1 This release

2 release files

1.3.0

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.0.0

1 release file

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