pyroll-core 2.1.2.post0__tar.gz → 2.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/PKG-INFO +30 -7
  2. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/README.md +22 -6
  3. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/hatch.toml +3 -4
  4. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyproject.toml +9 -0
  5. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/__init__.py +24 -11
  6. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/config.py +22 -0
  7. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/base.py +36 -14
  8. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/equivalent_ripped_groove.py +8 -0
  9. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/generic_elongation.py +4 -4
  10. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/spline.py +49 -3
  11. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/hooks.py +19 -2
  12. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/profile/hookimpls.py +9 -4
  13. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/profile/profile.py +192 -20
  14. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/repr.py +31 -16
  15. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll/hookimpls.py +4 -4
  16. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/deformation_unit.py +3 -0
  17. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/hookimpls/deformation_unit.py +8 -0
  18. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/hookimpls/helpers.py +3 -2
  19. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/hookimpls/roll.py +3 -3
  20. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/hookimpls/roll_pass.py +43 -1
  21. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/roll_pass.py +140 -54
  22. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/three_roll_pass.py +3 -0
  23. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/sequence/sequence.py +37 -5
  24. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/transport/__init__.py +1 -0
  25. pyroll_core-2.1.4/pyroll/core/transport/cooling_pipe.py +64 -0
  26. pyroll_core-2.1.4/pyroll/core/transport/hookimpls.py +52 -0
  27. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/transport/transport.py +1 -1
  28. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/unit/hookimpls.py +5 -5
  29. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/unit/unit.py +14 -0
  30. pyroll_core-2.1.2.post0/pyroll/core/transport/hookimpls.py +0 -26
  31. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/.gitignore +0 -0
  32. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/LICENSE +0 -0
  33. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/disk_elements/__init__.py +0 -0
  34. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/disk_elements/disk_element_unit.py +0 -0
  35. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/disk_elements/hookimpls.py +0 -0
  36. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/__init__.py +0 -0
  37. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/boxes/__init__.py +0 -0
  38. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/boxes/box.py +0 -0
  39. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/boxes/constricted_box.py +0 -0
  40. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/boxes/upset_box.py +0 -0
  41. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/diamonds/__init__.py +0 -0
  42. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/diamonds/diamond.py +0 -0
  43. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/diamonds/gothic.py +0 -0
  44. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/diamonds/square.py +0 -0
  45. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/flat.py +0 -0
  46. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/generic_elongation_solvers.py +0 -0
  47. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/hexagonal.py +0 -0
  48. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/__init__.py +0 -0
  49. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/circular_oval.py +0 -0
  50. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/constricted_circular_oval.py +0 -0
  51. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/constricted_swedish_oval.py +0 -0
  52. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/flat_oval.py +0 -0
  53. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/oval_3radii.py +0 -0
  54. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/oval_3radii_flanked.py +0 -0
  55. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/swedish_oval.py +0 -0
  56. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/ovals/upset_oval.py +0 -0
  57. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/rounds/__init__.py +0 -0
  58. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/rounds/false_round.py +0 -0
  59. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/grooves/rounds/round.py +0 -0
  60. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/log.py +0 -0
  61. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/profile/__init__.py +0 -0
  62. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll/__init__.py +0 -0
  63. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll/roll.py +0 -0
  64. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/__init__.py +0 -0
  65. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/hookimpls/__init__.py +0 -0
  66. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/hookimpls/disk_element.py +0 -0
  67. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/roll_pass/hookimpls/profile.py +0 -0
  68. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/rotator/__init__.py +0 -0
  69. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/rotator/hookimpls.py +0 -0
  70. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/rotator/rotator.py +0 -0
  71. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/sequence/__init__.py +0 -0
  72. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/sequence/hookimpls.py +0 -0
  73. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/shapes.py +0 -0
  74. {pyroll_core-2.1.2.post0 → pyroll_core-2.1.4}/pyroll/core/unit/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyroll-core
3
- Version: 2.1.2.post0
3
+ Version: 2.1.4
4
4
  Summary: PyRoll rolling simulation framework - core library.
5
5
  Project-URL: Homepage, https://pyroll-project.github.io
