pucklaj / dynareadout_python Goto Github PK
View Code? Open in Web Editor NEWPython package of dynareadout for uploading to PyPI
License: zlib License
Python package of dynareadout for uploading to PyPI
License: zlib License
Issue:
In some cases, while reading multiple binout file, not returning anything.
Not even showing any error.
Here I have shared my code and binout files.
Kindly check the issue.
Code:
import numpy as np
# import matplotlib.pyplot as plt
import csv
from dynareadout import Binout
bin_file_path = r"binout*"
def open_binout(file_path):
bin_file = None
try:
bin_file = Binout(file_path)
except RuntimeError as e:
print(f"Failed to open binout at {file_path}: {e}")
exit(1)
return bin_file
bin_file = open_binout(bin_file_path)
node_ids_displacement = bin_file.read("rbdout/ids")
global_dx = bin_file.read("rbdout/global_dx")
num_timesteps_displacement = len(global_dx)
node_ids_custom = [6, 7]
force_data_array = np.array([[x_disp[n] for x_disp in global_dx] for n in range(len(node_ids_custom))])
result_curve = np.abs(force_data_array[0] - force_data_array[1])
#--------------------------------------------
node_ids_force = bin_file.read("bndout/velocity/rigidbodies/ids")
x_force = bin_file.read("bndout/velocity/rigidbodies/x_force")
num_timesteps_force = len(x_force)
x_force_array = np.array(x_force)
for n, node_id in enumerate(node_ids_force):
force_data = [x_forc[n] for x_forc in x_force_array]
# plt.plot(result_curve, force_data, label="Result")
# plt.xlabel('Displacement')
# plt.ylabel('Force')
# plt.legend()
# plt.title('Force vs Displacement')
# plt.show()
csv_data = np.column_stack((result_curve, force_data))
csv_header = ["Displacement", "Force"]
with open("force_vs_displacement.csv", mode="w", newline='') as file:
writer = csv.writer(file)
writer.writerow(csv_header)
writer.writerows(csv_data)
print("File has been Written Successfully")
Kinldy help abou the issues. we did have full access to the linux machine.
pip install dynareadout
Defaulting to user installation because normal site-packages is not writeable
Collecting dynareadout
Using cached dynareadout-23.12.tar.gz (266 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: dynareadout
Building wheel for dynareadout (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /home/siddharth.l/.local/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpv732drtn
cwd: /tmp/pip-install-vnt99m3e/dynareadout_589c4ed632944d7bb328c99db15526e4
Complete output (36 lines):
running bdist_wheel
running build
running build_clib
building 'dynareadout_c' library
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/lib
creating build/temp.linux-x86_64-3.6/lib/dynareadout
creating build/temp.linux-x86_64-3.6/lib/dynareadout/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/binary_search.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/binary_search.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/binout_directory.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/binout_directory.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/binout_glob.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/binout_glob.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/binout_read.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/binout_read.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/binout.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/binout.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/d3_buffer.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/d3_buffer.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/d3plot_data.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/d3plot_data.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/d3plot_part_nodes.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/d3plot_part_nodes.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/d3plot_state.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/d3plot_state.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/d3plot.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/d3plot.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/extra_string.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/extra_string.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/include_transform.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/include_transform.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/key.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/key.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/line.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/line.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/multi_file.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/multi_file.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/path_view.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/path_view.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/path.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/path.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/string_builder.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/string_builder.o -ansi -w
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ilib/dynareadout/src -c lib/dynareadout/src/sync.c -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/sync.o -ansi -w
ar rcs build/temp.linux-x86_64-3.6/libdynareadout_c.a build/temp.linux-x86_64-3.6/lib/dynareadout/src/binary_search.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/binout_directory.o build/t emp.linux-x86_64-3.6/lib/dynareadout/src/binout_glob.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/binout_read.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/binout.o build/temp.linux-x86 _64-3.6/lib/dynareadout/src/d3_buffer.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/d3plot_data.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/d3plot_part_nodes.o build/temp.linux-x86_64- 3.6/lib/dynareadout/src/d3plot_state.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/d3plot.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/extra_string.o build/temp.linux-x86_64-3.6/lib/dyn areadout/src/include_transform.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/key.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/line.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/mult i_file.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/path_view.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/path.o build/temp.linux-x86_64-3.6/lib/dynareadout/src/string_builder.o build /temp.linux-x86_64-3.6/lib/dynareadout/src/sync.o
running build_ext
building 'dynareadout' extension
creating build/temp.linux-x86_64-3.6/lib/dynareadout/src/cpp
creating build/temp.linux-x86_64-3.6/lib/dynareadout/src/python
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -m tune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/tmp/pip-install-vnt99m3e/dynareadout_589c4ed632944d7bb328c99db15526e4/lib/pybind11/include -Ilib/dynareadout/src -Ilib/dynareadout/src/cpp -I/us r/include/python3.6m -c lib/dynareadout/src/cpp/binout.cpp -o build/temp.linux-x86_64-3.6/lib/dynareadout/src/cpp/binout.o -std=c++17 -w
gcc: error: unrecognized command line option ‘-std=c++17’
error: command 'gcc' failed with exit status 1
ERROR: Failed building wheel for dynareadout
Failed to build dynareadout
ERROR: Could not build wheels for dynareadout, which is required to install pyproject.toml-based projects
'
Hello, thanks for this great library!
I was trying to parse an old .key file, that has this keyword
*MAT_PIECEWISE_LINEAR_PLASTICITY
$ mid ro e pr sigy etan eppf tdel
1 7.830E-06 200.0 0.3 0.366 0.750
when I run this line to load all values:
mid , ro, e, pr, sigy, etan, eppf, tdel = material.parse_whole([10, 10, 10, 10, 10, 10, 10, 10])
I get an error:
mid , ro, e, pr, sigy, etan, eppf, tdel = node.parse_whole([10, 10, 10, 10, 10, 10, 10, 10])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Trying to parse 8 values out of card " 1 7.830E-06 200.0 0.3 0.366 0.750" with
If I add a 0 at the end of the card (so that tdel
is defined) then all is good.
Can this be handled automatically?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.