semvec/pypi-packages huggingface dataset:
fusions 0.4.3
Diffusion meets sampling
Requires Python: <4.0,>=3.9

# fusions

[![tests](https://github.com/yallup/fusions/actions/workflows/tests.yml/badge.svg)](https://github.com/yallup/fusions/actions/workflows/tests.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI version](https://badge.fury.io/py/fusions.svg)](https://badge.fury.io/py/fusions)

Diffusion meets (nested) sampling

A miniminal implementation of diffusion models in JAX (Flax). Tuned for usage in building emulators for scientific models, particularly where MCMC sampling is tractable and used.


## Quickstart

Install `fusions` and `lsbi` from pypi
```
pip install lsbi fusions
```

create a 5D sampling problem then train a flow matched model to approximate the posterior

```python
from fusions.cfm import CFM
from lsbi.model import MixtureModel
from anesthetic import MCMCSamples
import matplotlib.pyplot as plt
import numpy as np


dims = 5
Model = MixtureModel(
    M=np.stack([np.eye(dims), -np.eye(dims)]),
    C=np.eye(dims)*0.1,
)

data = Model.evidence().rvs()

diffusion = CFM(Model.prior())
# diffusion = CFM(dims)

diffusion.train(Model.posterior(data).rvs(1000))

a = MCMCSamples(Model.posterior(data).rvs(500)).plot_2d(np.arange(dims))
MCMCSamples(diffusion.rvs(500)).plot_2d(a)
plt.show()
```
sdktestdistribution 1.0.2
Module for test Python sdk distribution

# CIQ Python SDK

This library provides functions to authenticate users, retrieve financial data, and fetch market data. It supports three main services: Authentication, Financial Services, and Market Data Services.

## Features

#### 1. Authentication Services:

- Authenticate users with username and password.
- Obtain access tokens for API calls.
- Support for using refresh tokens and proxy usage also.

#### 2. Financial Services:

- Retrieve point-in-time and historical income statements.
- Fetch current and historical balance sheet data.
- Access point-in-time and historical cash flow statements.
- Retrieve financial data based on specified mnemonics for specific metrics.

#### 3. Market Data Services:

- Fetch point-in-time and time-series pricing data for financial instruments.
- Obtain point-in-time and time-series dividend data.
- Retrieve point-in-time and time-series market metrics for specified identifiers.

#### 4. Proxy Support:

- Ability to use proxy objects for enhanced network communication.

#### 5. Data Format:

- Functions return data in the form of pandas DataFrames, facilitating easy data manipulation and analysis.

## Installation

- You can install the package using pip. Ensure you have Python 3.12+ installed.

```sh
pip install sdktestdistribution
```

## Basic Usage
Here's a brief example of how to use this package:

```sh
from IPython.core.display_functions import display
from Financials.services.impl.sdk_financial_services_impl import SDKFinancialServices
from MarketData.services.impl.sdk_marketdata_services_impl import SDKMarketDataServices
from Authentication.services.impl.sdk_authenticate_service_impl import SDKAuthenticateServices
from DataServices.model.sdk_proxy import SDKProxy

# Proxy (use SDKProxy from DataServices.model.sdk_proxy)
sdk_proxy_object = SDKProxy(proxy_username="", proxy_password="", proxy_host=None, proxy_port=None, proxy_domain="")

#Required Instances
auth_services = SDKAuthenticateServices()
financial_services = SDKFinancialServices()
marketdata_services = SDKMarketDataServices()
```
## Authentication
```sh
username = "--username--"    #Replace with actual username
password = "--password--"    #Replace with actual password
token_response = auth_services.get_token(username, password, proxy=sdk_proxy_object)
bearer_token = token_response.get("access_token")
```
## Fetching Financial Data
```sh
response = financial_services.get_income_statement_historical(token=bearer_token, identifiers=["aAPL:"],  properties={"periodType":"IQ_FQ-4","asOfDate":"12/31/2020"})
display(response.data)
```
## Fetching Market Data
```sh
response = marketdata_services.get_pricing_info_pit(token=bearer_token, identifiers=["aAPL:"],  properties= {"asOfDate": "12/31/2020",
                "currencyId": "USD",
                "currencyConversionModeId": "HISTORICAL"}, proxy=sdk_proxy_object)
display(response.data)
```