semvec/pypi-packages huggingface dataset:
stressinjector 0.0.2
Python module, to inject memory and CPU stress.
Keywords: stress-test,numpy-arrays,cpu-stress,memory-stress,multiprocessing

###### Environments
[![Docs](https://img.shields.io/docsrs/docs/latest)](https://thevickypedia.github.io/stress_injector/)

###### Activity
![Maintained](https://img.shields.io/maintenance/yes/2021)
[![GitHub Repo created](https://img.shields.io/date/1599432310)](https://api.github.com/repos/thevickypedia/stress_injector)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/thevickypedia/stress_injector)](https://api.github.com/repos/thevickypedia/stress_injector)
[![GitHub last commit](https://img.shields.io/github/last-commit/thevickypedia/stress_injector)](https://api.github.com/repos/thevickypedia/stress_injector)

# Stress Injector
Python module, to inject memory and CPU stress

## Insights:

### CPU Stress:
* To achieve CPU stress, I have used multiprocess, looped for the # of logical cores, triggering an infinite loop on
  each core.
* The infinite loop will run for a given # of seconds provided by user.
* Mean-while the `cpu_percent` from `psutil` runs (dedicated thread) in an infinite loop with kill signal set to `False`
  calculating the current CPU utilization on each CPU core.
* Once the given # of seconds have passed, the `kill_signal` is set to `True` and some painful steps to _gracefully_
  stop the `multiprocess` and multi-thread.

### Memory Stress:
* In this script, I have used `numpy.random.bytes` which are sampled from uniform distribution.
* Generating these random bytes induces a stress on the machine's memory usage.
* I have then used `getrusage` (get resource usage) for `SELF` to get the memory consumed only by the current script.
* The `size_converter` converts the bytes from resource usage to a human understandable format.


### Coding Standards:
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
Clean code with pre-commit hooks: [`flake8`](https://flake8.pycqa.org/en/latest/) and 
[`isort`](https://pycqa.github.io/isort/)

### Pre-Commit
`pre-commit` will run `flake8` and `isort` to ensure proper coding standards along with [docs_generator](gen_docs.sh) 
to update the [runbook](#Runbook)
> `pre-commit run --all-files`

### Runbook:
https://thevickypedia.github.io/stress_injector/

> Generated using [`sphinx-autogen`](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)

## License & copyright

&copy; Vignesh Sivanandha Rao

Licensed under the [MIT License](LICENSE)


Change Log
==========

0.0.1 (08/04/2021)
------------------
- Onboard stress-injector to pypi

0.0.2 (08/04/2021)
------------------
- Update docs
- Change module name
- Fix broken references
panko 8.1.0
Event storage publisher and API for Ceilometer
Requires Python: >=3.6

panko
=====


-------------
Documentation
-------------

Documentation for the project can be found at:
https://docs.openstack.org/panko/latest/

Launchpad Projects
------------------
- Server: https://launchpad.net/panko
- Client: https://launchpad.net/python-pankoclient

Code Repository
---------------
- Server: https://github.com/openstack/panko
- Client: https://github.com/openstack/python-pankoclient

Bug Tracking
------------
- Bugs: https://bugs.launchpad.net/panko

IRC
---
IRC Channel: #openstack-telemetry on Freenode.

Release notes
-------------
Release notes: https://docs.openstack.org/releasenotes/panko/
p5Launcher 0.1.1
launches p5 sketches into a standalone window
Keywords: p5js,creative coding,processing

Write your p5js sketches with python and automatically launch them in a new window just by running your script.
* no html
* no javascript
* just python

Also included: autoreload on save!

# Installation
`pip3 install p5Launcher` or `pip install p5Launcher` dependending on your python configuration (requires python3, only tested on >= 3.8)

# Usage

open your favourite editor and create a new file `<script.py>` and save it wherever you want

```
import p5Launcher

def setup():
    createCanvas(windowWidth, windowHeight)
    stroke(100, 100, 100, 100)
    noFill()


def draw():
    background(100)
    ellipse(mouseX, mouseY, 30, 30)
```

open a terminal, move to the folder where you saved the script and run it with `python3 <script.py>` or just use your editor "run" button if available.

A new window should popup with your sketch!

Bonus: try changing your code and saving, the changes should automatically be reflected in the sketch.

# How does it work?
This package just wraps the library pyp5js which itself leverages transcrypt to compile python to javascript.
scend 1.0.3
SCEnd: A matrix factorization method for single-cell

# SCEnd
A matrix factorization method for single-cell

## Pre-requirements
* python3
* numpy
* pandas
* scipy
* scikit-learn

## Installation

### Installation with pip
To install with pip, run the following from a terminal:
```Bash
pip install scend
```

## Usage

### Basic use
```Python
import scend
import pandas as pd

# read your data, the rows in the data represent genes, and the columns represent cells
data = pd.read_csv("data.csv", header=0, index_col=0)

# create a SCEnd object which only return the imputed data
operator = scend.SCEnd(n_features=10, estimate_only=True)

# impute
data_imputed = operator.scend_impute(data)

# create a SCEnd object
operator = scend.SCEnd(n_features=10, estimate_only=False)

# impute
res = operator.scend_impute(data)

# get the results
data_imputed = res["estimate"]

gene_matrix = res["gene latent factor matrix"]

cell_matrix = res["cell latent factor matrix"]

```

### Parameters
```Python
SCEnd(n_features=20, steps=10, alpha=1e-5, eps=10, noise_model="Fano", normalize=True, estimate_only=False)
```
Parameters

* n_features : int, optional, default: 20

    The number of features during the matrix factorizaiton.

* steps : int, optional, default: 0.5

    The max number of iteration.

* alpha : float, optional, default: 1e-5

    gradient update step size. It can be so different with different dataset, please try more for a better result.
  
* eps : float, optional, default: 10
    
    The threshold at which the objective function stops updating
  
* noise_model: boolean, optional, default: "Fano"
    
    Our hypothetical noise model. We offer three options:
    * CV : constant variance
    * Fano : Fano factor
    * CCV : constant coefficient of variation
    
    We found that generally the fano model is the most stable.
    
* normalize : boolean, optional, default: True

    By default, SCEnd takes in an unnormalized matrix and performs library size normalization during the denoising step. However, if your data is already normalized or normalization is not desired, you can set normalize=False.

* estimate_only : boolean, optional, default: False

    Generally, the SCEnd returns a dictionary which contains the imputed matrix and gene latent factor matrix and cell latent factor matrix. If you have no need of the latent factor matrix, you can set estimate_only=True.