semvec/pypi-packages huggingface dataset:
best 2.0.5
Bayesian estimation supersedes the t-test
License: MIT
Requires Python: >=3.7

# BEST: Bayesian Estimation Supersedes the t-Test

Python implementation of a Bayesian model to replace t-tests with Bayesian estimation,
following the idea described in the following publication:

> John K. Kruschke. _Bayesian estimation supersedes the t test._
> Journal of Experimental Psychology: General, 2013, v.142 (2), pp. 573-603. (doi: 10.1037/a0029146) 

The package implements Bayesian estimation of the mean of one or two groups,
and plotting functions for the posterior distributions of variables such as the effect size,
group means and their difference.

## Documentation ##

See the documentation for more information, at [best.readthedocs.io](https://best.readthedocs.io).

## Requirements ##

 - Python ≧ 3.7
 - SciPy
 - [Matplotlib](http://matplotlib.org) (≧ 3.0.0) for plotting
 - [PyMC3](https://github.com/pymc-devs/pymc)

## Examples ##

A complete analysis and plotting is done in just a few lines:

```python
>>> best_out = best.analyze_two(group1_data, group2_data)
>>> fig = best.plot_all(best_out)
>>> fig.savefig('best_plots.pdf')
``` 
For example, the two-group analysis in `examples/smart_drug.py` produces the following output:

![smart_drug.png](examples/smart_drug.png)

More detailed analysis of the same data can be found in the Jupyter notebook `examples/Smart drug (comparison of two groups).ipynb`.

An example single-group analysis can be found in `examples/paired_samples.py`.

The [documentation](https://best.readthedocs.io) describes the API in detail.

## Installation ##

Ensure your Python version is sufficiently up-to-date (at least 3.7):

```bash
$ python --version
Python 3.7.12
```

Then install this package and its dependencies with PIP:
```bash
$ pip install best
```

## Developer notes ##

### Tests ###

Running the tests requires [pytest](https://docs.pytest.org/en/latest/index.html) (`pip install pytest`),
and then can be run with:

```bash
$ python -m pytest tests
```

The plotting tests only ensure that the `plot_all` function does not throw errors,
and the plots need manual verification at `tests/data/plot_all_*.pdf`.

### Documentation ###

The documentation can be built with Sphinx:

```bash
$ cd docs
$ make html
```
acurl-ng 0.1
An async Curl library.
License: MIT

# Acurl_NG (Next Generation)

Acurl_NG is a Cython refactoring/rewrite of an earlier iteration of the asynchronous curl wrapper concept, which was written in C for the mite project by Tony Simpson <agjasimpson@gmail.com>.
It is an asynchronous wrapper around [libcurl](https://curl.se/libcurl/) which is built to interface with the Uvloop python library.

## Using Acurl_NG In Mite

The current implementation of Acurl_NG is behind a feature toggle which defaults to using the old implementation of acurl. To switch over to using the new version of Acurl_NG within mite, the flag `MITE_CONF_enable_new_acurl_implementation="True"`

The gateway into Acurl_NG is through the CurlWrapper (discussed in [Architectural Notes](#Architectural-Notes)) and requires an event loop being passed to it's constructor. Below is the mite implementation of acurl, using the aforementioned flag to switch between versions of acurl:

```python
class SessionPool:
    ...
    def __init__(self, use_new_acurl_implementation=False):
        if use_new_acurl_implementation:
            import acurl_ng
            self._wrapper = acurl_ng.CurlWrapper(asyncio.get_event_loop())
        else:
            import acurl
            self._wrapper = acurl.EventLoop()
        ...
```

## Architectural Notes

In the old implementation of [acurl](../acurl) there was two loops in play, UVloop in python and a second loop called AE. This has now been reduced to a single loop maintained within python using UVloop.

Acurl_NG surfaces the CurlWrapper interface which takes the asyncio event loop as an argument. The wrapper deals directly with the curl_multi interface from libcurl, defining 2 functions (`curl_perform_write` and `curl_perform_read`) for checking both read and write availability of file descriptors.

There are 2 notable functions within the [core Acurl_NG implementation](./src/acurl.pyx), notably `handle_socket` and `start_timer`:

- `handle_socket` is passed as a callback function to the curl_multi interface and upon calls to the `curl_multi_socket_action` function, will receive updates regarding the socket status. We then handle those statuses by either adding or removing the aforementioned readers or writers.
- `start_timer` is another callback function that is passed to the curl_multi interface and is used as a way to handle timeouts and retries within curl. Upon a timeout, the timeout callback will be called and the transfer can be retried.