Compare commits
4 Commits
045b0c0228
...
c598978543
Author | SHA1 | Date | |
---|---|---|---|
c598978543 | |||
c7ad0f0e37 | |||
4218f529ea | |||
c95341c9b9 |
@ -19,5 +19,5 @@ from .error import GridError as GridError
|
|||||||
from .grid import Grid as Grid
|
from .grid import Grid as Grid
|
||||||
|
|
||||||
__author__ = 'Jan Petykiewicz'
|
__author__ = 'Jan Petykiewicz'
|
||||||
__version__ = '1.1'
|
__version__ = '1.2'
|
||||||
version = __version__
|
version = __version__
|
||||||
|
@ -297,7 +297,7 @@ class GridDrawMixin(GridPosMixin):
|
|||||||
p = numpy.array([[-dimensions[0], +dimensions[1]],
|
p = numpy.array([[-dimensions[0], +dimensions[1]],
|
||||||
[+dimensions[0], +dimensions[1]],
|
[+dimensions[0], +dimensions[1]],
|
||||||
[+dimensions[0], -dimensions[1]],
|
[+dimensions[0], -dimensions[1]],
|
||||||
[-dimensions[0], -dimensions[1]]], dtype=float) / 2.0
|
[-dimensions[0], -dimensions[1]]], dtype=float) * 0.5
|
||||||
thickness = dimensions[2]
|
thickness = dimensions[2]
|
||||||
self.draw_polygon(cell_data, 2, center, p, thickness, foreground)
|
self.draw_polygon(cell_data, 2, center, p, thickness, foreground)
|
||||||
|
|
||||||
|
@ -29,9 +29,9 @@ if __name__ == '__main__':
|
|||||||
# numpy.linspace(-5.5, 5.5, 10)]
|
# numpy.linspace(-5.5, 5.5, 10)]
|
||||||
|
|
||||||
half_x = [.25, .5, 0.75, 1, 1.25, 1.5, 2, 2.5, 3, 3.5]
|
half_x = [.25, .5, 0.75, 1, 1.25, 1.5, 2, 2.5, 3, 3.5]
|
||||||
xyz3 = [numpy.array([-x for x in half_x[::-1]] + [0] + half_x),
|
xyz3 = [numpy.array([-x for x in half_x[::-1]] + [0] + half_x, dtype=float),
|
||||||
numpy.linspace(-5.5, 5.5, 10),
|
numpy.linspace(-5.5, 5.5, 10, dtype=float),
|
||||||
numpy.linspace(-5.5, 5.5, 10)]
|
numpy.linspace(-5.5, 5.5, 10, dtype=float)]
|
||||||
eg = Grid(xyz3)
|
eg = Grid(xyz3)
|
||||||
egc = eg.allocate(0)
|
egc = eg.allocate(0)
|
||||||
# eg.draw_slab(Direction.z, 0, 10, 2)
|
# eg.draw_slab(Direction.z, 0, 10, 2)
|
||||||
|
@ -94,7 +94,7 @@ class Grid(GridDrawMixin, GridReadMixin, GridPosMixin):
|
|||||||
Raises:
|
Raises:
|
||||||
`GridError` on invalid input
|
`GridError` on invalid input
|
||||||
"""
|
"""
|
||||||
edge_arrs = [numpy.asarray(cc) for cc in pixel_edge_coordinates]
|
edge_arrs = [numpy.array(cc) for cc in pixel_edge_coordinates]
|
||||||
self.exyz = [numpy.unique(edges) for edges in edge_arrs]
|
self.exyz = [numpy.unique(edges) for edges in edge_arrs]
|
||||||
self.shifts = numpy.array(shifts, dtype=float)
|
self.shifts = numpy.array(shifts, dtype=float)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import pytest # type: ignore
|
# import pytest
|
||||||
import numpy
|
import numpy
|
||||||
from numpy.testing import assert_allclose #, assert_array_equal
|
from numpy.testing import assert_allclose #, assert_array_equal
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user