Skip to content

Commit 1282e94

Browse files
committed
Some formatting fixes.
1 parent 443362c commit 1282e94

10 files changed

+54
-242
lines changed

.flake8

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
22
max-line-length = 88
3-
extend-ignore = E203, E741
3+
extend-ignore = E203, E741

examples/closures/plot_closure_comparison.ipynb

+10-65
Large diffs are not rendered by default.

examples/closures/plot_extrema.ipynb

+24-101
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": 1,
12+
"execution_count": null,
1313
"metadata": {},
1414
"outputs": [],
1515
"source": [
@@ -18,176 +18,99 @@
1818
"import numpy as np\n",
1919
"from mpl_toolkits.mplot3d import Axes3D\n",
2020
"\n",
21-
"from fiberoripy.closures import (\n",
22-
" IBOF_closure,\n",
23-
" compute_closure,\n",
24-
" hybrid_closure,\n",
25-
" linear_closure,\n",
26-
" quadratic_closure,\n",
27-
")\n",
28-
"from fiberoripy.tensorplot import (\n",
29-
" plot_orbit2,\n",
30-
" plot_orbit4,\n",
31-
" plot_projection2,\n",
32-
" plot_projection4,\n",
33-
")"
21+
"from fiberoripy.closures import get_random_tensor_pair\n",
22+
"\n",
23+
"from fiberoripy.tensorplot import plot_orbit2, plot_orbit4\n"
3424
]
3525
},
3626
{
3727
"cell_type": "code",
38-
"execution_count": 2,
28+
"execution_count": null,
3929
"metadata": {},
4030
"outputs": [],
4131
"source": [
4232
"# define second order fiber orientation tensor\n",
4333
"a_iso = 1.0 / 3.0 * np.eye(3)\n",
44-
"a_uni = np.array([[0.9,0,0],[0,0.05, 0],[0,0,0.05]])\n",
45-
"a_pln = np.array([[0.4,0,0],[0,0.4, 0],[0,0,0.1]])\n",
34+
"a_uni = np.array([[0.9, 0, 0], [0, 0.05, 0], [0, 0, 0.05]])\n",
35+
"a_pln = np.array([[0.4, 0, 0], [0, 0.4, 0], [0, 0, 0.1]])\n",
4636
"\n",
4737
"# create a fourth order fiber orientation tensor\n",
48-
"A_iso = compute_closure(a_iso, \"RANDOM\", N=1000)\n",
49-
"A_uni = compute_closure(a_uni, \"RANDOM\", N=1000)\n",
50-
"A_pln = compute_closure(a_pln, \"RANDOM\", N=1000)"
38+
"_, A_iso = get_random_tensor_pair(seed=a_iso, N=5000)\n",
39+
"_, A_uni = get_random_tensor_pair(seed=a_uni, N=5000)\n",
40+
"_, A_pln = get_random_tensor_pair(seed=a_pln, N=5000)"
5141
]
5242
},
5343
{
5444
"cell_type": "code",
55-
"execution_count": 3,
45+
"execution_count": null,
5646
"metadata": {},
57-
"outputs": [
58-
{
59-
"data": {
60-
"application/vnd.jupyter.widget-view+json": {
61-
"model_id": "e710d3dd22534b28937261bf1db80c28",
62-
"version_major": 2,
63-
"version_minor": 0
64-
},
65-
"text/plain": [
66-
"Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
67-
]
68-
},
69-
"metadata": {},
70-
"output_type": "display_data"
71-
}
72-
],
47+
"outputs": [],
7348
"source": [
7449
"# Second order tensor plot (isotropic)\n",
7550
"fig = plt.figure(figsize=(12, 8))\n",
7651
"\n",
7752
"ax = fig.add_subplot(111, projection=Axes3D.name)\n",
7853
"ax._axis3don = False\n",
79-
"plotargs = {\"color\":[0,0.588,0.510], \"rstride\":1, \"cstride\":1}\n",
54+
"plotargs = {\"color\": [0, 0.588, 0.510], \"rstride\": 1, \"cstride\": 1}\n",
8055
"plot_orbit2(ax, plotargs, a_iso)\n",
8156
"\n",
8257
"plt.show()"
8358
]
8459
},
8560
{
8661
"cell_type": "code",
87-
"execution_count": 4,
62+
"execution_count": null,
8863
"metadata": {},
89-
"outputs": [
90-
{
91-
"data": {
92-
"application/vnd.jupyter.widget-view+json": {
93-
"model_id": "c259da2fd6e64d34b59acf3d98a17feb",
94-
"version_major": 2,
95-
"version_minor": 0
96-
},
97-
"text/plain": [
98-
"Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
99-
]
100-
},
101-
"metadata": {},
102-
"output_type": "display_data"
103-
}
104-
],
64+
"outputs": [],
10565
"source": [
10666
"# Second order tensor plot (unidirectional)\n",
10767
"fig = plt.figure(figsize=(12, 8))\n",
10868
"\n",
10969
"ax = fig.add_subplot(111, projection=Axes3D.name)\n",
11070
"ax._axis3don = False\n",
111-
"plotargs = {\"color\":[0,0.588,0.510], \"rstride\":1, \"cstride\":1}\n",
71+
"plotargs = {\"color\": [0, 0.588, 0.510], \"rstride\": 1, \"cstride\": 1}\n",
11272
"plot_orbit2(ax, plotargs, a_uni)\n",
11373
"\n",
11474
"plt.show()"
11575
]
11676
},
11777
{
11878
"cell_type": "code",
119-
"execution_count": 5,
79+
"execution_count": null,
12080
"metadata": {},
121-
"outputs": [
122-
{
123-
"data": {
124-
"application/vnd.jupyter.widget-view+json": {
125-
"model_id": "63d737f971c54dfc9f5d77ccd1cca695",
126-
"version_major": 2,
127-
"version_minor": 0
128-
},
129-
"text/plain": [
130-
"Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
131-
]
132-
},
133-
"metadata": {},
134-
"output_type": "display_data"
135-
}
136-
],
81+
"outputs": [],
13782
"source": [
13883
"# Second order tensor plot (planar)\n",
13984
"fig = plt.figure(figsize=(12, 8))\n",
14085
"\n",
14186
"ax = fig.add_subplot(111, projection=Axes3D.name)\n",
14287
"ax._axis3don = False\n",
143-
"plotargs = {\"color\":[0,0.588,0.510], \"rstride\":4, \"cstride\":4}\n",
88+
"plotargs = {\"color\": [0, 0.588, 0.510], \"rstride\": 4, \"cstride\": 4}\n",
14489
"plot_orbit2(ax, plotargs, a_pln)\n",
14590
"\n",
14691
"plt.show()"
14792
]
14893
},
14994
{
15095
"cell_type": "code",
151-
"execution_count": 10,
96+
"execution_count": null,
15297
"metadata": {},
153-
"outputs": [
154-
{
155-
"data": {
156-
"application/vnd.jupyter.widget-view+json": {
157-
"model_id": "9fca6f4e29b545feaab4909884f70fae",
158-
"version_major": 2,
159-
"version_minor": 0
160-
},
161-
"text/plain": [
162-
"Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
163-
]
164-
},
165-
"metadata": {},
166-
"output_type": "display_data"
167-
}
168-
],
98+
"outputs": [],
16999
"source": [
170100
"# Fourth order tensor plot\n",
171101
"fig = plt.figure(figsize=(12, 8))\n",
172102
"\n",
173103
"ax = fig.add_subplot(111, projection=Axes3D.name)\n",
174-
"plotargs = {\"color\":[0,0.588,0.510], \"rstride\":1, \"cstride\":1}\n",
104+
"plotargs = {\"color\": [0, 0.588, 0.510], \"rstride\": 1, \"cstride\": 1}\n",
175105
"plot_orbit4(ax, plotargs, A_iso)\n",
176106
"\n",
177107
"plt.show()"
178108
]
179-
},
180-
{
181-
"cell_type": "code",
182-
"execution_count": null,
183-
"metadata": {},
184-
"outputs": [],
185-
"source": []
186109
}
187110
],
188111
"metadata": {
189112
"kernelspec": {
190-
"display_name": "Python 3",
113+
"display_name": "base",
191114
"language": "python",
192115
"name": "python3"
193116
},
@@ -201,7 +124,7 @@
201124
"name": "python",
202125
"nbconvert_exporter": "python",
203126
"pygments_lexer": "ipython3",
204-
"version": "3.9.0"
127+
"version": "3.10.6"
205128
}
206129
},
207130
"nbformat": 4,

