semvec/pypi-packages huggingface dataset:
faster-fishers 0.1.1
Rust version of Scipy's Fisher exact test.
License: MIT

# faster_fishers
Fast implementation of Fisher's exact test in Rust for Python.  
Benchmarks show that this version is about 20x faster than scipy's version when running on a large range of inputs and about 10x faster when running on 1 input:

```asm
--------------------------------------------------------------------------------------------- benchmark: 2 tests ---------------------------------------------------------------------------------------------
Name (time in ms)                        Min                   Max                  Mean             StdDev                Median                IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_faster_fischer       114.5763 (1.0)        119.2121 (1.0)        116.1288 (1.0)       1.6386 (1.0)        115.5922 (1.0)       1.6018 (1.0)           2;1  8.6111 (1.0)           9           1
test_benchmark_scipy              2,403.8024 (20.98)    2,458.8598 (20.63)    2,423.2871 (20.87)    21.4687 (13.10)    2,415.6504 (20.90)    24.6082 (15.36)         1;0  0.4127 (0.05)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
```

## Usage:
```python
>>> import numpy as np
>>> import faster_fishers
>>> lefts, right, two_tails = faster_fishers.exact(np.array([1, 3]), np.array([2, 5]), np.array([1, 4]), np.array([5, 50]))
>>> lefts
array([0.9166666666666647, 0.9963034765672586])
>>> rights
array([0.5833333333333326, 0.03970749246529451])
>>> two_tails
array([1.0, 0.03970749246529451])
```

## Developing

### Building with cargo
* Run `cargo build` in the main directory to build the project.

### Publishing on pypi
`docker run --rm -v $(pwd):/io ghcr.io/pyo3/maturin publish -u {USER} -p {PASSWORD}`

### Using locally
* Install environment: `poetry install`  
* Add environment to current shell `poetry shell`  
* Install faster_fishers in current environment: `maturin develop`  
* Check that it works: `python -c "import faster_fishers; print(dir(faster_fishers))"`  

To try the library in a different environment:  
    1. `maturin build --release`  
    2. `cd folder`  
    3. `pip install {wheel_path}.whl`  


### Benchmarks
* Make sure to compile in release mode with maturin first: `maturin develop --release`
*python: `pytest --benchmark-warmup -m benchmark`
pyjpgclipboard 1.0.3
Server to run ytclip.
License: MIT
Requires Python: >=3.6.0

# pyjpgclipboard

## Platform Unit Tests

[![Actions Status](https://github.com/zackees/pyjpgclipboard/workflows/MacOS_Tests/badge.svg)](https://github.com/zackees/pyjpgclipboard/actions/workflows/test_macos.yml)
[![Actions Status](https://github.com/zackees/pyjpgclipboard/workflows/Win_Tests/badge.svg)](https://github.com/zackees/pyjpgclipboard/actions/workflows/test_win.yml)
[![Actions Status](https://github.com/zackees/pyjpgclipboard/workflows/Ubuntu_Tests/badge.svg)](https://github.com/zackees/pyjpgclipboard/actions/workflows/test_ubuntu.yml)



## Brief

Cross platform clipboard for handling copy/paste jpg in python

This libray is meant to do only one thing and one thing well: copy jpg's to and from the
system clipboard.

## Install

```
python -m pip install pyjpgclipboard
```

### Ubuntu/Linux

The ubuntu lib uses `xclip`

```
sudo apt-get install xclip
```

If you are running in a headless display you'll need a dummy x-server running to use xclip. Please install it using this:

```
export DISPLAY=:0
sudo Xvfb -ac :0 -screen 0 1280x1024x24 > /dev/null 2>&1 &
```


## Api

```
from pyjpgclipboard import clipboard_dump_jpg, clipboard_load_jpg

clipboard_load_jpg("myfile.jpg") # Clipboard now has jpg image
clipboard_dump_jpg("myfile2.jpg) # Clipboard image contents dumped to disk.
```

## Testing

Make sure that `tox` is installed on your system and run it at the root directory of this project.


## Will pyjpgclipboard support more features?

Probably not. Unless it's *really* important.

We only support jpg images (and not any other formats or text) because manipulating the system
clipboard across different platforms is *hard*. As of the creation of this repo there really
isn't any library that allows users to copy / paste jpegs. There are a lot of libraries that
allow cross platform posting of text and binary data. So this library is intended to fill in that
gap. Libraries like `pyclip` should, in the future, use `pyjpgclipboard` to handle the missing jpg
clipboard manipulation.

## What motivatated this library?

Selenium webdriver tests has a missing feature of taking an image and pasting it through it's
api. 

This is a problem if you are running a selenium test and you need to be able to test pasting
an image as part of your test suite (hence the motivation to create this library).

## Footguns

There is only one system clipboard. So running this library in different threads/processes will
result in collisions. It's up to the application running this library to provide any necessary
locking mechanism.

## Versions

  * 1.0.3: Ubuntu implemented and tested to work on headless display
  * 1.0.2: Now installs on linux. Before it would error. But not all codepaths that include this library will actually use it.
  * 1.0.1: Bug fix
  * 1.0.0: Release.