[](https://travis-ci.org/ZGCDDoo/statsfiles)
[](https://codecov.io/gh/ZGCDDoo/statsfiles)
[](https://statsfiles.readthedocs.io/en/latest/?badge=latest)
# Statsfiles
Please consult the bare bones documentation by clicking on the docs badge above.
Statsfiles is a small python module to compute simple statistics (average and means) of similarly named files. This can be usefull for simulations where a program outputs many files with the same name, but with a number appended.
For exemple, a program that calculated the temperature on a given number of points in a city for each hour would ouput a file called: temperature1.dat, temperature2.dat , etc for each day starting from day 1.
The file would be composed of 24 rows (each hour of the day) and say 10 columns (10 places in the city). To get the average temperature for the year, one needs to do some statistics on these files. This is the usefullness of statsfiles. The previous files which have an array (matrix, i.e numpy) form are called **array_files**. Now if we are interseted in the number of coffees taken by the employeess of this temperature program (for the city broadcasting station), would be logged in a file called cafe1.dat, cafe2.dat, etc. This file would contain the hour on the first column and the amount of coffee taken of the second column. These type of files are called **obs_files**. The first coulmn is ignored for the statistics, and the statistics for this type of files are saved in json format in the file called **statsobs.json**.
The output of this module for this previous example is the folder **Stats-${date-time}** with temperature_moy.dat, temperature_et.dat for respectively the average value and the standard deviation, as well as statsobs.json.
## Installation
Simple as :
```bash
pip install statsfiles
```
### Dependencies
This module can run on python >= 3.6. The dependencies will be installed automatically by pip.
## Usage
I recommend taking a look and trying the example. Once this is done, it is quite easy to use it for your own sake. To run the exemple (after Installation):
```bash
cd example
python -m statsfiles 1 --file example.yml
```
The example is composed of a simple yaml file (see [pyyaml](https://pyyaml.org/)), that describes the files that will be used for the statistics. Let us explain in detail this yaml file.
### Yaml config file
#### obs_files
The name of the files which have a structure given by k.dat
#### array_files
The files which have a structure of matrices (the temperature files described above).
#### param_files
## README and example under construction.
Release files for statsfiles 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| statsfiles-2.3.0.tar.gz | 15.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| statsfiles-2.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:36.4 kB
Release files / statsfiles-2.3.0.tar.gz
| Download URL | statsfiles-2.3.0.tar.gz |
|---|---|
| Size | 15.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acd04ad643007ce1d292c15a246b586bcdbe4c1dbd4a5ea0f29d918a74b17702
|
|
BLAKE2b-256 checksum How to use checksums |
118e66c791d68863e7aae342dd477681ffb2b344f71419d13cede4b847dac688
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / statsfiles-2.3.0-py3-none-any.whl
| Download URL | statsfiles-2.3.0-py3-none-any.whl |
|---|---|
| Size | 20.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f86e1e53761b2fde1ffc1b7b94f396fb9fdfa8e0c9faf21b10ebffec5c025b1
|
|
BLAKE2b-256 checksum How to use checksums |
29cbd84e36dc0063e5a501485eaff71e4778e3f6218d2c67b1e5d03fc6770ee4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|