examples/orientation/ardrsc_perfectrotation.ipynb

+2-9
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,11 @@
9999
"plt.tight_layout()\n",
100100
"plt.show()"
101101
]
102-
},
103-
{
104-
"cell_type": "code",
105-
"execution_count": null,
106-
"metadata": {},
107-
"outputs": [],
108-
"source": []
109102
}
110103
],
111104
"metadata": {
112105
"kernelspec": {
113-
"display_name": ".venv313",
106+
"display_name": "base",
114107
"language": "python",
115108
"name": "python3"
116109
},
@@ -124,7 +117,7 @@
124117
"name": "python",
125118
"nbconvert_exporter": "python",
126119
"pygments_lexer": "ipython3",
127-
"version": "3.13.0"
120+
"version": "3.10.6"
128121
}
129122
},
130123
"nbformat": 4,

examples/orientation/ardrsc_perfectshear.ipynb

+2-9
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,11 @@
102102
"plt.tight_layout()\n",
103103
"plt.show()"
104104
]
105-
},
106-
{
107-
"cell_type": "code",
108-
"execution_count": null,
109-
"metadata": {},
110-
"outputs": [],
111-
"source": []
112105
}
113106
],
114107
"metadata": {
115108
"kernelspec": {
116-
"display_name": ".venv313",
109+
"display_name": "base",
117110
"language": "python",
118111
"name": "python3"
119112
},
@@ -127,7 +120,7 @@
127120
"name": "python",
128121
"nbconvert_exporter": "python",
129122
"pygments_lexer": "ipython3",
130-
"version": "3.13.0"
123+
"version": "3.10.6"
131124
}
132125
},
133126
"nbformat": 4,

