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.7-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f17505709ac9b3b7f00f8b9724b0fcc8eb5918bb9ac86b8459034ac682ba3ebd |
|
MD5 | 0b60b6e672f792c1fa8533fc73bf4ea6 |
|
BLAKE2b-256 | 32c6382e3dd075fd5479dd2f78fcdd5a7f4785a6f9c6ee8461a308847116ccdd |
Hashes for dynareadout-24.7-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e0f3de2c5a56662d303b381847e4e490653743874b1d0da7e75f67962f64d1d |
|
MD5 | d333fb307e726433421e8d28389b065a |
|
BLAKE2b-256 | b6205d456166b4708ce19c4195e8fa98f7d25f9d30396d880e60bb3f631dd2fb |
Hashes for dynareadout-24.7-pp310-pypy310_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19685600686e6b96a97533e76fbc4c5293d15fff4dc68e3583c794ef8b9a22a7 |
|
MD5 | cfd6277b1060993e9929b70aa9f21189 |
|
BLAKE2b-256 | e9ea060473753ae339020242d3626631f0643832da9b0c89fca78ecec0444327 |
Hashes for dynareadout-24.7-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba52c77cd92bae65fd3c101450bc73b1afdfc35c6b9c561da8cf979bf06ce197 |
|
MD5 | 29598bb8e30353525f47f68aca85e7d8 |
|
BLAKE2b-256 | d3ee5bb67cb44b57c178e1174b82b35492fcf97eb12965be094abe63b81176e8 |
Hashes for dynareadout-24.7-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b24ca972841d838143116ea79386e53b7958a081b67241bf5cf20aa95b3ea2a |
|
MD5 | 3b89b370d6bf3452575216baff984e27 |
|
BLAKE2b-256 | 7c56e7df1e25e476d59ae5213f06c7067da863fe7be708819f1f4e0a63a17530 |
Hashes for dynareadout-24.7-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98f73a3101cc2555d17c46ee912bb5c148ccd6b84a29ac180bb5602ed92475a5 |
|
MD5 | 3c2cdf14f2e16934d42996c55fe89a5f |
|
BLAKE2b-256 | 60a33a8d298a9983b28a3d31156a7b67a1e1bea56b75ae47af5ffd243a1662ff |
Hashes for dynareadout-24.7-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfffc0ea799a845f1375092a96a05b8d9c2baf7a00320fe91db25fc1b62cdb7d |
|
MD5 | 3d1002180756f770e6b23ebae96df3d8 |
|
BLAKE2b-256 | 047e85130a51a068d6f9fe75f3ecd7fa5e261835bccfa73cc7b9e1b4590703fd |
Hashes for dynareadout-24.7-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19c6d36c346295d13a4c3efd62e2eee2ae8d77ba377aaaecc5ea2d81d7917bab |
|
MD5 | 820574383bd28743d59f3a825c091d6b |
|
BLAKE2b-256 | 00c609aff9107ae93fa3133d9701e504ac455ce2ff0341c8bc5f935a69c3b4a6 |
Hashes for dynareadout-24.7-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18b1cc4414ab356d7fc910655c800b58af054f63046d0c218e6c956ebb66cd7a |
|
MD5 | fc3b3db17216385179936b61a56d4d00 |
|
BLAKE2b-256 | e7ca62eec0738652140eee2b0425e7377e22ccfd8f44398eb63c1120b0bb25e0 |
Hashes for dynareadout-24.7-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c86f4d1e249496a8a1db60e5f7496e5547ce9c77a7390ae1acc7a0a987639ea7 |
|
MD5 | 877f12c4bd163a3f38b1ae4950b5a41c |
|
BLAKE2b-256 | 6aa77e920b6b9084e335d9abfd54f7fdc42f2833c142114a7c8db468cd7eea5a |
Hashes for dynareadout-24.7-pp38-pypy38_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ca35b6e66b6b6934b847b3ddad72e488ee5249cea09370675c750e13c636e52 |
|
MD5 | 67da291272ed532fddbbdd1df86bd15d |
|
BLAKE2b-256 | 35ddfdcccfe497593dd648d573a09055e26910cec8850c3d279e16a513022eb2 |
Hashes for dynareadout-24.7-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9dae057e84093a6aa5f23faa2341ae77fe3f1820ec1c406c485d8c38934a60e |
|
MD5 | 045ff99b76e0b01a3190c89543c55da7 |
|
BLAKE2b-256 | 89e002a10b58d4f2508f4e7fea1f24486791f83e20f3d8b32282fe520d52561b |
Hashes for dynareadout-24.7-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e892ba38b9ee9584ac69115a894ca6ee06237d3d6c9a4d50bda8c745f1d23203 |
|
MD5 | 86b1981fd9d28aa4d3cd2a9d21762008 |
|
BLAKE2b-256 | 5112b91ad0bf596bd340b1eb7ca21d2bcd8ed2d65c88cd26265eb543e95bbb55 |
Hashes for dynareadout-24.7-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 330855363199c537a632793a6ef19b0a6439e3601bbb50d37e0ffcc4fab59d20 |
|
MD5 | 01ca17bbb6c9eef661635694c753f8cd |
|
BLAKE2b-256 | db5c1d9255796f32dab2712f32ce7707a299b6574a801e88dadb5ef5b245dff4 |
Hashes for dynareadout-24.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aebdd9bf3708f21f1890e7cabe23c934b9210ecae8a257c60e7f302048bc740 |
|
MD5 | ba76876c94bc2152278723bcd5966349 |
|
BLAKE2b-256 | b06a63080a418eb40adea5d7341c43e6c5e0e75e2191ae3f5873138e7c70807f |
Hashes for dynareadout-24.7-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bbd6d80c194e9b3bf28d49a72a2fa00c81503e0cb7c4f46ee83007bf1f3c4b8 |
|
MD5 | 02c0918a63aaf1f5cda3fcc58aa3bc13 |
|
BLAKE2b-256 | 6a21df203456a2913c0508257b2ed04db84a1cacceffefde8aa170e08473e057 |
Hashes for dynareadout-24.7-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e6ee3d53dc40a89a593a7ebe28e1d3049d0422f63a4ad6a2ec047e402780094 |
|
MD5 | 724928a8d58dd8d4f2d103906ae0c1b8 |
|
BLAKE2b-256 | fc66545f76917622eeed9e5bec144db901832f05721f8ba5504979d52c344149 |
Hashes for dynareadout-24.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3ef16c131e0015ee58e85bc721d0ec7d9a453b38cd47c9e655cbb68e09814aa |
|
MD5 | bb3f1f755a74bcaa00d50cbc5f33e642 |
|
BLAKE2b-256 | af454e39b3f34a9712fd6aedf72242b998f634dafdaf2a4beed03b80ce2dc2be |
Hashes for dynareadout-24.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca0f4b6a6c17972af167dbb4738ebc1fb24c93e9c2f2c3955e1c40b60dbb6b50 |
|
MD5 | bc9eb7de3f35c28b8eaa1e7da2b7ae3e |
|
BLAKE2b-256 | fb106f1a83226f22a4215df232c738b6b96f71e818c26e8de354df94b60859c3 |
Hashes for dynareadout-24.7-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5b263efe063bdcc6b60dc82254d6e8e2c88da5b6f5b759cb3a534ba260fae34 |
|
MD5 | 6f9d8360c8b7c982418c015c6973c3c8 |
|
BLAKE2b-256 | 9039c6e954ca159bdf25accc277f2dcedde2b712587a29d58ca98c6d42320cf2 |
Hashes for dynareadout-24.7-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d85755ac79cee54e35f243978b377da075a6b148042c184d5bdd262b29f86862 |
|
MD5 | 0ba9edf5ac052b99b292c6de6de411a3 |
|
BLAKE2b-256 | d82404599916a168dd74834a5b4b8df8482e4dba07f84d0886e8930da6cede44 |
Hashes for dynareadout-24.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9e6659f40fc7a4a5ec823d5d870958af0be7a5958656a8988568a12eaa22abc |
|
MD5 | f0a36b5abe376d87ccc1b8a0a89a777f |
|
BLAKE2b-256 | 08384dc69292e2d8b7501092d5798797f386adbcad003ff28ca941360a8b1f8a |
Hashes for dynareadout-24.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6811f212916cd16361aad8f34a34985cec3981b3b807804d5cf470192d0a623f |
|
MD5 | 408d575d842ea8f46ee802c34cfdb9f3 |
|
BLAKE2b-256 | 407ed16692452b9b859b4e13b8f7ad36a53bb5f650ce3e6f4b2d600afa7a927d |
Hashes for dynareadout-24.7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a75b03ccc083f6fad13110fd7ea908c9cc628f0bb1e98277b170270384a5a1f8 |
|
MD5 | fb8ab306e4c1452b9228a4c343ffa9cd |
|
BLAKE2b-256 | d172389c489cbc4bb0d3667b060fc28d29000ac87baa912677d8d1eb8aedce78 |
Hashes for dynareadout-24.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b45042a1391cc99670a5e174325c7db567398e38dc6cc4244a790326254aea7 |
|
MD5 | 125e9d51518ac539fa4ca368c4a9f3fe |
|
BLAKE2b-256 | d7ee36cf0f3e9c5e222e012bdc04d8535363888e5d33041ddc9e3ca450b12d14 |
Hashes for dynareadout-24.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2672c59424b0dc8881bca1027cf94b2736fc71a8615f4bff4ee8a55ad0e05812 |
|
MD5 | 25ff53fe9be069928911a1319a211b6b |
|
BLAKE2b-256 | 9242936a2ff012791755544191927a339fc9db982cb5ba93cc6bc9c292d6d0bb |
Hashes for dynareadout-24.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c9a5f5e6b8d7ae44311ebbe94d41a6667b5a291f97212a340b17989326f507a |
|
MD5 | e0b58334932a226b96dbe8a700cdda48 |
|
BLAKE2b-256 | cf425f0d2906a1ce4353d601cd914efdc3dc6fc44e5bad4ddba0d5a4bdacb9db |
Hashes for dynareadout-24.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4076b5b12a7a5ee266d52e041b7df84113486865d7bd3a85b71ff947ae85f4d4 |
|
MD5 | 8d7d88c1ea918879779552abe8084b04 |
|
BLAKE2b-256 | a581538b7230929ead85882601d243fdda9e708e7c35abb307bde08c0359f0f9 |
Hashes for dynareadout-24.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c78a47cc33fc1408eb6be01f61b7859c971bec77bf52f41bba870440768c152a |
|
MD5 | 9cf0e188dbeff7793a15a2b7290912f9 |
|
BLAKE2b-256 | 967248116a39bedacf08ad8915b6a26bdd1d06b924bdaabda6a4fdc5b2d7157d |
Hashes for dynareadout-24.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e9fb31e83dfc8a1bac8fd9e1f07c528de07050b9e5400f16cc96cede8a967c2 |
|
MD5 | 1e8702cb1f50fb5fba7fc4011411a84d |
|
BLAKE2b-256 | eebe7913dfc0ff620ceda7a4fdcc3c56ad389304ac648d506f3c6045631a6434 |
Hashes for dynareadout-24.7-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0500501578772e5ccde41edc070a783487eb234365cd426bbc9b32aac66c397 |
|
MD5 | 57c6db77b384bc4c0460673522a12c36 |
|
BLAKE2b-256 | 5566d2dcfd76a15617d1c26c06ab697b7c3513503aa18156edaffedc790beaaf |
Hashes for dynareadout-24.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8156e940d9f9e82fa47328112650369a2f3e653c1c022846275257c8e4c03dfe |
|
MD5 | 84ed6e61160a5caa1515480189c58f71 |
|
BLAKE2b-256 | a2883773f87cb7c6a15da59b1ec45f95a199f1460101ac72a004d690c136174b |