Skip to content

Commit

Permalink
Merge pull request #51 from open-lasso-python/release/2.0.2
Browse files Browse the repository at this point in the history
Release/2.0.2
  • Loading branch information
codie3611 authored Mar 4, 2024
2 parents 079560e + 8e8ccc9 commit 66cacf9
Show file tree
Hide file tree
Showing 7 changed files with 867 additions and 1,229 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ venv.bak/
# Ignore generated changelog
CHANGELOG.md

# a custom testing file with non-public files
# Custom test file
test/read_write_test.py
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

|test-main| |test-dev|

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

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

This python library is designed for general purpose usage in the field of
Expand Down
6 changes: 3 additions & 3 deletions lasso/dimred/hashing_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _create_sphere_mesh(diameter: np.ndarray) -> typing.Tuple[np.ndarray, np.nda
beta bin boundaries
"""

assert diameter.dtype == float
assert diameter.dtype == np.float32

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

n_rows = bin_counts.shape[0]
n_cols = bin_counts.shape[1]
Expand Down
21 changes: 11 additions & 10 deletions lasso/dyna/d3plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6626,7 +6626,7 @@ def _write_geom_particle_flags(self, fp: typing.IO[Any], settings: D3plotWriterS
# only the first byte to the ascii char code
fmt_string = "{0:" + str(settings.wordsize) + "}"
for name, _ in nlist_names_typecodes:
name_formatted = fmt_string.format(name).encode("ascii")
name_formatted = fmt_string.format(name).encode("utf-8")
for ch in name_formatted:
barray = bytearray(settings.wordsize)
barray[0] = ch
Expand Down Expand Up @@ -6842,16 +6842,17 @@ def _write_geom_user_ids(self, fp: typing.IO[Any], settings: D3plotWriterSetting
n_bytes_written += fp.write(settings.pack(nsrtd))

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

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

# some lsdyna material pointer
nsrmp = info.ptr_material_ids_crossref
n_bytes_written += fp.write(settings.pack(nsrma))
n_bytes_written += fp.write(settings.pack(nsrmu))
n_bytes_written += fp.write(settings.pack(nsrmp))

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

formatted_title = fmt_name.format(title[:max_len])
Expand Down
2 changes: 1 addition & 1 deletion lasso/dyna/test_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def test_others(self):
strain1 = np.random.randn(1, 2)
strain2 = np.random.randn(1, 2)

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

history_vars1 = np.random.randn(3, 2)
history_vars2 = np.random.randn(3, 2)
Expand Down
Loading

0 comments on commit 66cacf9

Please sign in to comment.