6
6
  Project-URL: Repository, https://github.com/pyroll-project/pyroll-core
@@ -25,11 +25,18 @@ Classifier: Programming Language :: Python :: 3.10
25
25
  Classifier: Programming Language :: Python :: 3.11
26
26
  Classifier: Topic :: Scientific/Engineering
27
27
  Requires-Python: >=3.9
28
+ Requires-Dist: ezdxf
28
29
  Requires-Dist: numpy~=1.19
29
30
  Requires-Dist: scipy~=1.9
30
31
  Requires-Dist: shapely~=2.0
32
+ Provides-Extra: matplotlib
33
+ Requires-Dist: matplotlib~=3.7; extra == 'matplotlib'
31
34
  Provides-Extra: plot
32
35
  Requires-Dist: matplotlib~=3.7; extra == 'plot'
36
+ Provides-Extra: plotly
37
+ Requires-Dist: kaleido; extra == 'plotly'
38
+ Requires-Dist: pandas~=2.0; extra == 'plotly'
39
+ Requires-Dist: plotly~=5.18; extra == 'plotly'
33
40
  Description-Content-Type: text/markdown
34
41
 
35
42
  # PyRolL Rolling Simulation Framework
@@ -37,7 +44,10 @@ Description-Content-Type: text/markdown
37
44
  [![PyPI](https://img.shields.io/pypi/v/pyroll-core)](https://pypi.org/project/pyroll-core/)
38
45
  ![Python Versions](https://img.shields.io/pypi/pyversions/pyroll-core)
39
46
  [![License](https://img.shields.io/pypi/l/pyroll-core)](LICENSE)
47
+ [![DOI](https://joss.theoj.org/papers/10.21105/joss.06200/status.svg)](https://doi.org/10.21105/joss.06200)
40
48
  ![Downloads](https://img.shields.io/pypi/dm/pyroll-core)
49
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/7971/badge)](https://www.bestpractices.dev/projects/7971)
50
+
41
51
 
42
52
  Welcome to The PyRolL Project!
43
53
 
@@ -46,6 +56,25 @@ The current focus lies on groove rolling in elongation grooves.
46
56
  The core package includes the basic data structures and algorithms.
47
57
  Further functionality is provided via [extension packages](https://pyroll.readthedocs.io/en/latest/extensions/index.html) and model approaches are provided via [plugin packages](https://pyroll.readthedocs.io/en/latest/plugins/index.html).
48
58
 
59
+ ## Aim and Scope
60
+
61
+ Publications in the field of groove rolling simulation are, to the authors knowledge, characterized by lack of reproducibility, mainly because often details are missing regarding implementation or numerical solution procedure or the provided equations are erroneous.
62
+ Very few authors provide their source code alongside their publications.
63
+ PyRolL aims to change this by providing an open basis for model and methodology development.
64
+ The PyRolL Core package hosted in this repository is the common base dependency to refer to.
65
+ Plugins to the core provide model approaches for the partial problems to be described in a rolling simulation, which include mechanical, thermal, material behavior and more.
66
+ The library of available models is constantly growing and can be extended by everyone.
67
+ Extensions provide application logic and numerical procedures helping to analyse the subject rolling process regarding its technical feasibility, optimization potential, identity error sources, or, to design a new process.
68
+ PyRolL is therefore a tool for model developers, either with broad focus or specialists, wishing to try out for example a new physical material model within a real process simulation, as well as for technologists wishing to investigate a concrete process.
69
+ Currently, there is no click'n'run graphical user interface (GUI) provided, at least basic knowledge of programming in general and Python in particular is needed to use the software.
70
+ Nevertheless, this is also recommended to leverage the full power of PyRolL.
71
+
72
+ ## Documentation
73
+
74
+ See the [documentation](https://pyroll.readthedocs.io/en/latest) to learn about basic concepts and
75
+ usage.
76
+ The documentation of version 1.0 can be found [here](https://pyroll.readthedocs.io/en/stable).
77
+
49
78
  ## Versions
50
79
 
51
80
  The main branch of this repository contains the code of the version 2.0 of PyRolL.
@@ -68,12 +97,6 @@ It is recommended to develop new plugins and extensions only for 2.0.
68
97
  - Introduction of disk elements for incremental modelling in rolling direction.
69
98
  - Nestable units (esp. pass sequences and disk elements).
70
99
 
71
- ## Documentation
72
-
73
- See the [documentation](https://pyroll.readthedocs.io/en/latest) to learn about basic concepts and
74
- usage.
75
- The documentation of version 1.0 can be found [here](https://pyroll.readthedocs.io/en/stable).
76
-
77
100
  ## License
78
101
 
79
102
  The project is licensed under the [BSD 3-Clause license](LICENSE).
@@ -3,7 +3,10 @@
3
3
  [![PyPI](https://img.shields.io/pypi/v/pyroll-core)](https://pypi.org/project/pyroll-core/)
4
4
  ![Python Versions](https://img.shields.io/pypi/pyversions/pyroll-core)
5
5
  [![License](https://img.shields.io/pypi/l/pyroll-core)](LICENSE)
6
+ [![DOI](https://joss.theoj.org/papers/10.21105/joss.06200/status.svg)](https://doi.org/10.21105/joss.06200)
6
7
  ![Downloads](https://img.shields.io/pypi/dm/pyroll-core)
8
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/7971/badge)](https://www.bestpractices.dev/projects/7971)
9
+
7
10
 
8
11
  Welcome to The PyRolL Project!
9
12
 
@@ -12,6 +15,25 @@ The current focus lies on groove rolling in elongation grooves.
12
15
  The core package includes the basic data structures and algorithms.
13
16
  Further functionality is provided via [extension packages](https://pyroll.readthedocs.io/en/latest/extensions/index.html) and model approaches are provided via [plugin packages](https://pyroll.readthedocs.io/en/latest/plugins/index.html).
14
17
 
18
+ ## Aim and Scope
19
+
20
+ Publications in the field of groove rolling simulation are, to the authors knowledge, characterized by lack of reproducibility, mainly because often details are missing regarding implementation or numerical solution procedure or the provided equations are erroneous.
21
+ Very few authors provide their source code alongside their publications.
22
+ PyRolL aims to change this by providing an open basis for model and methodology development.
23
+ The PyRolL Core package hosted in this repository is the common base dependency to refer to.
24
+ Plugins to the core provide model approaches for the partial problems to be described in a rolling simulation, which include mechanical, thermal, material behavior and more.
25
+ The library of available models is constantly growing and can be extended by everyone.
26
+ Extensions provide application logic and numerical procedures helping to analyse the subject rolling process regarding its technical feasibility, optimization potential, identity error sources, or, to design a new process.
27
+ PyRolL is therefore a tool for model developers, either with broad focus or specialists, wishing to try out for example a new physical material model within a real process simulation, as well as for technologists wishing to investigate a concrete process.
28
+ Currently, there is no click'n'run graphical user interface (GUI) provided, at least basic knowledge of programming in general and Python in particular is needed to use the software.
29
+ Nevertheless, this is also recommended to leverage the full power of PyRolL.
30
+
31
+ ## Documentation
32
+
33
+ See the [documentation](https://pyroll.readthedocs.io/en/latest) to learn about basic concepts and
34
+ usage.
35
+ The documentation of version 1.0 can be found [here](https://pyroll.readthedocs.io/en/stable).
36
+
15
37
  ## Versions
16
38
 
17
39
  The main branch of this repository contains the code of the version 2.0 of PyRolL.
@@ -34,12 +56,6 @@ It is recommended to develop new plugins and extensions only for 2.0.
34
56
  - Introduction of disk elements for incremental modelling in rolling direction.
35
57
  - Nestable units (esp. pass sequences and disk elements).
36
58
 
37
- ## Documentation
38
-
39
- See the [documentation](https://pyroll.readthedocs.io/en/latest) to learn about basic concepts and
40
- usage.
41
- The documentation of version 1.0 can be found [here](https://pyroll.readthedocs.io/en/stable).
42
-
43
59
  ## License
44
60
 
45
61
  The project is licensed under the [BSD 3-Clause license](LICENSE).
@@ -11,20 +11,19 @@ path = ".venv"
11
11
  dependencies = [
12
12
  "ipython ~= 8.0",
13
13
  "pytest ~= 7.0",
14
- "matplotlib ~= 3.6",
15
14
  "pyroll-report ~= 2.0.0",
16
- "jupyter"
15
+ "jupyter",
17
16
  ]
17
+ features = ["plotly", "matplotlib"]
18
18
 
19
19
  [envs.test]
20
20
  path = ""
21
21
  dependencies = [
22
22
  "pytest ~= 7.0",
23
- "matplotlib ~= 3.6",
24
23
  ]
25
24
 
26
25
  [[envs.test.matrix]]
27
- python = ["3.9", "3.10", "3.11"]
26
+ features = ["matplotlib", "plotly"]
28
27
 
29
28
  [envs.test.scripts]
30
29
  all = "pytest tests"
@@ -37,6 +37,7 @@ dependencies = [
37
37
  "numpy ~= 1.19",
38
38
  "scipy ~= 1.9",
39
39
  "shapely ~= 2.0",
40
+ "ezdxf"
40
41
  ]
41
42
 
42
43
  dynamic = ["version"]
@@ -45,6 +46,14 @@ dynamic = ["version"]
45
46
  plot = [
46
47
  "matplotlib ~= 3.7"
47
48
  ]
49
+ matplotlib = [
50
+ "matplotlib ~= 3.7"
51
+ ]
52
+ plotly = [
53
+ "plotly ~= 5.18",
54
+ "pandas ~= 2.0",
55
+ "kaleido"
56
+ ]
48
57
 
49
58
  [project.urls]
50
59
  Homepage = "https://pyroll-project.github.io"
@@ -1,7 +1,7 @@
1
1
  from . import shapes as _
2
2
 
3
3
  from .grooves import *
4
- from .transport import Transport
4
+ from .transport import Transport, CoolingPipe
5
5
  from .roll_pass import RollPass, DeformationUnit, ThreeRollPass
6
6
  from .unit import Unit
7
7
  from .roll import Roll
@@ -12,23 +12,36 @@ from .hooks import Hook, HookHost, HookFunction, root_hooks
12
12
  from .disk_elements import DiskElementUnit
13
13
  from .config import Config, config
14
14
 
15
- VERSION = "2.1.2.post0"
15
+ VERSION = "2.1.4"
16
16
 
17
- root_hooks.update(
18
- {
17
+ root_hooks.extend(
18
+ [
19
19
  RollPass.roll_force,
20
20
  RollPass.Roll.roll_torque,
21
21
  RollPass.elongation_efficiency,
22
- RollPass.OutProfile.filling_ratio,
23
- RollPass.OutProfile.cross_section_filling_ratio,
24
- RollPass.OutProfile.filling_error,
25
- RollPass.OutProfile.cross_section_error,
22
+ Unit.power,
26
23
  Unit.OutProfile.cross_section,
24
+ Unit.OutProfile.classifiers,
27
25
  Unit.OutProfile.strain,
28
26
  Unit.OutProfile.length,
29
- Unit.OutProfile.classifiers,
30
27
  Unit.OutProfile.t,
28
+ RollPass.OutProfile.filling_ratio,
29
+ RollPass.OutProfile.cross_section_filling_ratio,
30
+ RollPass.OutProfile.filling_error,
31
+ RollPass.OutProfile.cross_section_error,
31
32
  PassSequence.log_elongation,
32
- Unit.power,
33
- }
33
+ ]
34
34
  )
35
+
36
+ # determine available plotting backend, plotly is preferred
37
+ try:
38
+ import plotly as _
39
+ PLOTTING_BACKEND = "plotly"
40
+
41
+ except ImportError:
42
+ try:
43
+ import matplotlib as _
44
+ PLOTTING_BACKEND = "matplotlib"
45
+
46
+ except ImportError:
47
+ PLOTTING_BACKEND = None
@@ -168,3 +168,25 @@ class Config:
168
168
 
169
169
  ROLL_SURFACE_DISCRETIZATION_COUNT = 100
170
170
  """Count of discrete points used to describe the roll surface."""
171
+
172
+ UNIVERSAL_GAS_CONSTANT = 8.31446261815324
173
+ """Universal gas constant R."""
174
+
175
+ BOLTZMANN_CONSTANT = 1.380649e-23
176
+ """Boltzmann constant kB."""
177
+
178
+ STEFAN_BOLTZMANN_CONSTANT = 5.670374419e-8
179
+ """Stefan-Boltzmann radiation constant σ."""
180
+
181
+ AVOGADRO_CONSTANT = 6.02214076e23
182
+ """Avogadro constant NA."""
183
+
184
+ STANDARD_GRAVITY = 9.80665
185
+ """Standard acceleration of gravity g0."""
186
+
187
+ PROFILE_CONTOUR_REFINEMENT = 0
188
+ """Refine the line string of profile contours with more intermediate points.
189
+ Higher integers mean finer. Values < 1 disable this feature."""
190
+
191
+ GROOVE_RADIUS_POINT_COUNT = 20
192
+ """Count of points used to represent the radii in a generic elongation groove as line string."""
@@ -65,22 +65,44 @@ class GrooveBase(ReprMixin):
65
65
  }
66
66
 
67
67
  def plot(self, **kwargs):
68
- try:
69
- import matplotlib.pyplot as plt
70
- except ImportError as e:
68
+ from pyroll.core import PLOTTING_BACKEND
69
+ if PLOTTING_BACKEND is None:
71
70
  raise RuntimeError(
72
- "This method is only available if matplotlib is installed in the environment. "
73
- "You may install it using the 'plot' extra of pyroll-core."
74
- ) from e
71
+ "This method is only available if matplotlib or plotly is installed in the environment. "
72
+ "You may install one of them using the 'plot', 'matplotlib' or 'plotly' extras of pyroll-core."
73
+ )
74
+
75
+ if PLOTTING_BACKEND == "matplotlib":
76
+ import matplotlib.pyplot as plt
77
+
78
+ fig: plt.Figure = plt.figure(**kwargs)
79
+ ax: plt.Axes = fig.subplots()
80
+
81
+ ax.set_ylabel("y")
82
+ ax.set_xlabel("z")
83
+
84
+ ax.set_aspect("equal", "datalim")
85
+ ax.grid(lw=0.5)
86
+
87
+ ax.plot(*self.contour_line.xy, color="k")
88
+ return fig
89
+
90
+ if PLOTTING_BACKEND == "plotly":
91
+ import plotly.express as px
92
+
93
+ fig = px.line(
94
+ x=self.contour_line.xy[0],
95
+ y=self.contour_line.xy[1],
96
+ labels={"y": "y", "x": "z"},
97
+ template="simple_white",
98
+ )
75
99
 
76
- fig: plt.Figure = plt.figure(**kwargs)
77
- ax: plt.Axes = fig.subplots()
100
+ fig.update_traces(line_color="black")
78
101
 
79
- ax.set_ylabel("y")
80
- ax.set_xlabel("z")
102
+ fig.update_yaxes(
103
+ scaleanchor="x",
104
+ scaleratio=1
105
+ )
81
106
 
82
- ax.set_aspect("equal", "datalim")
83
- ax.grid(lw=0.5)
107
+ return fig
84
108
 
85
- ax.plot(*self.contour_line.xy, color="k")
86
- return fig
@@ -20,6 +20,7 @@ class EquivalentRibbedGroove(GenericElongationGroove):
20
20
  nominal_outer_diameter: float,
21
21
  usable_width: float,
22
22
  depth: float,
23
+ rib_flank_angle: Optional[float] = None,
23
24
 
24
25
  pad_angle: float = 0,
25
26
  **kwargs
@@ -42,6 +43,13 @@ class EquivalentRibbedGroove(GenericElongationGroove):
42
43
  :param kwargs: more keyword arguments passed to the GenericElongationGroove constructor
43
44
  """
44
45
 
46
+ self.nominal_outer_diameter = nominal_outer_diameter
47
+ self.base_body_height = base_body_height
48
+ self.rib_distance = rib_distance
49
+ self.rib_width = rib_width
50
+ self.rib_flank_angle = rib_flank_angle
51
+
52
+
45
53
  pad_angle = np.deg2rad(pad_angle)
46
54
  rib_angle = np.deg2rad(rib_angle)
47
55
 
@@ -193,22 +193,22 @@ class GenericElongationGroove(GrooveBase, ReprMixin):
193
193
  yield self.z0, self.y0
194
194
 
195
195
  if not np.isclose(self.z1, self.z3):
196
- for z in np.linspace(self.z1, self.z3, 20, endpoint=False):
196
+ for z in np.linspace(self.z1, self.z3, Config.GROOVE_RADIUS_POINT_COUNT, endpoint=False):
197
197
  yield z, self._r1_contour_line(z)
198
198
 
199
199
  if not np.isclose(self.z3, self.z4):
200
200
  yield self.z3, self.y3
201
201
 
202
202
  if not np.isclose(self.z4, self.z5):
203
- for z in np.linspace(self.z4, self.z5, 20, endpoint=False):
203
+ for z in np.linspace(self.z4, self.z5, Config.GROOVE_RADIUS_POINT_COUNT, endpoint=False):
204
204
  yield z, self._r2_contour_line(z)
205
205
 
206
206
  if not np.isclose(self.z5, self.z6):
207
- for z in np.linspace(self.z5, self.z6, 20, endpoint=False):
207
+ for z in np.linspace(self.z5, self.z6, Config.GROOVE_RADIUS_POINT_COUNT, endpoint=False):
208
208
  yield z, self._r3_contour_line(z)
209
209
 
210
210
  if not np.isclose(self.z6, self.z7):
211
- for z in np.linspace(self.z6, self.z7, 20, endpoint=False):
211
+ for z in np.linspace(self.z6, self.z7, Config.GROOVE_RADIUS_POINT_COUNT, endpoint=False):
212
212
  yield z, self._r4_contour_line(z)
213
213
 
214
214
  yield self.z9, self.y9
@@ -1,8 +1,9 @@
1
- from typing import Union, Tuple, Iterable, Optional
2
-
3
1
  import numpy as np
4
2
  import scipy.interpolate
3
+ from pathlib import Path
4
+ from ezdxf import readfile
5
5
  from shapely.geometry import Polygon, LineString
6
+ from typing import Union, Tuple, Iterable, Optional
6
7
 
7
8
  from pyroll.core.grooves import GrooveBase
8
9
 
@@ -18,7 +19,7 @@ class SplineGroove(GrooveBase):
18
19
  ):
19
20
  """
20
21
  :param contour_points: an iterable of contour points to be used for the spline
21
- :param classifiers: an interable of string keys used as type classifiers
22
+ :param classifiers: an iterable of string keys used as type classifiers
22
23
  :param usable_width: the usable width to assume for this instance, if None, the maximum width will be used
23
24
  """
24
25
  contour_points = np.asarray(contour_points, dtype="float64")
@@ -90,3 +91,48 @@ class SplineGroove(GrooveBase):
90
91
 
91
92
  def local_depth(self, z) -> Union[float, np.ndarray]:
92
93
  return self._local_depth(z)
94
+
95
+ @classmethod
96
+ def from_dxf_drawing(cls, filepath: Path, classifiers: Iterable[str], usable_width: Optional[float] = None,
97
+ arc_discretization: int = 1000) -> 'SplineGroove':
98
+ """
99
+ Creates a spline groove with a given contour line as defined inside the .dxf drawing.
100
+
101
+ :param filepath: the filepath to the drawing
102
+ :param classifiers: an iterable of string keys used as type classifiers
103
+ :param usable_width: the usable width to assume for this instance, if None, the maximum width will be used
104
+ :param arc_discretization: discretization of arcs of the dxf drawing, default is 1000.
105
+ """
106
+
107
+ doc = readfile(filepath)
108
+ msp = doc.modelspace()
109
+
110
+ points = []
111
+ for entity in msp:
112
+ if entity.dxftype() == 'LINE':
113
+ points.append((entity.dxf.start[0], entity.dxf.start[1]))
114
+ points.append((entity.dxf.end[0], entity.dxf.end[1]))
115
+
116
+ elif entity.dxftype() == 'ARC':
117
+ center = (entity.dxf.center[0], entity.dxf.center[1])
118
+ radius = entity.dxf.radius
119
+ start_angle = np.radians(entity.dxf.start_angle)
120
+ end_angle = np.radians(entity.dxf.end_angle)
121
+
122
+ arc_points = [
123
+ (
124
+ center[0] + radius * np.cos(start_angle + (end_angle - start_angle) * i / arc_discretization),
125
+ center[1] + radius * np.sin(start_angle + (end_angle - start_angle) * i / arc_discretization),
126
+ )
127
+ for i in range(arc_discretization + 1)
128
+ ]
129
+ points.extend(arc_points)
130
+
131
+ points.sort(key=lambda p: p[0])
132
+
133
+ distance_to_y_0 = -points[0][1]
134
+
135
+ shifted_points = [(x, y + distance_to_y_0) for x, y in points]
136
+ shifted_points.sort(key=lambda p: p[0])
137
+
138
+ return SplineGroove(contour_points=shifted_points, classifiers=classifiers, usable_width=usable_width)
@@ -491,9 +491,26 @@ class HookHost(ReprMixin, LogMixin, metaclass=_HookHostMeta):
491
491
  return result
492
492
 
493
493
 
494
- root_hooks = set() # filled in __init__.py due to circular imports
494
+ class _RootHooksList(list):
495
+ def add(self, item):
496
+ self.append(item)
497
+
498
+ def insert_before(self, position, item):
499
+ i = self.index(position)
500
+ self.insert(i, item)
501
+
502
+ def insert_after(self, position, item):
503
+ i = self.index(position) + 1
504
+ self.insert(i, item)
505
+
506
+ def remove_last(self, item):
507
+ i = list(reversed(self)).index(item)
508
+ del self[-1 - i]
509
+
510
+
511
+ root_hooks = _RootHooksList() # filled in __init__.py due to circular imports
495
512
  """
496
- Set of hooks to call explicitly in each solution iteration.
513
+ List of hooks to call explicitly in each solution iteration.
497
514
  Their values will be treated as explicitly set but reevaluated in every iteration.
498
515
  They will not be deleted during cache clearing.
499
516
  They serve as root for the calling tree and persistent iterational variables.
@@ -38,6 +38,11 @@ def equivalent_width(self: Profile):
38
38
  return np.sqrt(self.cross_section.area * self.width / self.height)
39
39
 
40
40
 
41
+ @Profile.equivalent_radius
42
+ def equivalent_radius(self: Profile):
43
+ return np.sqrt(self.cross_section.area / np.pi)
44
+
45
+
41
46
  @Profile.equivalent_rectangle
42
47
  def equivalent_rectangle(self: Profile):
43
48
  return rectangle(self.equivalent_width, self.equivalent_height)
@@ -55,11 +60,11 @@ def core_temperature(self: Profile):
55
60
 
56
61
  @Profile.heat_penetration_number
57
62
  def heat_penetration_number(self: Profile):
58
- if hasattr(self, "thermal_conductivity") and hasattr(self, "density") and hasattr(self, "thermal_capacity"):
59
- return np.sqrt(self.thermal_conductivity * self.density * self.thermal_capacity)
63
+ if hasattr(self, "thermal_conductivity") and hasattr(self, "density") and hasattr(self, "specific_heat_capacity"):
64
+ return np.sqrt(self.thermal_conductivity * self.density * self.specific_heat_capacity)
60
65
 
61
66
 
62
67
  @Profile.thermal_diffusivity
63
68
  def thermal_diffusivity(self: Profile):
64
- if hasattr(self, "thermal_conductivity") and hasattr(self, "density") and hasattr(self, "thermal_capacity"):
65
- return self.thermal_conductivity / (self.density * self.thermal_capacity)
69
+ if hasattr(self, "thermal_conductivity") and hasattr(self, "density") and hasattr(self, "specific_heat_capacity"):
70
+ return self.thermal_conductivity / (self.density * self.specific_heat_capacity)