examples/orientation/comparison_perfectshear.ipynb

+3-18
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"\n",
4545
"# time steps\n",
4646
"t0, tf = 0, 80\n",
47-
"t = np.linspace(t0, tf, 100)\n",
47+
"t = np.linspace(t0, tf, 500)\n",
4848
"\n",
4949
"# initial fiber orientation state\n",
5050
"A0 = 1.0 / 3.0 * np.eye(3)"
@@ -62,21 +62,6 @@
6262
" return np.array([[0.0, 0.0, 1.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]])"
6363
]
6464
},
65-
{
66-
"cell_type": "code",
67-
"execution_count": null,
68-
"metadata": {},
69-
"outputs": [],
70-
"source": [
71-
"# compute solutions by integrating the ODEs\n",
72-
"A_ft = odeint(folgar_tucker_ode, A0.ravel(), t, args=(xi, L, 0.0311),)\n",
73-
"A_iard = odeint(iard_ode, A0.ravel(), t, args=(xi, L, 0.0562, 0.9977),)\n",
74-
"A_pard = odeint(pard_ode, A0.ravel(), t, args=(xi, L, 0.0169, 0.9868),)\n",
75-
"A_mrd = odeint(mrd_ode, A0.ravel(), t, args=(xi, L, 0.0198, 1.0, 0.4796, 0.0120),)\n",
76-
"A_wpt = odeint(ard_rsc_ode, A0.ravel(), t, args=(xi, L, 0.0504 * (1.0 - 0.995), 1.0, 0.0, 0.0504 * 0.995, 0.0, 0.0),)\n",
77-
"A_pt = odeint(ard_rsc_ode, A0.ravel(), t, args=(xi, L, 1.924e-4, 1.0, 5.839e-3, 0.04, 1.168e-5, 0.0),)"
78-
]
79-
},
8065
{
8166
"cell_type": "code",
8267
"execution_count": null,
@@ -187,7 +172,7 @@
187172
],
188173
"metadata": {
189174
"kernelspec": {
190-
"display_name": ".venv313",
175+
"display_name": "base",
191176
"language": "python",
192177
"name": "python3"
193178
},
@@ -201,7 +186,7 @@
201186
"name": "python",
202187
"nbconvert_exporter": "python",
203188
"pygments_lexer": "ipython3",
204-
"version": "3.13.0"
189+
"version": "3.10.6"
205190
}
206191
},
207192
"nbformat": 4,

examples/orientation/iard_perfectshear.ipynb

+2-9
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,11 @@
114114
"plt.tight_layout()\n",
115115
"plt.show()"
116116
]
117-
},
118-
{
119-
"cell_type": "code",
120-
"execution_count": null,
121-
"metadata": {},
122-
"outputs": [],
123-
"source": []
124117
}
125118
],
126119
"metadata": {
127120
"kernelspec": {
128-
"display_name": ".venv313",
121+
"display_name": "base",
129122
"language": "python",
130123
"name": "python3"
131124
},
@@ -139,7 +132,7 @@
139132
"name": "python",
140133
"nbconvert_exporter": "python",
141134
"pygments_lexer": "ipython3",
142-
"version": "3.13.0"
135+
"version": "3.10.6"
143136
}
144137
},
145138
"nbformat": 4,

0 commit comments

Comments
 (0)