swift-emulator

swift-emulator: A Python package for emulation of simulated scaling relations - Published in JOSS (2022)

https://github.com/swiftsim/emulator

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    2 of 8 committers (25.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

machine-learning

Keywords from Contributors

astrophysics cosmology hdf5 particle sph mcmc
Last synced: 6 months ago · JSON representation

Repository

The SWIFT simulation cosmological emulator (swift-emulator)

Basic Info
  • Host: GitHub
  • Owner: SWIFTSIM
  • License: lgpl-3.0
  • Language: Python
  • Default Branch: main
  • Size: 978 KB
Statistics
  • Stars: 6
  • Watchers: 5
  • Forks: 3
  • Open Issues: 2
  • Releases: 1
Topics
machine-learning
Created about 5 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing License

README.md

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)

Owner

  • Name: SWIFT astrophysics simulation code and ecosystem of tools
  • Login: SWIFTSIM
  • Kind: organization
  • Location: Netherlands

SWIFT: SPH With Inter-dependent Fine-grained Tasking

JOSS Publication

swift-emulator: A Python package for emulation of simulated scaling relations
Published
April 12, 2022
Volume 7, Issue 72, Page 4240
Authors
Roi Kugel ORCID
Leiden Observatory, Leiden University, PO Box 9513, NL-2300 RA Leiden, The Netherlands
Josh Borrow ORCID
Department of Physics, Kavli Institute for Astrophysics and Space Research, Massachusetts Institute of Technology, Cambridge, MA 02139, USA
Editor
Dan Foreman-Mackey ORCID
Tags
astronomy Simulations Cosmology Machine Learning

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Issue comment event: 2
  • Push event: 1
  • Fork event: 1
Last Year
  • Release event: 1
  • Watch event: 1
  • Issue comment event: 2
  • Push event: 1
  • Fork event: 1

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 283
  • Total Committers: 8
  • Avg Commits per committer: 35.375
  • Development Distribution Score (DDS): 0.325
Past Year
  • Commits: 13
  • Committers: 2
  • Avg Commits per committer: 6.5
  • Development Distribution Score (DDS): 0.385
Top Committers
Name Email Commits
Josh Borrow j****w@d****k 191
Moyoxkit R****l@h****m 70
Matthieu Schaller s****r@s****l 9
robjmcgibbon r****n@g****m 5
Dan Foreman-Mackey d****m@d****o 3
Roi Kugel r****i@R****l 3
Arfon Smith a****n 1
Roi Kugel r****i@1****d 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 15
  • Total pull requests: 34
  • Average time to close issues: 5 months
  • Average time to close pull requests: 16 days
  • Total issue authors: 5
  • Total pull request authors: 6
  • Average comments per issue: 1.6
  • Average comments per pull request: 1.82
  • Merged pull requests: 33
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Moyoxkit (4)
  • MatthieuSchaller (3)
  • JDonaldM (3)
  • kstoreyf (3)
  • JBorrow (2)
Pull Request Authors
  • Moyoxkit (16)
  • JBorrow (13)
  • MatthieuSchaller (2)
  • dfm (2)
  • robjmcgibbon (2)
  • arfon (1)
Top Labels
Issue Labels
enhancement (3) documentation (1)
Pull Request Labels
enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 16 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 6
  • Total maintainers: 2
pypi.org: swiftemulator

Gaussian process emulator for creating synthetic model data across high dimensional parameter spaces, initially developed for use with the SWIFT simulation code.

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 16 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 21.6%
Stargazers count: 21.6%
Forks count: 22.7%
Average: 27.5%
Downloads: 61.5%
Maintainers (2)
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • recommonmark *
  • sphinx *
  • sphinx-rtd-theme *
requirements.txt pypi
  • SALib *
  • attrs *
  • black *
  • corner *
  • emcee *
  • george *
  • numpy *
  • pyDOE *
  • pytest *
  • pyyaml *
  • scikit-learn *
  • swiftsimio *
  • tqdm *
  • unyt *
  • velociraptor *
setup.py pypi
  • SALib *
  • attrs *
  • corner *
  • emcee *
  • george *
  • numpy *
  • pyDOE *
  • pyyaml *
  • scikit-learn *
  • tqdm *
  • unyt *
  • velociraptor *
.github/workflows/autoblack.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pytest.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/test_dependencies.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/setup-python v4 composite