Skip to content

Commit 23bf438

Browse files
committed
fix ameba suggestions
1 parent e4ac42e commit 23bf438

File tree

6 files changed

+10
-15
lines changed

6 files changed

+10
-15
lines changed

spec/mirror_spec.cr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@ module Symm32
1919
end
2020

2121
it "mirror acts on vectorlike" do
22-
vec = Vector3.new(1, 1, 1)
23-
point = ChiralPoint.new(vec)
2422
res = m.transform({1, 1, 1})
2523
res[0].should be_close(-1, 2*Float64::EPSILON)
2624
res[1].should be_close(-1, 2*Float64::EPSILON)
2725
res[2].should be_close(-1, 2*Float64::EPSILON)
2826
end
2927

3028
it "mirror inverts if vectorlike is 'chiral'" do
31-
vec = Vector3.new(1, 1, 1)
32-
point = ChiralPoint.new(vec)
3329
res = m.transform({1, 1, 1}, [:chiral])
3430
res[0].should be_close(1, 2*Float64::EPSILON)
3531
res[1].should be_close(1, 2*Float64::EPSILON)

spec/point_group_spec.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module Symm32
3232
end
3333

3434
it "selects directions given axes and sorts by enum" do
35-
axes = [Axis::D1, Axis::Z, Axis::Origin]
35+
axes = [Axis::D1, Axis::Z, Axis::ORIGIN]
3636
pg2m.select_directions(axes).first.axis.should eq Axis::Z
3737
end
3838

spec/point_isometry_spec.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Symm32
2020

2121
it "is not created from an invalid string (general)" do
2222
expect_raises(ArgumentError) do
23-
iso = PointIsometry.parse("foos")
23+
PointIsometry.parse("foos")
2424
end
2525
end
2626
end

src/axis.cr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module Symm32
1313

1414
# :nodoc:
1515
module Axes
16-
Origin = Vector3.new(0, 0, 0)
16+
ORIGIN = Vector3.new(0, 0, 0)
1717
Z = Vector3.new(0, 0, 1)
1818
# plane perpendicular to z
1919
T0 = Vector3.new(1, 0, 0)
@@ -59,7 +59,7 @@ module Symm32
5959
# is for me to try to explain it in text here.
6060
#
6161
# The names can be visualized by imagining a cube. We first designate
62-
# the center of the cube as the `Origin`. All point isometries leave this point
62+
# the center of the cube as the `ORIGIN`. All point isometries leave this point
6363
# unchanged. Next we select an axis which passes through the origin and the
6464
# center of a face and call this the `Z` axis.
6565
#
@@ -74,8 +74,8 @@ module Symm32
7474
# We orient this square so that the edge corresponding to the T0 face is
7575
# on our right and the edge corresponding to T90 is on top. There are two
7676
# more kinds of axes we are interested in, those which pass through the center
77-
# of one of these 4 edges (as well as the `Origin`) and those which pass through
78-
# one of the 4 diagonals (and the `Origin`).
77+
# of one of these 4 edges (as well as the `ORIGIN`) and those which pass through
78+
# one of the 4 diagonals (and the `ORIGIN`).
7979
#
8080
# The center-edge axes we'll call "edge" axes, and number them `E1`, `E2`,
8181
# `E3`, and `E4` with `E1` on our right (corresponding to the `T0` face), `E2`
@@ -89,7 +89,7 @@ module Symm32
8989
# Thus the enum is essentially this:
9090
# ```
9191
# enum Axis
92-
# Origin # => {0, 0, 0}
92+
# ORIGIN # => {0, 0, 0}
9393
# Z # => {0, 0, 1}
9494
# T0 # => {1, 0, 0}
9595
# T30 # => {√3/2, 1/2, 0}

src/point_group.cr

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ module Symm32
108108
end
109109

110110
private def init_directions
111-
by_axis = isometries.group_by { |iso| iso.responds_to?(:axis) ? iso.axis : Axis::Origin }
111+
by_axis = isometries.group_by { |iso| iso.responds_to?(:axis) ? iso.axis : Axis::ORIGIN }
112112
dirs = by_axis.compact_map do |axis, iso_arr|
113-
next if axis == Axis::Origin
113+
next if axis == Axis::ORIGIN
114114
Direction.new(axis, iso_arr)
115115
end
116116
dirs.sort_by(&.axis)
@@ -162,7 +162,6 @@ module Symm32
162162
end
163163

164164
# fill the table with results from the map
165-
size = isometries.size
166165
@multiplication_table = Hash2DIsometry.new
167166
isometries.each do |inv_row_iso|
168167
row_iso = @inverses_hash[inv_row_iso]

src/point_isometry.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ module Symm32
7171
private def self.parse_axis(direction, bar)
7272
# remove kind => mt30 => t30, -4z => z
7373
direction = bar ? direction[2..-1] : direction[1..-1]
74-
return Axis::Origin if direction == "" # e and i have no axis
74+
return Axis::ORIGIN if direction == "" # e and i have no axis
7575

7676
dir_char = direction[0]
7777
return Axis::Z if dir_char == 'z'

0 commit comments

Comments
 (0)