semvec/pypi-packages huggingface dataset:
chancepy 0.1.4
Random generator helper for Python
Requires Python: >=3.8,<4.0

<img src="./logo.jpg" width="150" />

# ChancePy
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Actions Status](https://github.com/kovrr/chancepy/workflows/CI/badge.svg)](https://github.com/kovrr/chancepy/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/kovrr/chancepy/edit/master/LICENSE)
[![pypi](https://img.shields.io/pypi/v/chancepy?style=flat-square)](https://pypi.org/project/chancepy/)


ChancePy - Random generator helper for Python. Inspired by [ChanceJS](https://chancejs.com/index.html).

## Installation

### with pip
`pip install chancepy`

### with poetry
`poetry add chancepy`

## Usage

```python
from chancepy import Chance

# Basic Methods
rand_string = Chance.string()
rand_guid = Chance.guid()
rand_int = Chance.int(min=2, max=32)
rand_letter = Chance.letter(casing='lower')
rand_char = Chance.character(pool='acegikmoqsuwy')
rand_domain = Chance.domain()


# Utilities
rand_choice = Chance.pickone([1, 2, 3])
rand_2_choices = Chance.pickset(['a', 'b', 'c', 'd'], 2)

# Time
rand_date_in_april = Chance.date(month=4)
rand_year = Chance.year(mini=1990)
rand_month_name = Chance.month(mode="full")
rand_weekday = Chance.weekday(mode="short")
rand_hour = Chance.hour()
rand_min = Chance.minute()
rand_second = Chance.second()
rand_millisecond = Chance.millisecond()
rand_timezone = Chance.timezone()
rand_timestamp = Chance.timestamp()

```

## Contributing
PRs are welcome!
btt 0.0.3
A small example package
Requires Python: >=3.6

# new
### 核心代码在new_package文件夹里

### time/top3
![image](https://github.com/cennn/atdd/blob/master/tools/figs/time/top3/cifar10cnn.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/time/top3/cifar10lstm.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/time/top3/exchange96auto.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/time/top3/traffic96trans.png)

### epoch
![image](https://github.com/cennn/atdd/blob/master/tools/figs/epoch/cifar10cnn.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/epoch/cifar10lstm.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/epoch/exchange96auto.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/epoch/traffic96trans.png)

### distribution
![image](https://github.com/cennn/atdd/blob/master/tools/figs/distribution/cifar10cnn.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/distribution/cifar10lstm.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/distribution/exchange96auto.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/distribution/traffic96trans.png)

### overview
![image](https://github.com/cennn/atdd/blob/master/tools/figs/overview/cifar10cnn.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/overview/cifar10lstm.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/overview/exchange96auto.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/overview/traffic96trans.png)

### symptom
![image](https://github.com/cennn/atdd/blob/master/tools/figs/symptom/cifar10cnn.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/symptom/cifar10lstm.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/symptom/exchange96auto.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/symptom/traffic96trans.png)

### rule
![image](https://github.com/cennn/atdd/blob/master/tools/figs/rule/cifar10cnn.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/rule/cifar10lstm.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/rule/exchange96auto.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/rule/traffic96trans.png)

### _distribution_rule
![image](https://github.com/cennn/atdd/blob/master/tools/figs/_distribution_rule/cifar10cnn.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/_distribution_rule/cifar10lstm.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/_distribution_rule/exchange96auto.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/_distribution_rule/traffic96trans.png)

### early
![image](https://github.com/cennn/atdd/blob/master/tools/figs/early/absolute_gradient_value.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/early/active_layer_ratio.png)
![image](https://github.com/cennn/atdd/blob/master/tools/figs/early/train_loss.png)
gonio-imsoft 0.2.0
Goniometric imaging software
Requires Python: >=3.6

# Goniometric imaging software

GonioImsoft is a terminal user interface Python program
designed to control the
goniometric high-speed imaging experiments where

* rotary encoder values are read over serial (pySerial)
* NI-DAQmx is used for general input/output (nidaqmx)
* the camera is controlled over MicroManager (pymmcore)

It was developed for the need of imaging 200 distinct
rotations (eye locations) per specimen fast, requiring
only the space bar to be pressed between the rotations.

For general imaging, without these specific needs,
it is better to use MicroManager or other image
acquisition software.

Following block diagram illustrates the used software architecture

´´´
tui.py - GonioImsoft terminal user interface
  |
core.py
  |
  |__ nidaqmx - Control NI boards (trigger, stimuli)
  |
  |__ pyserial - Read Arduino (rotation data)
  |
  |__ Camera Client
        |_Camera Server
	    |
	    |__ pymmcore - camera control using MicroManager
	    |__ tifffile - writes images/stacks
´´´

Thanks to the camera server/client model,
the cameras can be ran on separate computers.
This parallel image acquisition allows using many cameras
without worrying about memory and bandwidth or processing
limits.



## Required hardware and current limitations

Windows (and Linux to some extent) tested.

* A MicroManager-supported camera device
* National Instruments input/output board (NI specificity can be
  lifted in future by using PyVISA or similar)
* Serial device reporting rotation values in format "pos1,pos2\n"

For full description of the used hardware configuration,
please see
[the GHS-DPP imaging methods article](https://www.nature.com/articles/s42003-022-03142-0)


## How to install


### Rotary encoders

Rotary encoders monitor the rotation of the imaged specimen/sample.
They are
mechanically attached to their respective rotation stages.
Their state is digitally read out using an Arduino microcontroller.

In our system, we used two 1024-step rotary encoders attached on
two perpendicular rotation stages.
If your system is identical, you can flash 
`arduino/angle_sensors/angle_sensors.ino` and use the Serial Monitor
in the Arduino IDE to confirm it works.

If your system differs, you may have to modify the Arduino `ino` file.
However, any serial device reporting rotations in format "pos1,pos2\n"
will do. Here, pos1 and pos2 are rotation steps (integers)
of the two encoders.


### Main software (using pip)

First please make sure that you have
* MicroManager installation with a working camera
* National Insturments cards configured with
names *Dev1* and *Dev2* for input and output, respectively
* Python 3.6 or newer

Then, use pip to install

```
pip install gonio-imsoft
```

## How to use

You can launch the main program using

```
python -m gonioimsoft.tui
```