Elastica Pipelines#

PyPI Status Python Version License

Read the documentation at https://elastica-pipelines.readthedocs.io/ Tests Codecov

pre-commit Black

Features#

IO#

  • Lazy loading of simulation time-series data generated by Elastica++ applications

  • Track a single, or a subset, or whole group of rods, over time using familiar slicing API

Installation#

You can install Elastica Pipelines via pip from PyPI:

$ pip install elastica-pipelines

Usage#

Please see the Command-line Reference for details.

IO#

Python3 Python3 API: Alpha

from elastica_pipelines import io

# ...

# Read only access to data written by Elastica++
series = io.series(metadata="elastica_metadata.h5")

# use series like a python Mapping
for t, snapshot in series.iterations():
    print("Iteration: {0} at time {1}".format(t.iterate, t.time))

    # Snapshot is a mapping contain system types such as CosseratRods & Spheres
    # Here we access only cosserat rods
    for rod_id, rod in snapshot.cosserat_rods().items(): # snapshot['CosseratRod'] also works!
        if rod_id == 0:
            print("  Rod '{0}' attributes:".format(rod_id))
            # even rod is a Mapping, get its keys
            print("  {0}".format(list(rod.keys())))
        print("  Rod '{0}' position:".format(rod_id), rod['Position'])

Contributing#

Contributions are very welcome. To learn more, see the Contributor Guide.

License#

Distributed under the terms of the MIT license, Elastica Pipelines is free and open source software.

Issues#

If you encounter any problems, please file an issue along with a detailed description.

Credits#

This project was generated from @cjolowicz’s Hypermodern Python Cookiecutter template.