{ "info": { "author": "Stefan Scherfke", "author_email": "stefan.scherfke at offis.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Scientific/Engineering" ], "description": "mosaik-hdf5\n===========\n\nStore mosaik simulation data in an HDF5 database.\n\nMosaik-hdf5 stores the relations-graph of your simulation, timeseries for\nentities connected to it and optionally static entity and simulation meta data.\nThe database structure usually looks like this::\n\n / [meta data]\n |\n +- Relations\n | |\n | +- Sim-0.Entity-1\n | |\n | +- PyPower-0.1-Node-2\n |\n +- Series\n |\n +- Sim-0.Entiy-1 [static data]\n | |\n | +- val_out\n |\n +- PyPower-0.1-Node-2 [static data]\n |\n +- P\n |\n +- Q\n\nThe *Relations* group contains one dataset for every entity. For each of the\nentity's relations, the dataset has one tuple *(path_to_relation,\npath_to_relatio_series)*.\n\nThe *Series* group contains (by default) one group for every entity. Each of\nthese group as one dataset for every attribute.\n\nStatic entity data is stored as attributes in the entity groups. Simulation\nmeta data is stored as attributes of the root group.\n\nYou can, optionally, create a more nested structure for the series, for\nexample, if you want to group entities by simulator and/or simulator instance.\nThis is done via regular expression replacements based on the entity ID.\n\n\nInstallation\n------------\n\n*mosaik-hdf5* uses the `h5py`__ module. If you get an error during installation\nthat `hdf5.h` is missing, install the HDF5 headers (e.g., ``sudo apt-get\ninstall libhdf5-dev`` or ``brew install hdf5``) or use a binary package (e.g.,\nfor `Windows`__)\n\n::\n\n $ pip install mosaik-hdf5\n\n__ http://www.h5py.org/\n__ http://www.lfd.uci.edu/~gohlke/pythonlibs/#h5py\n\n\nUsage\n-----\n\nYou can run mosaik-hdf5 as a sub-process or your simulation or in-process with\nit. Here are example configurations for both variants:\n\n.. code-block:: python\n\n sim_config = {\n 'HDF5-inproc': {\n 'python': 'mosaik_hdf5:MosaikHdf5',\n },\n 'HDF5-subproc': {\n 'cmd': 'mosaik-hdf5 %(addr)s',\n },\n }\n\nInitialization\n^^^^^^^^^^^^^^\n\nWhen you start mosaik-hdf5, you have to provide a *step_size* and a *duration*\nargument. The *step_size* defines how often data will be collected. The\n*duration* is the simulation end time in seconds. It is used to calculate the\ndataset size for every time series. For example, if *duration* is half-an-hour\n(1800s) and *step_size* is 60, each dataset will have a length of 30.\n\nYou can optionally pass a *series_path* tuple which contains a regular\nexpression pattern and replacement string (see the `Python docs`__ for\ndetails).\n\nFor example, by default the entity IDs ``Sim-0.Entity-1`` and\n``PyPower-0.1-Node-2`` would map to the series paths ``/Series/Sim-0.Entity-1``\nand ``/Series/PyPower-0.1-Node-2``. But you want to group the entities by\nsimulator type and simulator instance. Also, since one `mosaik-pypower`__\ninstance can contain multiple grids, you also want to take care of that. So\nwhat you want is something like that: ``/Series/Sim/Sim-0/Sim-0.Entity-1`` and\n``/Series/PyPower/PyPower-0.1/PyPower-0.1-Node-2``. In this (rather complex)\ncase, *series_path* can be ``(r'(((\\w+)-(\\d+.\\d+|\\d+))[.-](.*))',\nr'\\3/\\2/\\1')``. Easy, isn't it?\n\n__ https://docs.python.org/3/library/re.html#re.sub\n__ https://pypi.python.org/pypi/mosaik-pypower\n\nHere are two examples for this:\n\n.. code-block:: python\n\n a = world.start('HDF5', step_size=60, duration=1800)\n\n pattern = r'(((\\w+)-(\\d+.\\d+|\\d+))[.-](.*))'\n repl = r'\\3/\\2/\\1'\n b = world.start('HDF5', step_size=1, duration=10,\n series_path=(pattern, repl))\n\n\nModel instantiation\n^^^^^^^^^^^^^^^^^^^\n\nEvery instance of mosaik-hdf5 allows you to create exactly one instance of its\n*Database* model (which is also the only model provided). The *Database* has\nthe following parameters:\n\n- *gridfile* is the filename of the HDF5 database that will be created.\n\n- *buf_size* (default: 1000) is the size of the internal data buffer for each\n series dataset. Mosaik-hdf5 buffers the data for every dataset and only\n writes larger chunks of data to the disk in order to improve the writing\n performance. If you have a lot of entities (> 100k) and only little memory,\n you may reduce this number. If you have lots of RAM, you can play with larger\n buffer sizes and see if it improves the performance for you.\n\n- *dataset_opts* (default: None) is a dictionary of arguments that get passed\n to h5py's `create_dataset()`__ method.\n\n This can, for example, be used to `enable compression`__ (note, that the\n *lzf* compression is not supported by all HDF5 viewers).\n\n__ http://docs.h5py.org/en/2.3/high/dataset.html\n__ http://docs.h5py.org/en/2.3/high/dataset.html#lossless-compression-filters\n\nExamples:\n\n.. code-block:: python\n\n # Basic usage\n hdf5 = world.start('HDF5', step_size=1, duration=1)\n db = hdf5.Database('data.hdf5')\n\n # Use gzip compression\n hdf5 = world.start('HDF5', step_size=1, duration=1)\n db = hdf5.Database('data.hdf5', dataset_opts={\n 'compression': 'gzip',\n 'compression_opts': 9,\n })\n\n # Use lzf compression and a larger buffer\n hdf5 = world.start('HDF5', step_size=1, duration=1)\n db = hdf5.Database('data.hdf5', buf_size=1336,\n dataset_opts={'compression': 'lzf'})\n\n\nStoring data\n^^^^^^^^^^^^\n\nThe *Database* model has no attributes, but it accepts any inputs. This means\nthat you can just connect *anything* to it. For each entity and attribute that\nis connected to the database, a corresponding dataset will be created in the\ndatabase.\n\nMosaik-hdf5 also provides to extra methods that allow you to store some\nsimulation meta data and static entity data. You can only use these methods\nonce you created an instance of the *Database* model. The method\n``set_meta_data()`` takes a single dict with an arbitrary amount of key-values\npairs. The method ``set_static_data()`` takes a dict of entities and data\ndicts.\n\nIn the following example, we'll create some (fake) PV entities and a power grid\n(with nodes and lines). We want to store the PV's active and reactive power\n*(P, Q)*, the node voltage and angle *(Vm, Va)* for all nodes and the\ncomplex current *(I_real, I_imag)* of all branches:\n\n.. code-block:: python\n\n pv_pmax = 10\n pvs = make_pvs(pv_pmax, ...) # A list of PV entities\n nodes, lines = make_grid(...) # Lists of nodes/lines of a power grid\n\n hdf5 = world.start('HDF5', step_size=1, duration=10)\n db = hdf5.Database('data.hdf5')\n\n # Store meta and static data\n hdf5.set_meta_data({'duration': 10, 'description': 'hdf5 demo'}\n hdf5.set_static_data({pv.full_id: {'p_max': pv_pmax} for pv in pvs})\n\n # Connect inputs to database\n mosaik.util.connect_many_to_one(world, pvs, db, 'P', 'Q')\n mosaik.util.connect_many_to_one(world, nodes, db, 'Vm', 'Va')\n mosaik.util.connect_many_to_one(world, lines, db, 'I_real', 'I_imag')\n\nFor a real example, you can take a look at the `mosaik-demo`__.\n\n__ https://bitbucket.org/mosaik/mosaik-demo/src/tip/demo.py\n\n\nGetting help\n------------\n\nIf you need, please visit the `mosaik-users mailing list`__ .\n\n__ https://mosaik.offis.de/mailinglist\n\n\nChangelog\n=========\n\n0.3 - 2016-02-15\n----------------\n\n- [NEW] Implemented the new \"setup_done()\" method.\n\n\n0.2 \u2013 2014-10-29\n----------------\n\n- [NEW] More documentation\n- [NEW] Static and simulation meta data can now be stored (`issue #1`_).\n- [NEW]\u00a0Datasets can now be stored in arbitrarily defined paths (using complex\n regular expression replacements based on the entity ID) (`issue #4`_).\n\n.. _`issue #1`: https://bitbucket.org/mosaik/mosaik-hdf5/issue/1/\n.. _`issue #4`: https://bitbucket.org/mosaik/mosaik-hdf5/issue/4/\n\n\n0.1.2 \u2013 2014-09-22\n------------------\n\n- [CHANGE] Updated to mosaik-api 2.0.\n\n\n0.1.1 \u2013 2014-07-31\n------------------\n\n- [FIX] Fixed a regression in 0.1.\n\n\n0.1 \u2013 2014-07-31\n----------------\n\n- Initial release\n\n\nAuthors\n=======\n\nThe mosaik HDF5 storage backend was created by Stefan Scherfke.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/mosaik/mosaik-hdf5", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mosaik-hdf5", "package_url": "https://pypi.org/project/mosaik-hdf5/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mosaik-hdf5/", "project_urls": { "Homepage": "https://bitbucket.org/mosaik/mosaik-hdf5" }, "release_url": "https://pypi.org/project/mosaik-hdf5/0.3/", "requires_dist": [ "h5py (>=2.2.1)", "mosaik-api (>=2.2)", "networkx (>=1.9)", "numpy (>=1.8.1)" ], "requires_python": "", "summary": "Stores mosaik simulation data in an HDF5 database.", "version": "0.3" }, "last_serial": 1957324, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "00d4a565d6887e3fd715d3ee4f9ac157", "sha256": "cdbf0f16115351304214bc25450bc9296d6dd4da0933d15bab2f0aa5081fe9d4" }, "downloads": -1, "filename": "mosaik_hdf5-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "00d4a565d6887e3fd715d3ee4f9ac157", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4381, "upload_time": "2014-07-31T15:47:18", "url": "https://files.pythonhosted.org/packages/4f/54/29378364bf865a1d8b2dcaa6a2200577b9d7c8a44c4467594b8fae07ce5d/mosaik_hdf5-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a42b2127e59651657c4676d6a9e12a5f", "sha256": "20ba03128c1a547a09cfc5b684407f1946fcc7d8a2bc8c43fc18f7f882cde6e1" }, "downloads": -1, "filename": "mosaik-hdf5-0.1.tar.gz", "has_sig": false, "md5_digest": "a42b2127e59651657c4676d6a9e12a5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13047, "upload_time": "2014-07-31T15:47:21", "url": "https://files.pythonhosted.org/packages/a9/a8/108d4ff481b6a552ff9216e353e7076e9986fe8ec454058f2cb1f9388a2e/mosaik-hdf5-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7c1af3f4a5cba2d48a1a2fe7464d8f8b", "sha256": "82c23f5f446f149292c22a813d23de39632d461fd47477b13d53438b05272eee" }, "downloads": -1, "filename": "mosaik_hdf5-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7c1af3f4a5cba2d48a1a2fe7464d8f8b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4490, "upload_time": "2014-07-31T15:55:27", "url": "https://files.pythonhosted.org/packages/02/1c/6766db358fb2d3d24d4afd6242083bf5d1f05625379aa9b4bcd6a1124360/mosaik_hdf5-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ffd6b8b1590156d51d4565bd56a97ff3", "sha256": "843e26ee88e6cdc977d0e67845582cb0a18a528ca6f9f837f6cbce0b774c7ecf" }, "downloads": -1, "filename": "mosaik-hdf5-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ffd6b8b1590156d51d4565bd56a97ff3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13111, "upload_time": "2014-07-31T15:55:31", "url": "https://files.pythonhosted.org/packages/cf/0f/e93cfa504231562aab7bf254487b6c68a7973784c4bf90172d6696602ae0/mosaik-hdf5-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "20eb779bc211c473c082c4ac08924177", "sha256": "a64ab792d52aca1480ad9c840d0b3faffdbe681b0083d5e9bc7e7c1c525b889c" }, "downloads": -1, "filename": "mosaik_hdf5-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "20eb779bc211c473c082c4ac08924177", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4972, "upload_time": "2014-09-22T13:33:59", "url": "https://files.pythonhosted.org/packages/5f/f5/2b98561cd54a273d781b5a674a20a915d8477289330e0336dc6a6a5b49ab/mosaik_hdf5-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "06662b0a73e197b1c130ffdebcafc8b4", "sha256": "97217920627b240212605fdeec552f07df879ce426c1c727452afbdc683c191f" }, "downloads": -1, "filename": "mosaik-hdf5-0.1.2.tar.gz", "has_sig": false, "md5_digest": "06662b0a73e197b1c130ffdebcafc8b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13585, "upload_time": "2014-09-22T13:34:01", "url": "https://files.pythonhosted.org/packages/eb/29/98bb8c131372d743a60c883c9755ddb9c41201da9f733f62380ee84b504a/mosaik-hdf5-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "09fd09898afff372d9bc699b6e8ee7a9", "sha256": "986c740d31f7e3a84363c711aedf877de7e0ddf687aaf7fdfe55448c07d8b84a" }, "downloads": -1, "filename": "mosaik_hdf5-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "09fd09898afff372d9bc699b6e8ee7a9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10829, "upload_time": "2014-10-29T15:51:45", "url": "https://files.pythonhosted.org/packages/5d/85/981534c7f833df57a1a8d6477e248d7c0d8ccd0f4070373886d8f448c4a5/mosaik_hdf5-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "80256363c1a1d50e3776da120e587052", "sha256": "f1a4f34536565980d8dffcee1518862645d22a46d9eb6d103a27fd284149e6db" }, "downloads": -1, "filename": "mosaik-hdf5-0.2.tar.gz", "has_sig": false, "md5_digest": "80256363c1a1d50e3776da120e587052", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17520, "upload_time": "2014-10-29T15:51:42", "url": "https://files.pythonhosted.org/packages/3c/cb/8dcc38818cdc616f86b8d4a3666edea8c80582f09e6646607d8b9bf1d14e/mosaik-hdf5-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "2a4093faa887e1cfd72d4d57634bc015", "sha256": "53fc5813069bc8cc7abd40f96eaceea66f983a4bb99c4fccfda3e4e04459ba1d" }, "downloads": -1, "filename": "mosaik_hdf5-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2a4093faa887e1cfd72d4d57634bc015", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10892, "upload_time": "2016-02-15T14:09:04", "url": "https://files.pythonhosted.org/packages/ae/e2/649baa4ecb82a193647370313032ba6bb70379a8b0d19e2d257dfa5c3655/mosaik_hdf5-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6281e1bec739e5e6072d565a854fa1f8", "sha256": "d4744a37d125d742809d279f1829b0301382050ac3f5873d68bfdd19ee8d7ba9" }, "downloads": -1, "filename": "mosaik-hdf5-0.3.tar.gz", "has_sig": false, "md5_digest": "6281e1bec739e5e6072d565a854fa1f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17557, "upload_time": "2016-02-15T14:09:11", "url": "https://files.pythonhosted.org/packages/94/fc/9adea437295a1ab67c45114bc057350175de3eec072018c9d6e58db0b612/mosaik-hdf5-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2a4093faa887e1cfd72d4d57634bc015", "sha256": "53fc5813069bc8cc7abd40f96eaceea66f983a4bb99c4fccfda3e4e04459ba1d" }, "downloads": -1, "filename": "mosaik_hdf5-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2a4093faa887e1cfd72d4d57634bc015", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10892, "upload_time": "2016-02-15T14:09:04", "url": "https://files.pythonhosted.org/packages/ae/e2/649baa4ecb82a193647370313032ba6bb70379a8b0d19e2d257dfa5c3655/mosaik_hdf5-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6281e1bec739e5e6072d565a854fa1f8", "sha256": "d4744a37d125d742809d279f1829b0301382050ac3f5873d68bfdd19ee8d7ba9" }, "downloads": -1, "filename": "mosaik-hdf5-0.3.tar.gz", "has_sig": false, "md5_digest": "6281e1bec739e5e6072d565a854fa1f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17557, "upload_time": "2016-02-15T14:09:11", "url": "https://files.pythonhosted.org/packages/94/fc/9adea437295a1ab67c45114bc057350175de3eec072018c9d6e58db0b612/mosaik-hdf5-0.3.tar.gz" } ] }