semvec/pypi-packages huggingface dataset:
EffectiveHalos 1.1.0
Combining the Halo Model and Perturbation Theory: A 1% Accurate Model to k = 1 h/Mpc

# EffectiveHalos
EffectiveHalos is a fast Python code providing models of the real-space matter power spectrum, based a combination of the Halo Model and Effective Field Theory, which are 1\% accurate up to k = 1 h/Mpc, across a range of cosmologies, including those with massive neutrinos. It can additionally compute accurate halo count covariances (including a model of halo exclusion), both alone and in combination with the matter power spectrum.

This is based on the work of [Philcox, Spergel \& Villaescusa-Navarro (2020)](https://arxiv.org/abs/2004.09515), and full documentation is availble on [ReadTheDocs](https://EffectiveHalos.rtfd.io).

## Authors
**Main Authors**
- Oliver Philcox (Princeton)

**Collaborators**
- David Spergel (Princeton / CCA)
- Francisco Villaescusa-Navarro (Princeton / CCA)

## Installation

EffectiveHalos can be simply installed using pip:

```
pip install EffectiveHalos (--user)
```

Note that you will need a [CLASS](https://github.com/lesgourg/class_public) installation, including the 'classy' Python wrapper, to run EffectiveHalos.


## Basic Usage

To compute a matter power spectrum in EffectiveHalos, simply run the following:

```python
from EffectiveHalos import *
import numpy as np

## Parameters
z = 0. # redshift
cs2 = 8. # effective speed of sound (should be calibrated from simulations)
R = 1. # smoothing scale (should be calibrated from simulations)
k = np.arange(0.01, 1., 0.005) # wavenumbers in h/Mpc

## Load general classes
cosmology = Cosmology(z, 'Planck18') # use Planck 2018 cosmology
mass_function = MassFunction(cosmology, 'Bhattacharya') # Bhattacharya 2010 mass function
halo_physics = HaloPhysics(cosmology, mass_function, 'Duffy', 'NFW') # Duffy 08 concentration relation, NFW halo profiles

## Load HaloModel class
halo_model = HaloModel(cosmology, mass_function, halo_physics, k)

## Compute the power spectrum in both Effective and Standard Halo Models
power_spectrum_EHM = halo_model.halo_model(cs2, R)
power_spectrum_SHM = halo_model.halo_model(cs2, R, 'Linear', 0, 0, 0)
```

This generates an estimate for the matter power spectrum in a few seconds. Let's plot this:

![alt text](https://github.com/oliverphilcox/EffectiveHalos/blob/master/docs/ehm_tutorial_spec.png "Effective Halo Model Power Spectrum")

A full tutorial can be found [here](https://effectivehalos.readthedocs.io/en/latest/Tutorial.html).

***New for version 1.1:*** Accurate models for the power spectrum in massive neutrino cosmologies.
awesomedict 0.1.1
No more KeyError! Set default values and filter via regex

# INTRODUCTION

A magic dictionary which never raises KeyError but creates non-existent
items as they are requested. By default newly created items in this way are
an empty instance of `AwesomeDict`, but that can be set with `set_defaults`.
The instances also have a `filter` method which can filter based on
a regular expression matched against the key or value. A default regex for
filter can be set with `set_filter`.

# INSTALLATION

`pip install awesomedict`

# EXAMPLE USAGE

```python
from awesomedict import AwesomeDict
import json

# create a default order
mdorder = AwesomeDict().set_defaults(
    {
        '^price$': 0,
        '_address$': 'No such street, PO 000'
    }).set_defaults({'^items$': []}, do_copy=True)
mdorder['items']
mdorder['price']
mdorder['shipping_address']
mdorder['billing_address']

md = AwesomeDict().set_defaults(
    {'^[0-9]+$': mdorder}, do_copy=True).set_filter('^!')
md['customers']['foo'][1]['price'] = 15
md['customers']['foo'][1]['items'].append('notebook')
md['customers']['foo'][1]['shipping_address'] = 'FOO street'
md['customers']['foo'][1]['billing_address'] = 'FOO office'
md['customers']['foo'][1]['!notes'] = 'important notes'
md['customers']['foo'][2]  # use all defaults
md['customers']['!important customer'][1]['price'] = 25  # use default address
md['customers']['!important customer'][1]['items'].append('pen')
print(json.dumps(md, default=lambda o: o.data, indent=2))
print('\n-----important only:-----\n')
print(json.dumps(md.filter(), default=lambda o: o.data, indent=2))
print('\n-----items only:-----\n')
print(json.dumps(md.filter('^items$'), default=lambda o: o.data, indent=2))
```

```
$ python demo.py
{
  "customers": {
    "foo": {
      "1": {
        "items": [
          "notebook"
        ],
        "price": 15,
        "shipping_address": "FOO street",
        "billing_address": "FOO office",
        "!notes": "important notes"
      },
      "2": {
        "items": [],
        "price": 0,
        "shipping_address": "No such street, PO 000",
        "billing_address": "No such street, PO 000"
      }
    },
    "!important customer": {
      "1": {
        "items": [
          "pen"
        ],
        "price": 25,
        "shipping_address": "No such street, PO 000",
        "billing_address": "No such street, PO 000"
      }
    }
  }
}

-----important only:-----

{
  "customers": {
    "foo": {
      "1": {
        "!notes": "important notes"
      }
    },
    "!important customer": {
      "1": {
        "items": [
          "pen"
        ],
        "price": 25,
        "shipping_address": "No such street, PO 000",
        "billing_address": "No such street, PO 000"
      }
    }
  }
}

-----items only:-----

{
  "customers": {
    "foo": {
      "1": {
        "items": [
          "notebook"
        ]
      },
      "2": {
        "items": []
      }
    },
    "!important customer": {
      "1": {
        "items": [
          "pen"
        ]
      }
    }
  }
}
```
CoralPay 0.0.1
CoralPay python libary
Requires Python: >=3.6

# Example Package

CoralPay Python SDK for PGP Encryption on CoralPay's C'Gate
============================================================

This is the Python SDK for integrating with CoralPay's Cgate USSD payment gateway. 
It handles the encryption of the requests to C'Gate and the decryption of the response from C'Gate.  

It uses the imported C'Gate public PGP key for the encryption and it uses your private PGP key and Passphrase for Decrypting the responses from C'Gate.  

This SDK has a hard dependency on GnuPG and runs on Windows and Unix-based machines.


----------  


Get code running
-------------

Make sure you have python3 installed on the machine.


**Steps**

1. install Gnupg
2. pip install pretty_bad_protocol
3. generate the your public and private key https://www.igolder.com/pgp/generate-key/
4. gpg --import coralpay.public.txt
5. gpg --import your_privatekey.txt




#### Using the methods
```
message = {
        "RequestHeader": {
            "Username": "****",
            "Password": "******"},
        "RequestDetails": {
            "TerminalId": "*****",
            "Channel": "USSD",
            "Amount": 50.0,
            "MerchantId": "*****",
            "TransactionType": "0",
            "SubMerchantName": "******",
            "TraceID": ""
        }
    }

    # Initiate
    gpg = CoralPay(homedir='/Users/oluwasemilore/.gnupg',
                   key_id="CORALPAY_FINGERPRINT")
    data = gpg.coral_encrypt(message, hex=True)
    URL = "CORALPAY_ENDPOINT"
    res = gpg.call_coray_pay(URL, data)

```

#### Using SDK Decrypt Method
```python
data = "85010C0363B256F42F0382020108009EA68E0FECCA50539E34D51ED22232D2C3CD16E7C70CBD928A09EF7FFEE928E47BFC4455E3C83FF7B8BE533A88BAB554246B75C1C94C22073B2EBA392C187F9DEC4B3B10DB9C0272C9969DE96B3E0D6EA70919B80843491E99BEC2D7033FE53DB471838CF3D01FFEBA2F9F12102049C63F1F168BCE7E69C406ED56957841F41102738314A3F23191A768A53CA1DF6A3A063F5E8DE38E1733F4965C028A309242E0391DEB0B27AF79E170E0161D2A405D82BEDDB93A4885C181C4C298F1505F0232A1403EA3BE61009DEB65F6B777778BC238871B196A3BC21033EF0D59BF5EA899379C66D3F39CA93694D26F275090F642F71DFD4D4A8C4C5B2E926220D6BC15C9A3587B91FD054705D4AA026054DDF66923EAB1233C68DE15F97B26E6B0933DB4067B34EA510E22AF25E6FDF78CCEDB99E0785D3A90523948C671687889034F6DCE18809C3683004039DFAB19EFF02CAA6A3AF19AA81F2FB8BAD54D33441904A7CED65D73ACE83F4CB869ABC6534A6949C1962F70046F399EAA1A2209A58921BAD5F86F0BFE5638722BA081462C74E9B1F34D4485A474595D1B62F8E35D0DA2BD4719895D"


gpg = CoralPay(homedir='/Users/oluwasemilore/.gnupg',
                   key_id="CORALPAY_FINGERPRINT")
coral_response = gpg.coral_decrypt(
        res, passphrase="the-passphrase-for-your-private-key-here", always_trust=True, hex=True)
    print(coral_response)
```