Skip to content

Commit

Permalink
replace list(set()) with np.unique() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
kip-hart committed Sep 2, 2022
1 parent 29e1998 commit 4937a69
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_.

`1.5.6`_ - 2022-09-01
--------------------------
Fixed
'''''''
- Bug in RasterMesh VTK writer.

`1.5.5`_ - 2022-08-31
--------------------------
Changed
Expand Down Expand Up @@ -286,7 +292,8 @@ Added

.. LINKS
.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.5...HEAD
.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.6...HEAD
.. _`1.5.6`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.5...v1.5.6
.. _`1.5.5`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.4...v1.5.5
.. _`1.5.4`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.3...v1.5.4
.. _`1.5.3`: https://github.com/kip-hart/MicroStructPy/compare/v1.5.2...v1.5.3
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def find_version(*fname):
'aabbtree>=2.5.0',
'pybind11', # must come before meshpy for successful install
'lsq-ellipse',
'matplotlib>=3.0.0',
'matplotlib>=3.3.0',
'meshpy>=2018.2.1',
'numpy>=1.13.0',
'pygmsh>=7.0.2',
Expand Down
2 changes: 1 addition & 1 deletion src/microstructpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
import microstructpy.seeding
import microstructpy.verification

__version__ = '1.5.5'
__version__ = '1.5.6'
3 changes: 2 additions & 1 deletion src/microstructpy/meshing/trimesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,8 @@ def write(self, filename, format='txt', seeds=None, polymesh=None):
pt_fmt = '{: f} {: f} {: f}\n'

# Dimensions
coords = [list(set(ax)) for ax in zip(*self.points)]
pts = np.array(self.points)
coords = [np.unique(ax) for ax in pts.T]
if len(coords) < 3:
coords.append([0]) # force z=0 for 2D meshes
dims = [len(c) for c in coords]
Expand Down

0 comments on commit 4937a69

Please sign in to comment.