Metadata-Version: 2.1
Name: eam-data-tools
Version: 1.4.0
Summary: Tool to read model data from a table
Home-page: https://github.com/dschien/eam-data-tools
Author: Dan Schien
Author-email: daniel.schien@bristol.ac.uk
License: Apache-2.0
Project-URL: Documentation, https://eam-data-tools.readthedocs.io/
Project-URL: Changelog, https://eam-data-tools.readthedocs.io/en/latest/changelog.html
Project-URL: Issue Tracker, https://github.com/dschien/eam-data-tools/issues
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Utilities
Requires-Python: >=3.6
Requires-Dist: scipy
Requires-Dist: xlrd
Requires-Dist: pandas (==0.24.2)
Requires-Dist: numpy
Requires-Dist: python-dateutil
Provides-Extra: excel
Requires-Dist: openpyxl ; extra == 'excel'
Requires-Dist: xlrd ; extra == 'excel'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: codecov ; extra == 'test'
Requires-Dist: coveralls ; extra == 'test'
Requires-Dist: nbval ; extra == 'test'
Provides-Extra: units

========
Overview
========



Tool to define random variables in a table. The main purpose is to support the EAM framework.

* Free software: Apache Software License 2.0

Installation
============

::

    pip install eam-data-tools

You can also install the in-development version with::

    pip install https://github.com/dschien/eam-data-tools/archive/master.zip


Documentation
=============

https://eam-data-tools.readthedocs.io/

Usage
=====

# Example
Given an excel file with rows similar to the below

+----------+----------+--------+-------------------------------------------------------+--------+--------------------------------------+------+-------------+--------------------+------------+------------+---------+--------+
| variable | scenario | type   | ref value                                             | param  | initial_value_proportional_variation | unit | mean growth | variability growth | ref date   | label      | comment | source |
+----------+----------+--------+-------------------------------------------------------+--------+--------------------------------------+------+-------------+--------------------+------------+------------+---------+--------+
| a        |          | exp    | 10                                                    |        | 0.4                                  | kg   | -0.20       | 0.10               | 01/01/2009 | test var 1 |         |        |
+----------+----------+--------+-------------------------------------------------------+--------+--------------------------------------+------+-------------+--------------------+------------+------------+---------+--------+
| b        |          | interp | {"2010-01-01":1, "2010-03-01":100 , "2010-12-01":110} | linear | 0.4                                  | kg   | -0.20       | 0.10               | 01/01/2009 | test var 1 |         |        |
+----------+----------+--------+-------------------------------------------------------+--------+--------------------------------------+------+-------------+--------------------+------------+------------+---------+--------+

Write code that references these variables and generates random distributions in pandas dataframes with `pint-pandas
<https://github.com/hgrecco/pint-pandas>`_ units.::

        repository = ParameterRepository()
        TableParameterLoader(filename='./test_v2.xlsx', excel_handler='xlrd').load_into_repo(sheet_name='Sheet1',
                                                                                             repository=repository)
        p = repository.get_parameter('a')

        settings = {'sample_size': 3, 'times': pd.date_range('2016-01-01', '2017-01-01', freq='MS'),
                    'sample_mean_value': False, 'use_time_series': True}
        val = p(settings)
        series = val.pint.m






Changelog
=========

0.0.0 (2020-04-04)
------------------

* First release on PyPI.


