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.3-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b304289b58267ed278f69c9fd3e51946d749828fe7bf70bcc018e88b3902b8 |
|
MD5 | 44d2111fa572e1d8c64969d9994fe0d3 |
|
BLAKE2b-256 | ca9688cd6c36239de29f567cdc83bb9ac327af829db535eba469897b47d8a1bc |
Hashes for dynareadout-24.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89eda0f8b0723754d8b5dcfae2879195fafe062a5c48b48b97bbe3ec1862a3a1 |
|
MD5 | d5dfc288c03b76090f8ac316b35935b5 |
|
BLAKE2b-256 | de19aaefa43b0d4be9c57d365d9944cfe13dcf7befaf21c9685c1f050d4c728f |
Hashes for dynareadout-24.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f3cc8bd3d3ead17d3384560cab11128e2ba65b72e2c06e42dcda44e12b02bde |
|
MD5 | 3f0a598ee44e127cd6d060697a9c9a01 |
|
BLAKE2b-256 | a5d6de31b0058e5c3298f9c85989e74b1f6e52bde61728a6ff0ce36b4d841cd9 |
Hashes for dynareadout-24.3-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c226825ac2597882ef1283928db3e464c297fb0ed659692413432e7827ece13e |
|
MD5 | 4541fdcb8f95d4687102f9ce1f36f19c |
|
BLAKE2b-256 | 9600fcaba45c949b31aab552f5e994811372b8430bfbc12cef337821f3f4e2eb |
Hashes for dynareadout-24.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ec1255bb945990c4bfa8f128dee52458f12345584a4065fb5f79faf8867ee8c |
|
MD5 | 332a673fc319f81cdbfd0c9b360828d8 |
|
BLAKE2b-256 | 0f456c0204b463c7772fde5a4a81cdd383fb35654761372c5d565fa19d4fa082 |
Hashes for dynareadout-24.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75c1a727110f3b960e4fb69d8261e43e3303e54ccfbde616a53c8a4258fded7c |
|
MD5 | 4780b87e48063d6ad0d34d2026f5c582 |
|
BLAKE2b-256 | 749263ae920850dc3cda56963d89a43100e6df09e1591303977e1850dbdee11d |
Hashes for dynareadout-24.3-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22b25063a3ed88b786e69a99267e54cd9f0e0055fd60f7f0d9d1af4fafb66ee0 |
|
MD5 | a886cac5d3c8dfefdf97665507eb68fa |
|
BLAKE2b-256 | 515d02c64d20a4da2c6fee8525f6a7fcbb2733080dffcff91a5b3d622793d740 |
Hashes for dynareadout-24.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f750cee5ea667a542c336aff46055ccf20ef25a40c16fd95f4a319ccea0049ce |
|
MD5 | 042d823ce7bbf7086b2d2bd6d540f9f2 |
|
BLAKE2b-256 | b1e11ed82506f9ab50b898c5f2b42e6fdee0f2e705df8979c7fe393d5c60512e |
Hashes for dynareadout-24.3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c84712e4ff3e4ea704efb478b1cc012e10dc3ebd42f0586b74eb28613aad0173 |
|
MD5 | 30bb1603849f95f3c50840faf0d85b77 |
|
BLAKE2b-256 | d7cd84c2145bd5f4ffd3e72257b0eaef8b45566f9f96a6b89fc55e97129d0055 |
Hashes for dynareadout-24.3-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 976c08ae1920384263584dcff18085b5af47385dedab96a76296f52b018264d7 |
|
MD5 | 3b73c2e1d1554c3220a8a3f27b1dd9c7 |
|
BLAKE2b-256 | d65eaae27fcc8337afb26214fa92d6f1a936c370a7c0999a0bc79efe55290858 |
Hashes for dynareadout-24.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0ad33e56cb74c3a177f7fb07cda1997676a64e9cbecba054dbf12bf3019ac8e |
|
MD5 | f82954cfd4f4fa2d1ffc72717baf64a5 |
|
BLAKE2b-256 | 9ea1c1a4ab346d175b03372ba270ff3c3a22da573bdce0bfc2fb166be3a3eae2 |
Hashes for dynareadout-24.3-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac5a6fabc0fb15b0f12ae8772de11396573c9b783ce59d392017facc66ad2999 |
|
MD5 | f79bc91883bb66e336ae28c63dbc1991 |
|
BLAKE2b-256 | f07292a0a265803f1192decc541bc69df2d7d86e319ca23d8ee8e07b1791deed |
Hashes for dynareadout-24.3-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89bf128c57f30fd420287904a1bd1508f62e32c2983546a50d69b7437e1d3553 |
|
MD5 | ef6aa7de99fa151cc9eca6ec034ae9ba |
|
BLAKE2b-256 | 7754da2ad3d1a40e5bd3bc2d3c58c08b49984497aaa7a53f0c83d8bb3be75e4d |
Hashes for dynareadout-24.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e031a723c081076cfdafac958a6008858b0a2a4469e906d1767af41025a018bb |
|
MD5 | 59c0e67f734c1b699076532ccdd4a774 |
|
BLAKE2b-256 | f1d31547cf68d20d384cfc40186999c55c9955234314cd1502df669531cea1e5 |
Hashes for dynareadout-24.3-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ecace51a4317be9e3c814e504e82cf6f964bbed97849c57727f77f6960d01b2 |
|
MD5 | c1a1bbddecba06ff4fc2c6000a3491c7 |
|
BLAKE2b-256 | 7eacf3d0b5515344f410c917b634766396c5e1773fc33a34c650d95b5e7962a3 |
Hashes for dynareadout-24.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4d369e4749cd47d7510ad21b3158137f61d942bff4610534a6005baf612008f |
|
MD5 | 07902418ad4b41b31dcda903dc746a03 |
|
BLAKE2b-256 | 680799c82ff5ad0bce8744f3005b21b7fd9b4c33b110b278a522c98cd010adff |
Hashes for dynareadout-24.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7b1ecb53cccc6c16d1a29316060cb095e3c46792ce196b678a723b43e79fdff |
|
MD5 | 93e90bfbc980a948e5ff79b41a826b17 |
|
BLAKE2b-256 | d2332577910446e8e86cbc1f83d62a77cc7857b907e7465f89862c9bb69c8d16 |
Hashes for dynareadout-24.3-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3e81273bb8ecf7b8188d46a7968ff4b947a1e21b0e33a6dc8f176b7ac02d8a3 |
|
MD5 | 024cb84c3f371c7703a8cce59acf0083 |
|
BLAKE2b-256 | a17eb26e1394301140a525b10d021fc18b4a8f629f46f0fc2a0458f06b2f4180 |
Hashes for dynareadout-24.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 046ffcbb4c35388b234960f59e938a70687dd5f4478363020939e02e0fb64be7 |
|
MD5 | 7e1b91b05b9d8cec9bb8049382c35dad |
|
BLAKE2b-256 | d59b0385b8a7657bd3665bfaa163768e3a05abd85776c73438061a893b85fd1b |
Hashes for dynareadout-24.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d8e1f1534308e9849101d9033197e3b5174ba2261a9caf0fe493e14f8c07222 |
|
MD5 | 6f38e77c4312414a1c26f8082bd615f0 |
|
BLAKE2b-256 | cd6f649d6b1ca7529e65050e35c9d88bd629a050fd52251427e9b5e290432f89 |
Hashes for dynareadout-24.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 063cecd11f4e761f0b0fa555a87b8e96353837dbf94644a70e40ffb1b05a23cf |
|
MD5 | e9f6673a35deb042aa8402a17bcf2b5e |
|
BLAKE2b-256 | 7bcc2f69ea6e672a6eca5b57e5e9c1403485a88c4d7de085ea6b6b3f216e7b9e |
Hashes for dynareadout-24.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9434ee0c931f68b71f66f7aa2a2b18d27a71a5a16a29f297c516d2aa38fd2ec7 |
|
MD5 | 681fe893fae5a4f695fa28e3aaf94c1d |
|
BLAKE2b-256 | 4815d219f3509570611526cfc5f0982c4b239ecb71d40237572a9e544db4f273 |
Hashes for dynareadout-24.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29fd0d24f1890395b8bde1769002e8fbed823dd534eb707245490436b4dd39aa |
|
MD5 | fac251ac4f1da1a0094cbad4227adc03 |
|
BLAKE2b-256 | 4efff8cbd457dbb30b09b7796eb2cba74225915f4e40a4d4103c3385f1679b90 |
Hashes for dynareadout-24.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4425bdfe347131a7cc2510b7e32dfb71559572c710f48fe698b0056b484dab3 |
|
MD5 | abf233e786f00ae2988b3399625e16a7 |
|
BLAKE2b-256 | 23e14796e4250f41a428976190984396ee8056ad4e173de172b69d1ab077f9c1 |
Hashes for dynareadout-24.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dd5736442d60e800c8190e37bb88043af421a5a4255ed1b901d3a26877604b6 |
|
MD5 | 102cec7c82324d886df898360742fd37 |
|
BLAKE2b-256 | 2b79769ad4ad919fcd7c0859b6eb19b5bb4a6f38e8f27a09574cb71821f16a93 |
Hashes for dynareadout-24.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5c5c386911461b1ecfb21a8aafd5530905ad3fb410c27de2af7f05adab8f5b |
|
MD5 | 87b96a55cb12d124da0e5be3f0bdcb92 |
|
BLAKE2b-256 | 1f3d34a2aea93048cbc971707d67d42f78a9a73307fb31eeb33d8d7de4e02c7b |
Hashes for dynareadout-24.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2048670c5a6ed8ec8dd4d3d7f41fa6b2c35150aef1b1c60412dd48a3e7378052 |
|
MD5 | cd4eaf641fe3066b8377f0bab9f550c0 |
|
BLAKE2b-256 | 311cedfb42239c459cbd8d6906f4739718b68d2e35063835c583b6d31a341e52 |
Hashes for dynareadout-24.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa7327c8efc357ea9ff77c1a08d2e0a0d8b1bd8bbc6e9c080691126355e942e3 |
|
MD5 | fbbd9713fd842a258dfdfa69918b195d |
|
BLAKE2b-256 | 4b87331f7bb5367a27a7265eb4934d286e247355e440578254c1aded6620160f |
Hashes for dynareadout-24.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1efb8fe1fc48e1565276c54ad845b8d2ea1ad35f68fe53595dcd79f052adffb5 |
|
MD5 | 45e23dd81ec4a304e4a5b1213837d466 |
|
BLAKE2b-256 | 33574e1257a9656f6a86fc4a0cc255bd8d58e559271097bdc7034b0359e4f695 |
Hashes for dynareadout-24.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d03e958fd935cdf40660c6fd8b11934007c800ea8e1f031ea7b77dc4b62f6de |
|
MD5 | 4023b7e5283fe694c60fe02c58e68c3f |
|
BLAKE2b-256 | 6a571bd874a6eccc2d6b2e3af223ccaa0fae0e74190b58694d82320eac2d20c2 |
Hashes for dynareadout-24.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b841c33d25a91f083c66dc1381fd87b046293cb46a173fff7b7647886b8b2d98 |
|
MD5 | afc150085cbe1c62904608aa382f7fd9 |
|
BLAKE2b-256 | 71db1ded2cbb41584696521d1fe0970eef8453c7b622294fc8be3e1125803d5f |
Hashes for dynareadout-24.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e179c7436ca4c64149fa0d5133ec7660e9ad524ac98ac71c1735f366d5a1c0a |
|
MD5 | 907216109ec7e83209a08d3506011ec1 |
|
BLAKE2b-256 | 87cd7359e5ee1bd58b899e5484ec28ce65ad2a1033f736ebc337645fe5443bdb |
Hashes for dynareadout-24.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f33d900f1320c992956b85a36d2aede52521d5e5ef76aa1143204e666c80e77 |
|
MD5 | 8f729aa82a8b1394054b8e5b463a503b |
|
BLAKE2b-256 | c79496e064e68077ead46dac7af832d85e834d551e36f3bd46d4424de3a51fe0 |