Skip to main content

pypi ci coverage Documentation Status arxiv license

paltas is a package for conducting simulation-based inference on strong gravitational lensing images. The package builds on lenstronomy to create large datasets of strong lensing images with realistic low-mass halos, Hubble Space Telescope (HST) observational effects, and galaxy light from HST’s COSMOS field. paltas also includes the capability to easily train neural posterior estimators of the parameters of the lensing system and to run hierarchical inference on test populations.

Installation

paltas is installable via pip:

$ pip install paltas

The default paltas requirements do not include tensorflow, but if you are interested in using the modules contained in the Analysis folder, you will have to install tensorflow:

$ pip install tensorflow

Usage

The main functionality of paltas is to generate realistic datasets of strong gravitational lenses in a way that’s modular, scalable, and user-friendly. To make a dataset with paltas all you need is a configuration file which you can then pass to the generate.py script:

$ python generate.py path/to/config/file path/to/output/folder --n 100

Running the line of code above would generate 100 lenses and output them in the specified folder. paltas comes preloaded with a number of configuration files which are described in Configs/Examples/README.rst. For example, to create a dataset with HST observational effects, subhalos, and line-of-sight halos run:

$ python generate.py Configs/Examples/config_all.py example --n 100

We provide a tutorial notebook that describes how to generate your own config file.

Demos

paltas comes with a tutorial notebook for users interested in modifying the simulation classes.

Figures

Code for generating the plots included in some of the publications using paltas can be found under the corresponding arxiv number in the notebooks/papers/ folder.

Contributing

We welcome improvements via GitHub pull request! The workflow for contributing to paltas is the same as it is for lenstronomy, please see the lenstronomy CONTRIBUTING guidelines. for the rundown.

In brief, to contribute to paltas you will need to fork the repo on GitHub, clone it, and pip install with editable option, like this:

$ git clone git@github.com:<your-account>/paltas.git
$ cd paltas
$ pip install -e .

You should then work in a local development branch, while keeping your main branch up to date with the base repo on GitHub. (That means you’ll need to git remote add base https://github.com/swagnercarena/paltas.git so that you can git pull base main from your main branch).

See the lenstronomy CONTRIBUTING guidelines. for help with python style, docstring formats, creating pull requests, and so on. We recommend that you start your pull request (PR) when you _begin_ work on a new feature or bug fix, so that the rest of the paltas community can see what you are doing and coordinate with you - when your improvement is ready you can request code review from others via the PR interface. Try and restrict PRs to one feature per branch, to help keep them small and manageable. (Note that paltas uses Google docstring style.)

Attribution

If you use paltas or its datasets for your own research, please cite the paltas package (Wagner-Carena et al. 2022) as well as the lenstronomy package (Birrer & Amara 2018, Birrer et al. 2021).

Zenodo Uploads

The following is a list of the zenodo uploads associated to papers using paltas. These uploads will include additional chains, test sets, and model weights required to reproduce the paper results.

https://zenodo.org/badge/DOI/10.5281/zenodo.6326743.svg

Metadata

Release files for paltas 0.2.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 paltas 0.2.0
File Size Uploaded Provenance Actions
paltas-0.2.0.tar.gz 79.5 kB Without provenance Details for paltas-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 184.6 kB

Release files / paltas-0.2.0.tar.gz

Download URL paltas-0.2.0.tar.gz
Size 79.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7add59a55f48803846a67b8a14e7df1ca623731e1da0cca65cacade97daaf930
BLAKE2b-256 checksum
How to use checksums
8de9c7a367bff5c4d28a644be79e70bb78eebcd950295edf82472157d5882060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / paltas-0.2.0-py3-none-any.whl

Download URL paltas-0.2.0-py3-none-any.whl
Size 105.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a2d5b416c5c2ba61359cd0b022aa334c76433a3ad7ebc881aa67ee86619e22b
BLAKE2b-256 checksum
How to use checksums
feae19f4a65c1f9c4ea9533786e273bc44b13a8a9fb39fc62edc94b07686f595
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for paltas 0.2.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.

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.

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