Skip to content

Commit b4e83ab

Browse files
committed
rename to TwoRollPass
1 parent fa987ce commit b4e83ab

5 files changed

Lines changed: 75 additions & 66 deletions

File tree

pyroll/core/roll_pass/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from .base import BaseRollPass
2-
from .roll_pass import RollPass
3-
from .asymmetric_roll_pass import AsymmetricRollPass
2+
from .two_roll_pass import TwoRollPass
3+
from .asymmetric_two_roll_pass import AsymmetricTwoRollPass
44
from .three_roll_pass import ThreeRollPass
55
from .deformation_unit import DeformationUnit
66

77
from . import hookimpls
88

9+
RollPass = TwoRollPass
10+
911

1012

pyroll/core/roll_pass/asymmetric_roll_pass.py renamed to pyroll/core/roll_pass/asymmetric_two_roll_pass.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from ..roll import Roll as BaseRoll
99

1010

11-
class AsymmetricRollPass(BaseRollPass):
11+
class AsymmetricTwoRollPass(BaseRollPass):
1212
"""Represents a symmetric roll pass with equal upper and lower working roll."""
1313

1414
def __init__(
@@ -26,7 +26,6 @@ def __init__(
2626
self.lower_roll = self.Roll(lower_roll, self)
2727
"""The upper working roll of this pass."""
2828

29-
3029
@property
3130
def contour_lines(self) -> List[LineString]:
3231
if self._contour_lines:
@@ -42,21 +41,29 @@ def contour_lines(self) -> List[LineString]:
4241
return self._contour_lines
4342

4443
@property
45-
def disk_elements(self) -> List['AsymmetricRollPass.DiskElement']:
44+
def classifiers(self):
45+
"""A tuple of keywords to specify the shape type classifiers of this roll pass.
46+
Shortcut to ``self.groove.classifiers``."""
47+
return set(self.upper_roll.groove.classifiers) | set(self.lower_roll.groove.classifiers) | {"asymmetric"}
48+
49+
@property
50+
def disk_elements(self) -> List['AsymmetricTwoRollPass.DiskElement']:
4651
"""A list of disk elements used to subdivide this unit."""
4752
return list(self._subunits)
4853

4954
class Profile(BaseRollPass.Profile):
5055
"""Represents a profile in context of a roll pass."""
5156

5257
@property
53-
def roll_pass(self) -> 'AsymmetricRollPass':
58+
def roll_pass(self) -> 'AsymmetricTwoRollPass':
5459
"""Reference to the roll pass. Alias for ``self.unit``."""
55-
return cast(AsymmetricRollPass, self.unit)
60+
return cast(AsymmetricTwoRollPass, self.unit)
5661

5762
class InProfile(Profile, BaseRollPass.InProfile):
5863
"""Represents an incoming profile of a roll pass."""
5964

65+
vertical_displacement = Hook[float]
66+
6067
class OutProfile(Profile, BaseRollPass.OutProfile):
6168
"""Represents an outgoing profile of a roll pass."""
6269

@@ -66,25 +73,25 @@ class Roll(BaseRollPass.Roll):
6673
"""Represents a roll applied in a :py:class:`RollPass`."""
6774

6875
@property
69-
def roll_pass(self) -> 'AsymmetricRollPass':
76+
def roll_pass(self) -> 'AsymmetricTwoRollPass':
7077
"""Reference to the roll pass."""
71-
return cast(AsymmetricRollPass, self._roll_pass())
78+
return cast(AsymmetricTwoRollPass, self._roll_pass())
7279

7380
class DiskElement(BaseRollPass.DiskElement):
7481
"""Represents a disk element in a roll pass."""
7582

7683
@property
77-
def roll_pass(self) -> 'AsymmetricRollPass':
84+
def roll_pass(self) -> 'AsymmetricTwoRollPass':
7885
"""Reference to the roll pass. Alias for ``self.parent``."""
79-
return cast(AsymmetricRollPass, self.parent)
86+
return cast(AsymmetricTwoRollPass, self.parent)
8087

8188
class Profile(BaseRollPass.DiskElement.Profile):
8289
"""Represents a profile in context of a disk element unit."""
8390

8491
@property
85-
def disk_element(self) -> 'AsymmetricRollPass.DiskElement':
92+
def disk_element(self) -> 'AsymmetricTwoRollPass.DiskElement':
8693
"""Reference to the disk element. Alias for ``self.unit``"""
87-
return cast(AsymmetricRollPass.DiskElement, self.unit)
94+
return cast(AsymmetricTwoRollPass.DiskElement, self.unit)
8895

8996
class InProfile(Profile, BaseRollPass.DiskElement.InProfile):
9097
"""Represents an incoming profile of a disk element unit."""

pyroll/core/roll_pass/hookimpls/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from . import base_roll_pass
2-
from . import roll_pass
2+
from . import two_roll_pass
33
from . import three_roll_pass
44
from . import profile
55
from . import roll

pyroll/core/roll_pass/hookimpls/asymmetric_roll_pass.py renamed to pyroll/core/roll_pass/hookimpls/asymmetric_two_roll_pass.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
from shapely import Polygon
33

44
from . import helpers
5-
from ..asymmetric_roll_pass import AsymmetricRollPass
5+
from ..asymmetric_two_roll_pass import AsymmetricTwoRollPass
66
from ...grooves import GenericElongationGroove
77

88

9-
@AsymmetricRollPass.usable_width
10-
def usable_width(self: AsymmetricRollPass):
9+
@AsymmetricTwoRollPass.usable_width
10+
def usable_width(self: AsymmetricTwoRollPass):
1111
return min(self.upper_roll.groove.usable_width, self.lower_roll.groove.usable_width)
1212

1313

14-
@AsymmetricRollPass.tip_width
15-
def tip_width(self: AsymmetricRollPass):
14+
@AsymmetricTwoRollPass.tip_width
15+
def tip_width(self: AsymmetricTwoRollPass):
1616
if isinstance(self.upper_roll.groove, GenericElongationGroove) and isinstance(
1717
self.lower_roll.groove, GenericElongationGroove
1818
):
@@ -22,47 +22,47 @@ def tip_width(self: AsymmetricRollPass):
2222
)
2323

2424

25-
@AsymmetricRollPass.usable_cross_section
26-
def usable_cross_section(self: AsymmetricRollPass) -> Polygon:
25+
@AsymmetricTwoRollPass.usable_cross_section
26+
def usable_cross_section(self: AsymmetricTwoRollPass) -> Polygon:
2727
return helpers.out_cross_section(self, self.usable_width)
2828

2929

30-
@AsymmetricRollPass.tip_cross_section
31-
def tip_cross_section(self: AsymmetricRollPass) -> Polygon:
30+
@AsymmetricTwoRollPass.tip_cross_section
31+
def tip_cross_section(self: AsymmetricTwoRollPass) -> Polygon:
3232
return helpers.out_cross_section(self, self.tip_width)
3333

3434

35-
@AsymmetricRollPass.gap
36-
def gap(self: AsymmetricRollPass):
35+
@AsymmetricTwoRollPass.gap
36+
def gap(self: AsymmetricTwoRollPass):
3737
if self.has_set_or_cached("height"):
3838
return self.height - self.upper_roll.groove.depth - self.lower_roll.groove.depth
3939

4040

41-
@AsymmetricRollPass.height
42-
def height(self: AsymmetricRollPass):
41+
@AsymmetricTwoRollPass.height
42+
def height(self: AsymmetricTwoRollPass):
4343
if self.has_set_or_cached("gap"):
4444
return self.gap + self.upper_roll.groove.depth + self.lower_roll.groove.depth
4545

4646

47-
@AsymmetricRollPass.contact_area
48-
def contact_area(self: AsymmetricRollPass):
47+
@AsymmetricTwoRollPass.contact_area
48+
def contact_area(self: AsymmetricTwoRollPass):
4949
return self.upper_roll.contact_area + self.lower_roll.contact_area
5050

5151

52-
@AsymmetricRollPass.target_cross_section_area
53-
def target_cross_section_area_from_target_width(self: AsymmetricRollPass):
52+
@AsymmetricTwoRollPass.target_cross_section_area
53+
def target_cross_section_area_from_target_width(self: AsymmetricTwoRollPass):
5454
if self.has_value("target_width"):
5555
target_cross_section = helpers.out_cross_section(self, self.target_width)
5656
return target_cross_section.area
5757

5858

59-
@AsymmetricRollPass.power
60-
def roll_power(self: AsymmetricRollPass):
59+
@AsymmetricTwoRollPass.power
60+
def roll_power(self: AsymmetricTwoRollPass):
6161
return self.upper_roll.roll_power + self.lower_roll.roll_power
6262

6363

64-
@AsymmetricRollPass.entry_point
65-
def entry_point(self: AsymmetricRollPass):
64+
@AsymmetricTwoRollPass.entry_point
65+
def entry_point(self: AsymmetricTwoRollPass):
6666
height_change = self.in_profile.height - self.height
6767
return (
6868
np.sqrt(height_change)
@@ -74,8 +74,8 @@ def entry_point(self: AsymmetricRollPass):
7474
) / (2 * (self.upper_roll.min_radius + self.lower_roll.min_radius - height_change))
7575

7676

77-
@AsymmetricRollPass.entry_point
78-
def entry_point_square_oval(self: AsymmetricRollPass):
77+
@AsymmetricTwoRollPass.entry_point
78+
def entry_point_square_oval(self: AsymmetricTwoRollPass):
7979
if "square" in self.in_profile.classifiers and "oval" in self.classifiers:
8080
upper_depth = self.upper_roll.groove.local_depth(self.in_profile.width / 2)
8181
lower_depth = self.lower_roll.groove.local_depth(self.in_profile.width / 2)
@@ -92,8 +92,8 @@ def entry_point_square_oval(self: AsymmetricRollPass):
9292
) / (2 * (upper_radius + lower_radius - height_change))
9393

