High-Performance and Thread-Safe library for parsing binary output files and key files of LS Dyna (d3plot, binout, input deck)
Project description
dynareadout
High-Performance and Thread-Safe C/C++ library for parsing binary output files and key files of LS Dyna (d3plot, binout, input deck) with bindings for python.
Documentation
You can find a Wiki with API Documentation for python.
Examples
Binout
from dynareadout import Binout
bin_file = None
try:
# This library also supports opening multiple binout files at once by globing them
bin_file = Binout("path/to/your/binout*")
except RuntimeError as e:
print("Failed to open binout: {}".format(e))
exit(1)
# Print the children of the binout
children = bin_file.read()
for (i, child) in enumerate(children):
print("Child {}: {}".format(i, child))
# Read some data. This method can read variables of all different types
node_ids = bin_file.read("nodout/ids")
for i in range(len(node_ids)):
print("Node ID {}: {}".format(i, node_ids[i]))
# You can also find out if a variable exists
node_ids_exist = bin_file.variable_exists("nodout/ids")
# Get the number of time steps in the binout
nodout_timesteps = bin_file.get_num_timesteps("nodout")
# The time steps can vary inside the binout
rcforc_timesteps = bin_file.get_num_timesteps("rcforc")
# If you want to read "timed" data (x_displacement, x_force, etc.) you can do so also with the read method
x_displacement = bin_file.read("nodout/x_displacement")
for (t, time_step) in enumerate(x_displacement):
for (n, x_disp) in enumerate(time_step):
print("X Displacement time_step={}, node_id={}: {}".format(t, node_ids[n], x_displacement[t][n]))
D3plot
from dynareadout import D3plot
plot_file = None
try:
# Just give it the first d3plot file and it opens all of them
plot_file = D3plot("path/to/your/d3plot")
except RuntimeError as e:
print("Failed to open: {}".format(e))
exit(1)
# Read the title
title = plot_file.read_title()
print("Title: {}".format(title))
# Read node ids
node_ids = plot_file.read_node_ids()
print("Nodes: {}".format(len(node_ids)))
for (i, nid) in enumerate(node_ids):
print("Node {}: {}".format(i, nid))
# Read node coordinates of time step 10
node_coords = plot_file.read_node_coordinates(10)
for i in range(len(node_coords)):
print("Node Coords {}: ({:.2f}, {:.2f}, {:.2f})".format(i, node_coords[i][0], node_coords[i][1], node_coords[i][2]))
KeyFile
from dynareadout import key_file_parse
keywords = key_file_parse("path/to/your/input.k")
# Parse all nodes
node_keywords = keywords["NODE"]
# Loop over all *NODE keywords
for i in range(len(node_keywords)):
# Loop over all cards of each *NODE keyword
for j in range(len(node_keywords[i])):
node = node_keywords[i][j]
# Then you can parse the variables of each card as integers and floats
# The list of integers holds all the widths of each variable in the card in characters
nid, x, y, z = node.parse_whole([8, 16, 16, 16])
print(f"NODE {nid:d}: ({x:.3f}; {y:.3f}; {z:.3f})")
Other languages
This library is also available for C and C++ this version can be found here.
Installation
python -m pip install dynareadout
Uploading to PyPI
-
Make sure that the dynareadout submodule has the correct version
-
Update the version in
setup.py
andpyproject.toml
. Also check if new source files have been added -
Publish a new release
-
Create source distribution
python setup.py sdist
- Upload to
test.pypi.org
python -m twine upload --repository testpypi dist/*
Then insert __token__
as username and the token as password.
- Install package from
test.pypi.org
to test it
python -m pip install --upgrade --no-build-isolation --index-url https://test.pypi.org/simple/ dynareadout
-
If it works upload it to
pypi.org
-
Create windows wheel
python -m build
-
Upload windows wheel to
test.pypi.org
and test it. -
If it works upload it to
pypi.org
python -m twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for dynareadout-24.5-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b5aa4721be319abcdef1c2b11306e1c5e6d98ec1ad0f9e9dcfe4cbe7c80d673 |
|
MD5 | f29c4f4606e06dc28cb03551bb377245 |
|
BLAKE2b-256 | 8bf47e283511b4654ef59b361d5ac3efcd41133df273bc39b310f2e5bf5fee22 |
Hashes for dynareadout-24.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f97ce5d4941fbd1dc1e8ebbe97630ef87d162bc2c13b083bc18f29ea01d694bf |
|
MD5 | 2097d3ea4092404b8adde819ced88743 |
|
BLAKE2b-256 | 8fcd7a7ea0cad24b8b1f05aeae64601cf0620108fd3c7c616aa269c2b8666bc2 |
Hashes for dynareadout-24.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6862cf76f17617c6ca9db44644da971d97296118a68eb7b13b9929e38f0a98e0 |
|
MD5 | 772ab1ef7d773cac475d80a4667318b6 |
|
BLAKE2b-256 | 5bd075beb94f9bac37101d42f5960989ecde68a6923b8aac330b3e15ec6b8469 |
Hashes for dynareadout-24.5-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a365cae961f60d964672ba0f9fd9fe9d7db85608f3549bd7645ca7c7d53aac40 |
|
MD5 | de0c3a3e97e0eb9a31f32f2e9ba08efb |
|
BLAKE2b-256 | 922c5111bf5ed94f38cee7f9178cf74110f86d247c5ba7a39d1a7463b9fc85d5 |
Hashes for dynareadout-24.5-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c316a3cff264f8609878cb5f9bfa7a69a5366f15b2a3d7b65ffbc33b454a0158 |
|
MD5 | eb33e5138b537cd3a913ede2cd82417a |
|
BLAKE2b-256 | 557a4a3a99e743f7fe4ecdadeac2171d6357e7dd7cd7e34055b35b9730e68551 |
Hashes for dynareadout-24.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e86a220cf5757011609926233201108a931a68662cc8aa53066e286e7a2dbc4 |
|
MD5 | 6061e5219bac50bb5035753ebdbfd109 |
|
BLAKE2b-256 | bb0fbe314737805bf1a239e4b4c18cd03bf687ab1d58291fa477edcdb0b7dd2a |
Hashes for dynareadout-24.5-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6426babd060d3615693564eeec14ae7a07da7197937ef43dd54218a54f9cc652 |
|
MD5 | 73edaa20ec63eebb7f13d7f63fb710a0 |
|
BLAKE2b-256 | 216ff582bc338cf179196346d67f6024bf59859e9b594117e1098f5dabeea4dc |
Hashes for dynareadout-24.5-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f18710c6ca6febc2fd9e8b76d7ca8ca29f65feda64ade06094dee91cf45dddd |
|
MD5 | 0e3227e82137ff68f22e5bcc79a36102 |
|
BLAKE2b-256 | d93872cd8b4e5d8902c745397913311b084e0b47ab74907773f6bdee088dafea |
Hashes for dynareadout-24.5-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8e0500edc2c4479ba8250da96b0fb93f6c1bc481d92fed72817b177310059e2 |
|
MD5 | 816096efc73c4709db604a686f1844ba |
|
BLAKE2b-256 | df024d4d58bc2cc51a79f2b6113582d989b5e33189d8aba4065d804f741141bb |
Hashes for dynareadout-24.5-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59f0b4e94c47f7e18f217a376af6265fd60aeb21dd5215d487a6fa20c7a2e89d |
|
MD5 | a7d115d8ac4268344f6e1394d1143e3e |
|
BLAKE2b-256 | 6a5f803aa6dad1e99cb8134e26e0adc815ab42152ea7e4e5627e2ce3d57b415a |
Hashes for dynareadout-24.5-pp38-pypy38_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce8b19e889465d45f02b597c50d956836252a5ab7e0fa0af52f3bae72f8666a0 |
|
MD5 | 446131b774db5631d1df088fd5334071 |
|
BLAKE2b-256 | d929fef0fcfcddd480b1a00d553ee73ffd66ec9265b01cb72584231a39e99794 |
Hashes for dynareadout-24.5-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be5e813c99152c56ff2dd230972e6e592b3367a194c3dd5b32d18d93598081c4 |
|
MD5 | 56e3507bf3e0d779452c2851480de0f0 |
|
BLAKE2b-256 | d1fcaca87c6b959b0b6ca7110228236d968d5c05241fe550ad874be3b7a94697 |
Hashes for dynareadout-24.5-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc7a82c4af6cc866b3efe6c0ef7a9649afabbc1d4e489c523acd7961e7cfab76 |
|
MD5 | c8f3635d1fe7a4179c4f3128478be697 |
|
BLAKE2b-256 | 2ff309aedd15836ec1b7edbdb7661cc03ad528cbfae25cdb89b6a38ca9bc60d6 |
Hashes for dynareadout-24.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9985f30b95fea0e3bc343945f863f9178bfb6a6dfa271b173d3dfa7031086ef |
|
MD5 | 05793e5b19d5a3797d5cb3ac6d2880a3 |
|
BLAKE2b-256 | 3c119dc53c696c3ab4c8fbd2fd05656119159e30b0fee6152b3169f774489902 |
Hashes for dynareadout-24.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1e3d35129a7f76da7bd38654c4109bcb2eb9c36adb40cba835e93fb75f3406f |
|
MD5 | c05fc0df3bea6dec193be32d3fc82b5f |
|
BLAKE2b-256 | 73abaafce87314b408f70f628bce1709cd279b33f9a7d97bd855555f35b43f52 |
Hashes for dynareadout-24.5-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd6871ea8d4daaf6c6160e8d05312199a2b832b49fb36787a2ab6fb6ef098128 |
|
MD5 | 1a3a2ac226c88fcc35a48d8d0ceea30d |
|
BLAKE2b-256 | 54dc79093d3ee014d79efd93006bdb5e81187501c54f4a2a6d8ae1243ba676e8 |
Hashes for dynareadout-24.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4845e6194f6dc1c7487b2e96869e2abac862dfc9887ca7112138d354bfd593b3 |
|
MD5 | 9bd6da878d514eca28b9a4bf56e89fb7 |
|
BLAKE2b-256 | 43f2cb89f35b9ccfb5f5a43fbc25030688e6d52d51e4754a181e24e6a98f462d |
Hashes for dynareadout-24.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 392274f737b0a18028d29812cdb5e1e376683a56acc81b75b8a44bbb644634f9 |
|
MD5 | a5093c2a8111036b6cbc91211e17ed34 |
|
BLAKE2b-256 | 8f27e2ab7e2d9a6506fa9a95549f706fc2623fbdb87458c0cc7e1916be147997 |
Hashes for dynareadout-24.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08f10795e01fbbfbe977a554118de28605a60017091d01b5eea7b5445bede3c8 |
|
MD5 | c21c779d1ecc65fa75f96ab0d3e64a91 |
|
BLAKE2b-256 | a848f582831cf00d69e630308cce137cf34d847824a5165f0aef9b75d4f856f1 |
Hashes for dynareadout-24.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ffa9758fbd74427401f0f76645a3f054224b9639aee058c0f029f3114148011 |
|
MD5 | 0120b4ac189066f0bf5ff7a9904ef426 |
|
BLAKE2b-256 | 291e5e87e470af071572e412ed6e21434aebceb89f5aeb41dc0b193e8b9e3c12 |
Hashes for dynareadout-24.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d361683f3d977e7115b9ea095f778ff7ca8fb8c4b08e55f75e1c0bd507f2750d |
|
MD5 | 8aa05a17d80348d50d2b2c9d80397083 |
|
BLAKE2b-256 | 9149e12a59f982f40addbee8ddf3bf5119e5d38f12d20e2a0f2923633119541b |
Hashes for dynareadout-24.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f94b2846d109f4f147b99ac7a676b3c0d4fa7839c76283ff7671b06a33a593dd |
|
MD5 | 801f51ad5526b3ee18dbca2a205620c8 |
|
BLAKE2b-256 | a3dcab3e0691ed70662248f9cc06ed9a1708f6cadd3216d20a179e7840e455e8 |
Hashes for dynareadout-24.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 327680d7f00bfdee4732825d5d948adccb4d289b7998714c787c67bedcf97874 |
|
MD5 | 431f368032a524e6fea6498cb88e1867 |
|
BLAKE2b-256 | 0311a03ad909a42905eba5a0d04c66a31c6eab48e2b02f7a024f21fc7213c86b |
Hashes for dynareadout-24.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5060a645801e222423ce8ad3bd63a7bd5bda859327fbe2a53033ee5d34deefd |
|
MD5 | 7b495825380256497618c9319c8fa31a |
|
BLAKE2b-256 | ae635918ae88259a70e77b45d96639d17cc7456a10248dc3f7a8826d3d9d4a8b |
Hashes for dynareadout-24.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 867aa09e35a4487b5e017b182a00cc12d5623bd0bed63b83fbb312b62b4b4681 |
|
MD5 | 70989d022180f35d20840a224d5d32ae |
|
BLAKE2b-256 | 5da8b9e8e1ce0317fa0cd9ba6746139222160b1e26080825c994642c0cbd5869 |
Hashes for dynareadout-24.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af404eb33aa3e2fef4048e3f58a40156041a7b0a814db7291bd914294fbeed6c |
|
MD5 | 73978e1d048bfed0a9d5c1829ecce687 |
|
BLAKE2b-256 | 9f3435717ecb1f77ce7f7b1ccd64777a76730af31461f3422d5d72140d864c35 |
Hashes for dynareadout-24.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dc4465cb27bdb40476b5006522ba7655f127a99b6796c94f620f5603dbdbc06 |
|
MD5 | 2197f2bf5fd3cc7b860e72455cf8742d |
|
BLAKE2b-256 | 3bd3b98c4b23458a5ab87cc419de8499127505e903cf11b4fee760c0dda0666e |
Hashes for dynareadout-24.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f7cf11ebc23959350db8b73b20bfb2cca491113063ae6cd4db107c545775e67 |
|
MD5 | 5746d56eb001d0f562983e116e2cb636 |
|
BLAKE2b-256 | dc53d569453afd26fe1d508df30ff4b33c2a824100914ef1c6073e8f34414ecf |
Hashes for dynareadout-24.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5af750455fb2eebd214a72a58962468ac95f213e753b8bbfa8f88ccf760985b4 |
|
MD5 | dc52b7ae19e62e0c4d35853e39501062 |
|
BLAKE2b-256 | 363f1d1866ef74db49b1a2dc364b47fd072eeab5994969193d86e72fed2cb1c0 |
Hashes for dynareadout-24.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 331b65eee029e944d175188281ac17e43a9a3a5cc70671957dc745821f65523f |
|
MD5 | 6d2e1d2f464151feb8bca7f5ac4a6883 |
|
BLAKE2b-256 | 58cb403ffc515ce444d80375fd88bde20dfeea72190768fb1b4278c937b1eb23 |
Hashes for dynareadout-24.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf9238d09396d0421e03a8a8855e96a5beeccebc4650da4ddb64269e9b1cd6f9 |
|
MD5 | 006be8072fc464ed250c524b2b4c62c6 |
|
BLAKE2b-256 | 1250b34099707a29b8400f03b28d8a9498e4aaf0473d9b7bdc317c60b51b4a0a |
Hashes for dynareadout-24.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0e3f14bb17863fb696d551bdc6e9caf2d42d9d346b4f0e97e8c4368dc106656 |
|
MD5 | c17b483ad9babf1b50c4a5a72c2cf15c |
|
BLAKE2b-256 | 8fd40675f8e872cd0f6c14b2c2c464b092fbc9723778338c3cac712842b1635e |