Skip to content

Commit 66cacf9

Browse files
authored
Merge pull request #51 from open-lasso-python/release/2.0.2
Release/2.0.2
2 parents 079560e + 8e8ccc9 commit 66cacf9

File tree

7 files changed

+867
-1229
lines changed

7 files changed

+867
-1229
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ venv.bak/
7575
# Ignore generated changelog
7676
CHANGELOG.md
7777

78-
# a custom testing file with non-public files
78+
# Custom test file
7979
test/read_write_test.py

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
|test-main| |test-dev|
66

7-
.. |test-main| image:: https://github.com/open-lasso-python/lasso-python/actions/workflows/test-runner.yml/badge.svg?branch=main
7+
.. |test-main| image:: https://github.com/open-lasso-python/lasso-python/actions/workflows/ci-cd.yml/badge.svg?branch=main
88
:target: https://github.com/open-lasso-python/lasso-python/actions/workflows/test-runner.yml
99

10-
.. |test-dev| image:: https://github.com/open-lasso-python/lasso-python/actions/workflows/test-runner.yml/badge.svg?branch=dev
10+
.. |test-dev| image:: https://github.com/open-lasso-python/lasso-python/actions/workflows/ci-cd.yml/badge.svg?branch=dev
1111
:target: https://github.com/open-lasso-python/lasso-python/actions/workflows/test-runner.yml
1212

1313
This python library is designed for general purpose usage in the field of

lasso/dimred/hashing_sphere.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def _create_sphere_mesh(diameter: np.ndarray) -> typing.Tuple[np.ndarray, np.nda
3232
beta bin boundaries
3333
"""
3434

35-
assert diameter.dtype == float
35+
assert diameter.dtype == np.float32
3636

3737
# partition latitude
3838
n_alpha = 145
@@ -142,8 +142,8 @@ def sphere_hashing(
142142
# same length as the number of points
143143
assert len(bin_numbers[0] == len(field))
144144
# check data types
145-
assert bin_numbers.dtype == int
146-
assert bin_counts.dtype == float
145+
assert bin_numbers.dtype == np.int
146+
assert bin_counts.dtype == np.float32
147147

148148
n_rows = bin_counts.shape[0]
149149
n_cols = bin_counts.shape[1]

lasso/dyna/d3plot.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -6626,7 +6626,7 @@ def _write_geom_particle_flags(self, fp: typing.IO[Any], settings: D3plotWriterS
66266626
# only the first byte to the ascii char code
66276627
fmt_string = "{0:" + str(settings.wordsize) + "}"
66286628
for name, _ in nlist_names_typecodes:
6629-
name_formatted = fmt_string.format(name).encode("ascii")
6629+
name_formatted = fmt_string.format(name).encode("utf-8")
66306630
for ch in name_formatted:
66316631
barray = bytearray(settings.wordsize)
66326632
barray[0] = ch
@@ -6842,16 +6842,17 @@ def _write_geom_user_ids(self, fp: typing.IO[Any], settings: D3plotWriterSetting
68426842
n_bytes_written += fp.write(settings.pack(nsrtd))
68436843

68446844
if ArrayType.part_ids in self.arrays:
6845-
# some lsdyna material pointer
6846-
nsrma = info.ptr_material_ids
6847-
n_bytes_written += fp.write(settings.pack(nsrma))
6845+
# some lsdyna material pointer - Used by LS-Prepost in labelling materials
68486846

6849-
# some lsdyna material pointer
6850-
nsrmu = info.ptr_material_ids_defined_order
6851-
n_bytes_written += fp.write(settings.pack(nsrmu))
6847+
# Unsorted material ID pointer
6848+
nsrmu = nsrt + settings.header["nelth"]
6849+
# Sorted material ID pointer
6850+
nsrma = nsrmu + settings.header["nmmat"]
6851+
# Mapping array between sorted and unsorted
6852+
nsrmp = nsrma + settings.header["nmmat"]
68526853

6853-
# some lsdyna material pointer
6854-
nsrmp = info.ptr_material_ids_crossref
6854+
n_bytes_written += fp.write(settings.pack(nsrma))
6855+
n_bytes_written += fp.write(settings.pack(nsrmu))
68556856
n_bytes_written += fp.write(settings.pack(nsrmp))
68566857

68576858
# "Total number of materials (parts)"
@@ -7382,7 +7383,7 @@ def _write_header_part_contact_interface_titles(
73827383
max_len = 18 * title_wordsize
73837384
fmt_name = "{0:" + str(max_len) + "}"
73847385
for pid, title in zip(part_titles_ids, part_titles):
7385-
title = title.decode("ascii")
7386+
title = title.decode("utf-8")
73867387
n_bytes_written += fp.write(settings.pack(pid))
73877388

73887389
formatted_title = fmt_name.format(title[:max_len])

lasso/dyna/test_mapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def test_others(self):
387387
strain1 = np.random.randn(1, 2)
388388
strain2 = np.random.randn(1, 2)
389389

390-
history_vars = np.array([[1, 2], [0, 3], [12, 2]], dtype=float)
390+
history_vars = np.array([[1, 2], [0, 3], [12, 2]], dtype=np.float32)
391391

392392
history_vars1 = np.random.randn(3, 2)
393393
history_vars2 = np.random.randn(3, 2)

0 commit comments

Comments
 (0)