Skip to content

Commit

Permalink
Update to version 23.02
Browse files Browse the repository at this point in the history
  • Loading branch information
PucklaJ committed Mar 3, 2023
1 parent 260cfaf commit 14afe6c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "src/dynareadout"]
path = lib/dynareadout
url = https://github.com/PucklaJ/dynareadout.git
branch = 23.01.1
branch = 23.02
[submodule "src/pybind11"]
path = lib/pybind11
url = https://github.com/pybind/pybind11.git
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ 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

```python
from dynareadout import key_file_parse

keywords = key_file_parse("simulation/input.k")

# Parse all nodes
node_keywords = keywords["NODE"]

for i in range(len(node_keywords)):
for j in range(len(node_keywords[i])):
node = node_keywords[i][j]
node_data = node.parse_whole([8, 16, 16, 16])
nid = node_data[0]
x = node_data[1]
y = node_data[2]
z = node_data[3]

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](https://github.com/PucklaJ/dynareadout).
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dynareadout"
version = "23.01.1"
version = "23.02"
authors = [
{ name = "PucklaJ", email = "[email protected]"},
]
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,24 @@
os.path.join(dynareadout_dir, 'src', 'd3plot_data.c'),
os.path.join(dynareadout_dir, 'src', 'd3plot_part_nodes.c'),
os.path.join(dynareadout_dir, 'src', 'd3plot_state.c'),
os.path.join(dynareadout_dir, 'src', 'extra_string.c'),
os.path.join(dynareadout_dir, 'src', 'key.c'),
os.path.join(dynareadout_dir, 'src', 'path.c'),
os.path.join(dynareadout_dir, 'src', 'path_view.c'),
# C++ Source Files
os.path.join(dynareadout_dir, 'src', 'cpp', 'binout.cpp'),
os.path.join(dynareadout_dir, 'src', 'cpp', 'd3plot.cpp'),
os.path.join(dynareadout_dir, 'src', 'cpp', 'd3plot_part.cpp'),
os.path.join(dynareadout_dir, 'src', 'cpp', 'key.cpp'),
# C++ Source Files for pybind11 module
os.path.join(dynareadout_dir, 'src', 'python', 'pybind11_binout.cpp'),
os.path.join(dynareadout_dir, 'src', 'python', 'pybind11_d3plot.cpp'),
os.path.join(dynareadout_dir, 'src', 'python', 'pybind11_key.cpp'),
os.path.join(dynareadout_dir, 'src', 'python', 'pybind11_module.cpp'),
])

setup(name='dynareadout',
version='23.01.1',
version='23.02',
ext_modules=[dynareadout_c],
zip_safe=False,
include_package_data=True)

0 comments on commit 14afe6c

Please sign in to comment.