jk_timest


Namejk_timest JSON
Version 0.2017.1.12 PyPI version JSON
home_pagehttps://github.com/jkpubsrc/python-module-jk-timest
SummaryThis python module aids in estimating how long some long running process will require until it completes.
upload_time2017-01-12 09:19:17
maintainerNone
docs_urlNone
authorJürgen Knauth
requires_pythonNone
licenseApache 2.0
keywords time estimation eta
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
Coveralis test coverage No Coveralis.
            jk_timest
=========

Introduction
------------

This python module aids in estimating the remaining time of a (long running) process. For that purpose
it provides the following class:
* TimeEstimation

How to Use the Time Estimation Class
------------------------------------

In order to use the time estimation class first create a properly initialized instance. You at least have
to tell the object how many processing steps you will have. (This information is required in order to
be able to calculate the remaining time during processing.)

Example:

```python
# initialize the time estimation object
te = TimeEstimator(PROCESS_DURATION_STEPS, 0, 5, 5)
```

The arguments have the following meaning:

1. (required) The maximum number of steps your task will require.
2. (optional) The current position. This will be interesting for you if you resume processing and therefor
   start at a specific position and not at zero.
3. (optional) The minimum number of seconds we want to have data collected until we can do a reasonable estimation.
4. (optional) The minimum number of data values we want to have collected until we can do a reasonable estimation.

Then - during processing - call `tick()` whenever you completed a processing step.

```python
# inform the estimation object that we did something
te.tick()
```

In order to estimate the remainig time call `getETAStr()` and print the result.

Example:

```python
# estimate remaining time and print it
print(te.getETAStr())
```

Estimation Output
-----------------

The method `getETAStr()` provides the following arguments:

* `EnumTimeEstimationOutputStyle mode` : Select the output mode. (See below.)
* `bool bSmooth` : This value is `True` by default and therefor enables smoothing by default. (See below.)
* `str default` : A default string to output if no time estimation can be given (yet). Here `None` is the default.

This method supports the following estimation output styles:

* `EnumTimeEstimationOutputStyle.EASY` : Print either something like "X days Y hours" or something like "HH:MM:SS"
   indicating hours, minutes and seconds. (This is the default.)
* `EnumTimeEstimationOutputStyle.FORMAL` : Print the remaining time in a strict format: "DD:HH:MM:SS"

Smoothing will result in averaging over the last 20 estimation values calculated. This is a very simple
implementation but it works quite well and reduces fluctuations of values if the individual processing
steps vary too much in their duration.

Contact Information
-------------------

This is Open Source code. That not only gives you the possibility of freely using this code it also
allows you to contribute. Feel free to contact the author(s) of this software listed below, either
for comments, collaboration requests, suggestions for improvement or reporting bugs:

* Jürgen Knauth: j.knauth@uni-goettingen.de, pubsrc@binary-overflow.de

License
-------

Apache Software License 2.0
            

Raw data

            {
    "maintainer": null, 
    "docs_url": null, 
    "requires_python": null, 
    "maintainer_email": null, 
    "cheesecake_code_kwalitee_id": null, 
    "coveralis": false, 
    "keywords": "time,estimation,eta", 
    "upload_time": "2017-01-12 09:19:17", 
    "author": "J\u00fcrgen Knauth", 
    "home_page": "https://github.com/jkpubsrc/python-module-jk-timest", 
    "github_user": "jkpubsrc", 
    "download_url": "https://pypi.python.org/packages/31/41/e2efb65ef9ebd1020d6b4f5173aee4ce4fb24ef4a7566a178bebfd1292af/jk_timest-0.2017.1.12.tar.gz", 
    "platform": "UNKNOWN", 
    "version": "0.2017.1.12", 
    "cheesecake_documentation_id": null, 
    "description": "jk_timest\n=========\n\nIntroduction\n------------\n\nThis python module aids in estimating the remaining time of a (long running) process. For that purpose\nit provides the following class:\n* TimeEstimation\n\nHow to Use the Time Estimation Class\n------------------------------------\n\nIn order to use the time estimation class first create a properly initialized instance. You at least have\nto tell the object how many processing steps you will have. (This information is required in order to\nbe able to calculate the remaining time during processing.)\n\nExample:\n\n```python\n# initialize the time estimation object\nte = TimeEstimator(PROCESS_DURATION_STEPS, 0, 5, 5)\n```\n\nThe arguments have the following meaning:\n\n1. (required) The maximum number of steps your task will require.\n2. (optional) The current position. This will be interesting for you if you resume processing and therefor\n   start at a specific position and not at zero.\n3. (optional) The minimum number of seconds we want to have data collected until we can do a reasonable estimation.\n4. (optional) The minimum number of data values we want to have collected until we can do a reasonable estimation.\n\nThen - during processing - call `tick()` whenever you completed a processing step.\n\n```python\n# inform the estimation object that we did something\nte.tick()\n```\n\nIn order to estimate the remainig time call `getETAStr()` and print the result.\n\nExample:\n\n```python\n# estimate remaining time and print it\nprint(te.getETAStr())\n```\n\nEstimation Output\n-----------------\n\nThe method `getETAStr()` provides the following arguments:\n\n* `EnumTimeEstimationOutputStyle mode` : Select the output mode. (See below.)\n* `bool bSmooth` : This value is `True` by default and therefor enables smoothing by default. (See below.)\n* `str default` : A default string to output if no time estimation can be given (yet). Here `None` is the default.\n\nThis method supports the following estimation output styles:\n\n* `EnumTimeEstimationOutputStyle.EASY` : Print either something like \"X days Y hours\" or something like \"HH:MM:SS\"\n   indicating hours, minutes and seconds. (This is the default.)\n* `EnumTimeEstimationOutputStyle.FORMAL` : Print the remaining time in a strict format: \"DD:HH:MM:SS\"\n\nSmoothing will result in averaging over the last 20 estimation values calculated. This is a very simple\nimplementation but it works quite well and reduces fluctuations of values if the individual processing\nsteps vary too much in their duration.\n\nContact Information\n-------------------\n\nThis is Open Source code. That not only gives you the possibility of freely using this code it also\nallows you to contribute. Feel free to contact the author(s) of this software listed below, either\nfor comments, collaboration requests, suggestions for improvement or reporting bugs:\n\n* J\u00fcrgen Knauth: j.knauth@uni-goettingen.de, pubsrc@binary-overflow.de\n\nLicense\n-------\n\nApache Software License 2.0", 
    "lcname": "jk_timest", 
    "bugtrack_url": null, 
    "github": true, 
    "name": "jk_timest", 
    "license": "Apache 2.0", 
    "travis_ci": false, 
    "github_project": "python-module-jk-timest", 
    "summary": "This python module aids in estimating how long some long running process will require until it completes.", 
    "split_keywords": [
        "time", 
        "estimation", 
        "eta"
    ], 
    "author_email": "pubsrc@binary-overflow.de", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2017-01-12T09:19:17", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/31/41/e2efb65ef9ebd1020d6b4f5173aee4ce4fb24ef4a7566a178bebfd1292af/jk_timest-0.2017.1.12.tar.gz", 
            "md5_digest": "fff3505f986f83825e19e1472ac798fc", 
            "downloads": 0, 
            "filename": "jk_timest-0.2017.1.12.tar.gz", 
            "packagetype": "sdist", 
            "path": "31/41/e2efb65ef9ebd1020d6b4f5173aee4ce4fb24ef4a7566a178bebfd1292af/jk_timest-0.2017.1.12.tar.gz", 
            "size": 8264
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}