Skip to main content

statsfiles for stats on files.

Project description


[![Build Status](https://travis-ci.org/ZGCDDoo/statsfiles.svg?branch=master)](https://travis-ci.org/ZGCDDoo/statsfiles)
[![codecov](https://codecov.io/gh/ZGCDDoo/statsfiles/branch/master/graph/badge.svg)](https://codecov.io/gh/ZGCDDoo/statsfiles)
[![Documentation Status](https://readthedocs.org/projects/statsfiles/badge/?version=latest)](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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

statsfiles-2.3.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statsfiles-2.3.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file statsfiles-2.3.0.tar.gz.

File metadata

  • Download URL: statsfiles-2.3.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for statsfiles-2.3.0.tar.gz
Algorithm Hash digest
SHA256 acd04ad643007ce1d292c15a246b586bcdbe4c1dbd4a5ea0f29d918a74b17702
MD5 787febbe3daafbbd2dbbccb3a0f94528
BLAKE2b-256 118e66c791d68863e7aae342dd477681ffb2b344f71419d13cede4b847dac688

See more details on using hashes here.

File details

Details for the file statsfiles-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: statsfiles-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for statsfiles-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f86e1e53761b2fde1ffc1b7b94f396fb9fdfa8e0c9faf21b10ebffec5c025b1
MD5 e351d9e5b47587365163c842d2fe6abc
BLAKE2b-256 29cbd84e36dc0063e5a501485eaff71e4778e3f6218d2c67b1e5d03fc6770ee4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page