9494

95-
@AsymmetricRollPass.velocity
96-
def velocity(self: AsymmetricRollPass):
95+
@AsymmetricTwoRollPass.velocity
96+
def velocity(self: AsymmetricTwoRollPass):
9797
if self.upper_roll.has_value("neutral_angle") and self.lower_roll.has_value("neutral_angle"):
9898
return (
9999
self.upper_roll.working_velocity * np.cos(self.upper_roll.neutral_angle)
@@ -103,8 +103,8 @@ def velocity(self: AsymmetricRollPass):
103103
return (self.upper_roll.working_velocity + self.lower_roll.working_velocity) / 2
104104

105105

106-
@AsymmetricRollPass.roll_force
107-
def roll_force(self: AsymmetricRollPass):
106+
@AsymmetricTwoRollPass.roll_force
107+
def roll_force(self: AsymmetricTwoRollPass):
108108
return (
109109
(self.in_profile.flow_stress + 2 * self.out_profile.flow_stress)
110110
/ 3

pyroll/core/roll_pass/hookimpls/roll_pass.py renamed to pyroll/core/roll_pass/hookimpls/two_roll_pass.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,83 @@
22
from shapely import Polygon
33

44
from . import helpers
5-
from ..roll_pass import RollPass
5+
from ..two_roll_pass import TwoRollPass
66
from ...grooves import GenericElongationGroove
77

88

9-
@RollPass.usable_width
10-
def usable_width(self: RollPass):
9+
@TwoRollPass.usable_width
10+
def usable_width(self: TwoRollPass):
1111
return self.roll.groove.usable_width
1212

1313

14-
@RollPass.tip_width
14+
@TwoRollPass.tip_width
1515
def tip_width(self):
1616
if isinstance(self.roll.groove, GenericElongationGroove):
1717
return self.roll.groove.usable_width + self.gap / 2 / np.tan(self.roll.groove.flank_angle)
1818

1919

20-
@RollPass.usable_cross_section
21-
def usable_cross_section(self: RollPass) -> Polygon:
20+
@TwoRollPass.usable_cross_section
21+
def usable_cross_section(self: TwoRollPass) -> Polygon:
2222
return helpers.out_cross_section(self, self.usable_width)
2323

2424

25-
@RollPass.tip_cross_section
26-
def tip_cross_section(self: RollPass) -> Polygon:
25+
@TwoRollPass.tip_cross_section
26+
def tip_cross_section(self: TwoRollPass) -> Polygon:
2727
return helpers.out_cross_section(self, self.tip_width)
2828

2929

30-
@RollPass.gap
31-
def gap(self: RollPass):
30+
@TwoRollPass.gap
31+
def gap(self: TwoRollPass):
3232
if self.has_set_or_cached("height"):
3333
return self.height - 2 * self.roll.groove.depth
3434

3535

36-
@RollPass.height
36+
@TwoRollPass.height
3737
def height(self):
3838
if self.has_set_or_cached("gap"):
3939
return self.gap + 2 * self.roll.groove.depth
4040

4141

42-
@RollPass.contact_area
43-
def contact_area(self: RollPass):
42+
@TwoRollPass.contact_area
43+
def contact_area(self: TwoRollPass):
4444
return 2 * self.roll.contact_area
4545

4646

47-
@RollPass.target_cross_section_area
48-
def target_cross_section_area_from_target_width(self: RollPass):
47+
@TwoRollPass.target_cross_section_area
48+
def target_cross_section_area_from_target_width(self: TwoRollPass):
4949
if self.has_value("target_width"):
5050
target_cross_section = helpers.out_cross_section(self, self.target_width)
5151
return target_cross_section.area
5252

5353

54-
@RollPass.power
55-
def roll_power(self: RollPass):
54+
@TwoRollPass.power
55+
def roll_power(self: TwoRollPass):
5656
return 2 * self.roll.roll_power
5757

5858

59-
@RollPass.entry_point
60-
def entry_point(self: RollPass):
59+
@TwoRollPass.entry_point
60+
def entry_point(self: TwoRollPass):
6161
height_change = self.in_profile.height - self.height
6262
return np.sqrt(self.roll.min_radius * height_change - height_change ** 2 / 4)
6363

6464

65-
@RollPass.entry_point
66-
def entry_point_square_oval(self: RollPass):
65+
@TwoRollPass.entry_point
66+
def entry_point_square_oval(self: TwoRollPass):
6767
if "square" in self.in_profile.classifiers and "oval" in self.classifiers:
6868
depth = self.roll.groove.local_depth(self.in_profile.width / 2)
6969
height_change = self.in_profile.height - self.gap - 2 * depth
7070
radius = self.roll.max_radius - depth
7171
return np.sqrt(radius * height_change - height_change ** 2 / 4)
7272

7373

74-
@RollPass.velocity
75-
def velocity(self: RollPass):
74+
@TwoRollPass.velocity
75+
def velocity(self: TwoRollPass):
7676
if self.roll.has_value("neutral_angle"):
7777
return self.roll.working_velocity * np.cos(self.roll.neutral_angle)
7878
else:
7979
return self.roll.working_velocity
8080

8181

82-
@RollPass.roll_force
83-
def roll_force(self: RollPass):
82+
@TwoRollPass.roll_force
83+
def roll_force(self: TwoRollPass):
8484
return (self.in_profile.flow_stress + 2 * self.out_profile.flow_stress) / 3 * self.roll.contact_area

0 commit comments

Comments
 (0)