semvec/pypi-packages huggingface dataset:
ward-labels-upload 0.0.10
An internal package to allow for easy uploading of labels to the Ward Analytics API.
Keywords: Internal


# Ward Analytics Labels Upload Utility

This utility is used to upload labels to the Ward Analytics Database.

It is for internal use only.

## Installation

```bash
pip install ward-labels-upload
```

## Usage

### The Label Object

The `Label` object is used to represent a label. It has three fields:
- `address`: The address of the label.
- `label`: The label itself.
- `description`: A description of the label.

It also has a `is_address_case_sensitive` field, which defaults to `False`. This field is used to determine whether the address field should be treated as case sensitive or not. In most cases, this field should be left as `False` (For blockchains such as Ethereum, addresses are not case sensitive).

``` python
from ward_labels_upload import Label

label = Label(address="0x12eF3", label="label1", description="description1")
print(label)

>>> Label(address="0x12ef3", label="label1", description="description1", is_address_case_sensitive=False)
```

``` python
from ward_labels_upload import Label

label = Label(address="0x12eF3", label="label1", description="description1", is_address_case_sensitive=True)
print(label)

>>> Label(address="0x12eF3", label="label1", description="description1", is_address_case_sensitive=True)
```

### Label Upload

```python
from ward_labels_upload import Label, LabelUploader

uploader = LabelUploader(api_key="your_api_key")

labels = [
    Label(address="0x12ef3", label="label1", description="description1"),
    Label(address="0x45af6", label="label2", description="description2"),
    Label(address="0x78cs9", label="label3", description="description3"),
]

uploader.upload_labels(labels=labels)
```
The `LabelUploader` class also takes an optional `base_url` parameter. This is the base URL of the Ward Analytics API. It defaults to `https://api.wardanalytics.net`, which is the production API.

### Label Deletion

```python
from ward_labels_upload import Label, LabelUploader

uploader = LabelUploader(api_key="your_api_key")

labels = [
    Label(address="0x12ef3", label="label1"),
    Label(address="0x45af6", label="label2"),
    Label(address="0x78cs9", label="label3"),
]

uploader.delete_labels(labels=labels)
```
In the case of deletion, the description field is unnecessary. This happens because a label is uniquely identified by the combination of its address and label.

### Label Retrieval

```python
from ward_labels_upload import Label, LabelUploader

uploader = LabelUploader(api_key="your_api_key")

addresses = [
    "0x12ef3",
    "0x45af6",
    "0x78cs9",
]

labels = uploader.get_labels(addresses=addresses)
```
watroo 0.0.4
A trous wavelet transform and utilities
Requires Python: >=3.8

# WATROO

Implements the _à trous_ wavelet transform and associated tools: denoising, enhancement, etc.

# Contents

[Installation](#installation)\
[_A trous_ transform](#a-trous-transform)\
[Scaling functions](#scaling-functions)\
[WOW! (Wavelets Optimized Whitening)](#wow-wavelets-optimized-whitening)\
[References](#references)

## Installation

Within the active environment

```sh
pip install .
```

## _À trous_ transform

`ATrousTransform` implements a dyadic 'à-trous' transform

## Scaling functions

### Triangle

### B3 spline

## Examples

### Denoise an image 

```python
import numpy as np
from watroo import AtrousTransform, Triangle

denoise_sigma = [5, 3]
transform = AtrousTransform(Triangle)
img = np.random.normal(size=(512, 512))
coefficients = transform(img, len(denoise_sigma))
# coefficients.data is an ndarray that contains the coefficients proper
coefficients.denoise(denoise_sigma)
# coeffcients accepts numpy operations
denoised = np.sum(coefficients, axis=0)
# which is equivalent to
denoised = coefficients.data.sum(axis=0)
```

The same result cam be obtained using the *denoise* convenience function

```python
from watroo import Triangle, denoise

img = np.random.normal(size=(512, 512))
denoise_sigma = [5, 3]
denoised = denoise(img, denoise_sigma, Triangle)
```

### Extract significant coefficients at a given scale

```python
# return a ndarray containing the 3-sigma significance of coefficients
# at scale 2 with hard thresholding
s = coefficients.significance(3, 2, soft_threshold=False)
```

### Compute the standard deviation of Gaussian white noise

```python
# compute 10 scales of the 2D B3spline
w = B3spline(2)
w.compute_noise_weights(10)
```

This returns a 1-D `ndarray` containing the normalization
used to estimate the significance of coefficients.

## WOW! (Wavelets Optimized Whitening)

```python
from watroo import wow
# read in your image here (must be floating point)
# ...
```

Standard enhancement:

```python
wow_image, _ = wow(image)
```

'Bilateral' version, slower but better:

```python
    wow_image, _ = wow(image, bilateral=1)
```

Denoised bilateral enhancement (best results):

```python
wow_image, _ = wow(image, bilateral=1, denoise_coefficients=[5, 2])
```

## References

* Starck, J.-L. & Murtagh, F. 2002, Handbook of Astronomical Data Analysis, Springer-Verlag, doi:[10.1007/978-3-540-33025-7](https://doi.org/10.1007/978-3-540-33025-7)
* Auchère, F., Soubrié, E., Pelouze, G., Buchlin, É. 2022, Image Enhancement With Wavelets Optimized Whitening, A&A, 670, id.A66, doi:[10.1051/0004-6361/202245345](https://ui.adsabs.harvard.edu/link_gateway/2023A&A...670A..66A/doi:10.1051/0004-6361/202245345)