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.4-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e06c6cca611d90762f4e60dec9a7383bcd769ffe019afffe8e5b80192da8082d |
|
MD5 | cb8b119f7b8a458db7401bee3576f44f |
|
BLAKE2b-256 | 072919d7f7ca4ff777d067a7f1ba6a11a796ee39f63400866929f0be94cb1d26 |
Hashes for dynareadout-24.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f76295448930e5aaee5f3da8874df552249b512169b2c8a98e4cad725ae7e14 |
|
MD5 | 15fdc08023ef5a2f5cafdcd384bb60e8 |
|
BLAKE2b-256 | b87fa19dcf47a7c6d66169859db894e04ff26f7a7b71352705e92dc503dd6451 |
Hashes for dynareadout-24.4-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56f9a3e456af27fff631aa1b1973b5bad8ccd64fbac5b6c2a6c44d17cd2a20dc |
|
MD5 | be1b078111e47fd4a4943eb675d200f4 |
|
BLAKE2b-256 | 82a6aa1dad8697f171a7f8ac93c8ffef351093e757f9ad3044e7332ff4008e92 |
Hashes for dynareadout-24.4-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93f39baba0595de39276e2b8fa710cded1ccb68cec958d537dce7331e78aaf63 |
|
MD5 | ee005325c85dea4783d59ad87f485ec2 |
|
BLAKE2b-256 | efb3eade0468c469efc20e7a60f65b619c4848cdcc9397262660233210535cbf |
Hashes for dynareadout-24.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d43c3081c2891b046b5180f45a0dabf60ef9d822350cd344a76d38d94366296e |
|
MD5 | 0febd8b00ea87b05478cf5adbbe55e54 |
|
BLAKE2b-256 | 9abbc6b8a4b5570509e4e4190fd02b056c05b5f6096cdbbb789a68dfc7b47c20 |
Hashes for dynareadout-24.4-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 658a94775e67f880442b938bbeeaa504100b0818cd00da62722ce7ff50ace568 |
|
MD5 | 8eecf541000e1e1b13fe23fa126042cc |
|
BLAKE2b-256 | ee4e5ab570155d234c7af3716d2523fbd00f0284635b6ae150894ffaf6e930a9 |
Hashes for dynareadout-24.4-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2aacba41bec245fcf9b27d3c9b3d8c6b0d90ba01110dde98ac8a80b798bf255 |
|
MD5 | 8e573529919e7d78a2aa029ff24ae65f |
|
BLAKE2b-256 | 0385f20ff1cb3d6f2c4549a48146e6d40fec5d5208efc1e203fdf608c05e585e |
Hashes for dynareadout-24.4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc4aac60c7d8c48503a693cf9480d8b946190c4c56516285c3659a060d33eefa |
|
MD5 | 53b60aa461421ac60dd12141a0d1d8cd |
|
BLAKE2b-256 | b6cd774726f3b2f7c4078b9128e04681842b4750a26e63f25e9f272bebc0249e |
Hashes for dynareadout-24.4-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d628254b5cfb3f792fdd479dad9ac797f9d2ba2c3901f6fd3d724ad783b228e |
|
MD5 | d2b8bd40e156f2e3fcb2b5aae1da12d5 |
|
BLAKE2b-256 | 3d0af5ad99c2e10e691c3cf27ca46e94a428bed993662722126c11e821144a5c |
Hashes for dynareadout-24.4-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3563d42faaf2b02a5854366c30423b81667cf0dccc7eb9093cdefaaf4eb448cd |
|
MD5 | 3b1091717ee77e3fc2bffa4b7340ff27 |
|
BLAKE2b-256 | c81545dabd584e306acfde62f30c5144657d6f3a6953806fcfb01eecdb68f132 |
Hashes for dynareadout-24.4-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30c8e9406d4d6152bb28514868aa856ffa3fe1ca116a84ba66d2fe770bfc055d |
|
MD5 | 9920012bbf24f16087fdb0566dd7277d |
|
BLAKE2b-256 | c82488eba75dfd30fd02e9de9e11c2706c81fa569819e76ae73e3ee298f032e0 |
Hashes for dynareadout-24.4-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0a0559a16ca07feed29016418b95e2de14be88a5a461d881d2f57616c90487b |
|
MD5 | 18d6c5be83e99a7727e80f0c31271804 |
|
BLAKE2b-256 | d77605089aa141821297e546d1816bd11c331209bacad393f4c5ffe08ce3a6b6 |
Hashes for dynareadout-24.4-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 310874a948c6fb50ccc63317c89cce62d937d69c269d1f2b94e2cf0930461a8b |
|
MD5 | 737e7e71f899f7b552926cbfa160e529 |
|
BLAKE2b-256 | de9ff56e88f28473efddad139f9dc3d46774102d3096e31def8217efb399b08b |
Hashes for dynareadout-24.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 289465cbb6d3f964696406dfd861acb0ff55fc830ae90fbf0532da1c0b1d2619 |
|
MD5 | 6ecec96974cb056b5ae07dfdef6183c6 |
|
BLAKE2b-256 | a7ddb5542f9936b58906bab913eba16e4de2b2f4cf7fbf24f301a44ca0fa4b5e |
Hashes for dynareadout-24.4-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 692dd32e8156be0ec7c1e4ac6b8ce65b2717bf3195c5b64db735e47d70386951 |
|
MD5 | 43a80920491071c09324dd0c4c21443a |
|
BLAKE2b-256 | 1cd6b8c63e762fc0227946505918d1766df01c363faa4fea097742a0b1ede9aa |
Hashes for dynareadout-24.4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bb44cc27f61ba9bc12da02590e76b69cee281679a8a94de4d4cde96e8150c55 |
|
MD5 | efd335f9a213734f9ce51af17490418e |
|
BLAKE2b-256 | 9b1a8b8e88b1c7184bcd2e1d9b5a6d46a4660d9ee3f7541247dec32aeec622ff |
Hashes for dynareadout-24.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff5ca0cc05a047309591e6418b0e81a062b560db64e9aeb89de94c70fd9da19 |
|
MD5 | fceed91659f4f26828a773efc4acea30 |
|
BLAKE2b-256 | 1222bd492d9600b8bbda7cba5fc67235613c38e1d003ffc914b4b06a4d603044 |
Hashes for dynareadout-24.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60b660c0571ed8340886a856bce04cb7a348dc3d6a884f4f2ab33f3ee0652074 |
|
MD5 | b03e087720d34f2530d1042386eb4ec6 |
|
BLAKE2b-256 | 8a6426c40309e7f7056d82d5db6542adbedadafaf81d1ef6ef686492ed9d26f7 |
Hashes for dynareadout-24.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e08d9c04f1c0dba9edb735978f7b9bc947cce3256140c66e6f05b7251b45875 |
|
MD5 | faa76551958cbcf013c7a0d4747e73b9 |
|
BLAKE2b-256 | cb15925f10e7198bf0a1e9ced39926a414d0e39c5c225f6935609d125f81ab21 |
Hashes for dynareadout-24.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28396fb4caa34c7770a1bbbbf2f27d49f2097f5d01a09033973c8c948cdada38 |
|
MD5 | b944c7dc0669111309985e052316c081 |
|
BLAKE2b-256 | f476e32a7afb63c38597fb3d4e197f49e9a382520ec86b06b76cbb0136769b9d |
Hashes for dynareadout-24.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f02c5745c370a6993c5365d1382bc623b6bde93e34560705f27d740a7d34af6 |
|
MD5 | c6a01f267b706f97ee138492746f2730 |
|
BLAKE2b-256 | 9c5e7f6bd129cd210394b6f987ac698b884da1b60b1143f7f4faa51a05dfee2c |
Hashes for dynareadout-24.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d25a12c6b34fbaec2ab512bb181af137f4386fba2e2ab47d9e2a6055a376d32 |
|
MD5 | a2d14ba80ed41788e8efd8f1e95b0824 |
|
BLAKE2b-256 | d285a9757ee9c2abf28bbb660822eb37b294dd02cac08c550751a0ea1a5a0803 |
Hashes for dynareadout-24.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49534107696e6660397575d98c3f6c830d017bc5d498964da26b0931c4183fdb |
|
MD5 | 7099c849394b49410d29089f8afcb043 |
|
BLAKE2b-256 | 125a9b31b0e1488d0873a7e71db8c0f803d3c6b6a19ef5480dc0e79e93dadfd2 |
Hashes for dynareadout-24.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd0a79bf798db321b77e48f8360fc89165ad4caef975c187228bf899e806750a |
|
MD5 | 322d9dd517ceb1bbc418315585c040a0 |
|
BLAKE2b-256 | 667b735402ba0983add2a1be10efa4913ca629801ed027a2eb722285952cd311 |
Hashes for dynareadout-24.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeca19516ef4b27084987d87e693cabc9a55fb9b5fec2b147537f9ab7e0dba81 |
|
MD5 | 78927c4dfd86844498efa7a5479857b2 |
|
BLAKE2b-256 | 246295f8aa8ceef90423d5d27c5a3912b312bafa7eedbc41dc06c16fd8a9f0cf |
Hashes for dynareadout-24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c9bd5fc1ad32549a04a218b4b32c8785a6fae3c3f2ce1ca4da0d520cbea27b |
|
MD5 | 0010ecabcfb75effb20b6aae73f84758 |
|
BLAKE2b-256 | de00d0e710191f6920ac574fbe4e54bb902a61817baf361745a433bfd075b9f8 |
Hashes for dynareadout-24.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24708a7a953bbd5a6a4e170825a440bb833ddd328da5e43da4f52a017c1158aa |
|
MD5 | 641b3396323bea70fd97c4e621a663aa |
|
BLAKE2b-256 | 2d48df02376631871b2b93fa3675b0580a34715575c5ae6333d0326a1e128717 |
Hashes for dynareadout-24.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c9effaf5ff11e06b196200582ee42b455ce5327c1579fc61bf187b84ace92d1 |
|
MD5 | 0be342847ce7c48309afede452874901 |
|
BLAKE2b-256 | fc95534b0eee46e1a6bae87023e4b45ea71ae8fcd18f73c3745072dd18b7a198 |
Hashes for dynareadout-24.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb1e337a5542b93eb7dac2c9b5955c43339109121457dcc916dbe595e7aa4e77 |
|
MD5 | e128418a8a2a25295f014f292d3232e3 |
|
BLAKE2b-256 | a682dbb6816a25b3e55e9f9ff14e9175997a3ce2984d1493f7db90b36853013d |
Hashes for dynareadout-24.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcd1ec32fab9bc13f5d1676ae7cc222ad59802db5ea9ba3496b2a510da12df20 |
|
MD5 | 4835a5f9a4682a32df0c79055f3cd225 |
|
BLAKE2b-256 | 64a2350908aacc81897eb9991f40276ca3defe2f84f0d1e38c6283acba78265d |
Hashes for dynareadout-24.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c89e3f7b85b10fa57fa81d3295d097ad65fd5f717ae90ce72392b3cd628837d9 |
|
MD5 | 9c8afe8eceb99f87a2d651f0d9d00ac7 |
|
BLAKE2b-256 | f61f3518e56e3a156d8bca98cfd1f80122f4c1deab84f35225ace78c7af30503 |
Hashes for dynareadout-24.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 728ea31f23a161edd283afcc6b2546d2e0606f1c9e34c740e8eae56b049f9314 |
|
MD5 | 2372bbbfef4ade7b4817a693511bf6ad |
|
BLAKE2b-256 | 35e4159161b27bb075aa10be763535a941947a989e870c05c11682d42a4d8eb5 |
Hashes for dynareadout-24.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8394df5f72e30b2ed42529b58c2dd121f04af08bbb59b04c57dfb9cfffeb892 |
|
MD5 | 265b83dcb1c38320cd63421e4a728c92 |
|
BLAKE2b-256 | e6c2f3acb6a2e22f574c62865c0b591899622eab3310bec8f7a94e23371f2247 |