semvec/pypi-packages huggingface dataset:
np-alias 0.1
Just import np
Requires Python: >=2.7, <4
Keywords: pyplot,matplotlib

# plt-alias
No more `import numpy as np`!
<br/>just `import np` and that's it.
<br/>This package is just a simple alias.

## Installation 
$`pip install np-alias`

## Usage
```python
import np  # this is an alias to "import matplotlib.pyplot as plt"
np.arange(100)
```
run-torch-model 1.0.2
Package for training and evaluating neural network models made using pytorch
Requires Python: >=3.6

# run-torch-model
Simple program to run a pytorch compatible model. Includes a tools function which has support for creating dataloader objects required for training/testing/validation.

# Requirements
- torch
- torchmetrics
- scikit-learn

# Install 
Install using pip:
```
pip install run-torch-model
```

# Usage
Use create_dataloader to initiate datasets for training and testing:
```
from run_torch_model import create_dataloader

dataloader_train, dataloader_test = create_dataloader(features=features, 
                                                      targets=targets,
                                                      batch_size=batch_size,
                                                      train_size=train_size,
                                                      test_size=test_size)
```

To run a model we define the optimizer, its arguments and a criterion, feed into the class and perform a call for training.

```
import torch
from run_torch_model import RunTorchNN

optimizer = 'torch.optim.Adam'  # Must be string, if CUDA we initiate the optimizer after calling .cuda for speed-up
optimizer_args = {'lr': 0.001'} # Initialize some arguments for the optimizer
criterion = torch.nn.MSELoss()

run_model = RunTorchNN(model, # Some pytorch model
                          epochs=100, 
                          optimizer=optimizer,
                          optimizer_args=optimizer_args,
                          dataloaders=(dataloader_train, dataloader_test), 
                          criterion=criterion)
 
run_model() # Executes the training
```

To fetch metrics:
```
R2 = run_model.get_r2score()
loss = run_model.get_average_loss()
```

To evaluate the trained model on a different set of features:
```
predictions, loss = run_model.predict(new_features)
```

To evaluate the model on a validation set:
```
loss, r2 = run_model.evaluate(dataloader_validation)
predictions = run_model.get_predictions()  # To get predictions, if necessary 
```
sortedintersect 0.2.0
Interval intersection for sorted query and target intervals

================
sorted-intersect
================

sortedintersect can be used for searching a set of reference intervals for intersecting points or intervals.

A common task in bioinformatics is to check if an interval or point overlaps a set of reference intervals.
An interval tree is often used for this purpose although if both the reference intervals and query intervals are sorted ahead of time, then a simple plane-sweep algorithm can be used.
This situation arises when processing a sorted alignment or vcf file and checking against a sorted reference interval set, for example.


Installation
------------
Download from pypi::

    pip install sortedintersect

To build from source::

    git clone https://github.com/kcleal/sortedintersect
    cd sortedintersect
    pip install .

Overview
--------

Common usage is to check if a point overlaps a reference set:

.. code-block:: python

    from sortedintersect import IntervalSet

    # intervals without data
    itv = IntervalSet(False)
    itv.add(0, 10)
    itv.search_point(1)
    # >>> True

    # intervals with python object as data
    itv = IntervalSet(True)
    itv.add(0, 10, 'interval1')
    itv.add(20, 30, {'a': 1})
    itv.search_point(1)
    # >>> 'interval1'
    itv.search_point(20)
    # >>> {'a': 1}

Note, both reference and query intervals must be added and queried in sorted order otherwise a ValueError will be raised:

.. code-block:: python

    # intervals without data
    itv = IntervalSet(False)
    itv.add(10, 11)
    itv.add(0, 1)
    # >>> ValueError
    itv.search_point(10)  # True
    itv.search_point(9)
    # >>> ValueError


Intervals can also be queried:

.. code-block:: python

    # intervals without data
    itv = IntervalSet(False)
    itv.add(10, 11)
    itv.add(50, 60)
    itv.search_interval(9, 10)   # True
    itv.search_interval(20, 30)  # False
    itv.search_interval(50, 51)  # True

Benchmarks
----------

sortedintersect was compared to popular python implementations based on interval trees, see tests folder.
A major advantage of comparison tools is that queries can be performed in non-sorted order,
which is not the case for sortedintersect:

.. list-table::
   :widths: 25 25 25 25 25
   :header-rows: 1

   * - N intersections
     - sortedintersect (s)
     - quicksect (s)
     - ncls (s)
     - ailist (s)
   * - 100 k
     - 0.006469
     - 0.033503
     - 0.123314
     - 0.053892
   * - 1 million
     - 0.064078
     - 0.334860
     - 1.230206
     - 0.570837
   * - 10 million
     - 0.630569
     - 3.962883
     - 12.819762
     - 5.696887
   * - 100 million
     - 6.407564
     - 40.743349
     - 127.128570
     - 56.149942

.. image:: https://github.com/kcleal/sortedintersect/blob/master/tests/benchmark.png


Limitations
-----------

- Both reference and queries must be assessed in sorted order
- Only the first overlapping interval is currently returned
simple-storage 0.0.6
File storage made easy
Requires Python: >=3.6

# Simple Storage

Data storage made simple.

[![codecov](https://codecov.io/gh/merixstudio/simple-storage/branch/master/graph/badge.svg?token=XMH3S6M34G)](https://codecov.io/gh/merixstudio/simple-storage)
![python](https://img.shields.io/badge/Python-3.6%2B-brightgreen)
[![PyPI Version](https://img.shields.io/pypi/v/simple-storage.svg)](https://pypi.org/project/simple-storage/)

## Supported storages

- File system
- AWS S3
- Google Cloud Storage

## Requirements

- Python >= 3.6

# How to use

Install the package:

```shell
pip install simple-storage
```

Now, depending on the storage you want to use, follow the instructions below.

## File system storage

| Environment variable | Value                                                               |
|----------------------|---------------------------------------------------------------------|
| `STORAGES_BACKEND`   | `storages.backends.file_system.FileSystemStorage`                   |
| `STORAGES_PATH`      | Point to the existing path in your file system, e.g.  `/app/media`. |

## AWS S3 storage

| Environment variable             | Value                                         |
|----------------------------------|-----------------------------------------------|
| `STORAGES_BACKEND`               | `storages.backends.amazon_s3.AmazonS3Storage` |
| `STORAGES_AWS_ACCESS_KEY_ID`     | Your AWS access key ID.                       |
| `STORAGES_AWS_SECRET_ACCESS_KEY` | Your AWS secret access key.                   |
| `STORAGES_AWS_BUCKET_NAME`       | The bucket name that you want to use.         |

> In case you encounter any problems with finding your AWS credentials please read [this page][1] as a reference.

## Google Cloud Storage

| Environment variable                | Value                                                               |
|-------------------------------------|---------------------------------------------------------------------|
| `STORAGES_BACKEND`                  | `storages.backends.google_cloud.GoogleCloudStorage`                 |
| `STORAGES_GOOGLE_CLOUD_CREDENTIALS` | Your Google Cloud Storage credentials in JSON encoded using Base64. |
| `STORAGES_GOOGLE_CLOUD_BUCKET_NAME` | The bucket name that you want to use.                               |

# Documentation

The documentation is hosted on the project's [GitHub Wiki][2].

[1]: https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html "Understanding and getting your AWS credentials"
[2]: https://github.com/merixstudio/simple-storage/wiki