Skip to content

Commit 93cd8e3

Browse files
author
Itom Build Server
committed
Conflicts: mainsite_hidden/source/conf.py mainsite_hidden/source_plugins/conf.py
2 parents 18f0121 + f22370c commit 93cd8e3

File tree

5,144 files changed

+1324836
-420
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,144 files changed

+1324836
-420
lines changed

latest/docs/02_installation/install_setup_creation.html

Lines changed: 751 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/itom/basics/demo_ansiEscapeSequencesOutput.html

Lines changed: 774 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/itom/sg_execution_times.html

Lines changed: 670 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/python_packages/matplotlib/demo_cyberpunk.html

Lines changed: 774 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/python_packages/matplotlib/demo_matplotlibFuncAnimation.html

Lines changed: 35715 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/python_packages/matplotlib/demo_qbstyles.html

Lines changed: 775 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/python_packages/matplotlib/demo_scientific.html

Lines changed: 772 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/python_packages/others/sg_execution_times.html

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/python_packages/plotly/demo_sankey_diagram.html

Lines changed: 778 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/python_packages/pyTest/sg_execution_times.html

Lines changed: 670 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/11_demos/python_packages/sg_execution_times.html

Lines changed: 670 additions & 0 deletions
Large diffs are not rendered by default.

latest/docs/12_contributing/git_pre_commit_hooks.html

Lines changed: 701 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""Science Plots
2+
=============
3+
4+
This `matplotlib <https://matplotlib.org/>`_ style `Science Plots <https://github.com/garrettj403/SciencePlots>`_ is focused to generate figures using common scientific journal styles such as IEEE.
5+
The figures are suitable to print in colored are back and white. In addition to `matplotlib <https://matplotlib.org/>`_, the style must be installed.
6+
7+
.. code-block:: bat
8+
9+
pip install SciencePlots
10+
"""
11+
12+
###############################################################################
13+
# Import namespaces.
14+
import numpy as np
15+
import matplotlib.pyplot as plt
16+
import scienceplots
17+
18+
###############################################################################
19+
# Generate demo x and y values.
20+
x = np.linspace(0, 10, 20)
21+
y = np.sin(x)
22+
y2 = np.cos(x)
23+
24+
25+
###############################################################################
26+
# Change matplotlib.pyplot style and plot data.
27+
with plt.style.context(["science", "no-latex"]):
28+
plt.figure(figsize=(6, 6))
29+
plt.plot(x, y, marker="o", label="Line 1")
30+
plt.plot(x, y2, marker="x", label="Line 2")
31+
32+
plt.xlabel("X")
33+
plt.ylabel("Y")
34+
plt.legend()
35+
plt.grid()
36+
plt.show()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Science Plots\n\nThis [matplotlib](https://matplotlib.org/) style [Science Plots](https://github.com/garrettj403/SciencePlots) is focused to generate figures using common scientific journal styles such as IEEE.\nThe figures are suitable to print in colored are back and white. In addition to [matplotlib](https://matplotlib.org/), the style must be installed.\n\n.. code-block:: bat\n\n pip install SciencePlots\n"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"Import namespaces.\n\n"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": null,
20+
"metadata": {
21+
"collapsed": false
22+
},
23+
"outputs": [],
24+
"source": [
25+
"import numpy as np\nimport matplotlib.pyplot as plt\nimport scienceplots"
26+
]
27+
},
28+
{
29+
"cell_type": "markdown",
30+
"metadata": {},
31+
"source": [
32+
"Generate demo x and y values.\n\n"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"metadata": {
39+
"collapsed": false
40+
},
41+
"outputs": [],
42+
"source": [
43+
"x = np.linspace(0, 10, 20)\ny = np.sin(x)\ny2 = np.cos(x)"
44+
]
45+
},
46+
{
47+
"cell_type": "markdown",
48+
"metadata": {},
49+
"source": [
50+
"Change matplotlib.pyplot style and plot data.\n\n"
51+
]
52+
},
53+
{
54+
"cell_type": "code",
55+
"execution_count": null,
56+
"metadata": {
57+
"collapsed": false
58+
},
59+
"outputs": [],
60+
"source": [
61+
"with plt.style.context([\"science\", \"no-latex\"]):\n plt.figure(figsize=(6, 6))\n plt.plot(x, y, marker=\"o\", label=\"Line 1\")\n plt.plot(x, y2, marker=\"x\", label=\"Line 2\")\n\n plt.xlabel(\"X\")\n plt.ylabel(\"Y\")\n plt.legend()\n plt.grid()\n plt.show()"
62+
]
63+
}
64+
],
65+
"metadata": {
66+
"kernelspec": {
67+
"display_name": "Python 3",
68+
"language": "python",
69+
"name": "python3"
70+
},
71+
"language_info": {
72+
"codemirror_mode": {
73+
"name": "ipython",
74+
"version": 3
75+
},
76+
"file_extension": ".py",
77+
"mimetype": "text/x-python",
78+
"name": "python",
79+
"nbconvert_exporter": "python",
80+
"pygments_lexer": "ipython3",
81+
"version": "3.12.4"
82+
}
83+
},
84+
"nbformat": 4,
85+
"nbformat_minor": 0
86+
}
Binary file not shown.
Binary file not shown.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# ANSI escape codes\n\nThis demo shows some possibilities of ANSI escape codes.\n"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"Change the text color\n\n"
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {},
20+
"source": [
21+
"set the text colors to pre-defined values, followed by a reset\n\n"
22+
]
23+
},
24+
{
25+
"cell_type": "code",
26+
"execution_count": null,
27+
"metadata": {
28+
"collapsed": false
29+
},
30+
"outputs": [],
31+
"source": [
32+
"print(\"\\u001b[30m A \\u001b[31m B \\u001b[32m C \\u001b[33m D \\u001b[0mText after reset\")\nprint(\"\\u001b[34m E \\u001b[35m F \\u001b[36m G \\u001b[37m H \\u001b[0mText after reset\")"
33+
]
34+
},
35+
{
36+
"cell_type": "markdown",
37+
"metadata": {},
38+
"source": [
39+
"use the prefix 1 to choose are more lighter text color\n\n"
40+
]
41+
},
42+
{
43+
"cell_type": "code",
44+
"execution_count": null,
45+
"metadata": {
46+
"collapsed": false
47+
},
48+
"outputs": [],
49+
"source": [
50+
"print(\n \"\\u001b[30;1m A \\u001b[31;1m B \\u001b[32;1m C \\u001b[33;1m D \\u001b[0mText after reset\"\n)\nprint(\n \"\\u001b[34;1m E \\u001b[35;1m F \\u001b[36;1m G \\u001b[37;1m H \\u001b[0mText after reset\"\n)"
51+
]
52+
},
53+
{
54+
"cell_type": "markdown",
55+
"metadata": {},
56+
"source": [
57+
"now the same with the background color\n\n"
58+
]
59+
},
60+
{
61+
"cell_type": "code",
62+
"execution_count": null,
63+
"metadata": {
64+
"collapsed": false
65+
},
66+
"outputs": [],
67+
"source": [
68+
"print(\"\\u001b[40m A \\u001b[41m B \\u001b[42m C \\u001b[43m D \\u001b[0mText after reset\")\nprint(\"\\u001b[44m E \\u001b[45m F \\u001b[46m G \\u001b[47m H \\u001b[0mText after reset\")\nprint(\n \"\\u001b[40;1m A \\u001b[41;1m B \\u001b[42;1m C \\u001b[43;1m D \\u001b[0mText after reset\"\n)\nprint(\n \"\\u001b[44;1m E \\u001b[45;1m F \\u001b[46;1m G \\u001b[47;1m H \\u001b[0mText after reset\"\n)"
69+
]
70+
},
71+
{
72+
"cell_type": "markdown",
73+
"metadata": {},
74+
"source": [
75+
"use text bold, underline, italic or combine them\n\n"
76+
]
77+
},
78+
{
79+
"cell_type": "code",
80+
"execution_count": null,
81+
"metadata": {
82+
"collapsed": false
83+
},
84+
"outputs": [],
85+
"source": [
86+
"print(\n \"\\u001b[1;3;4mText bold, underline and italic \\u001b[22mRemove bold only \"\n \"\\u001b[23;1mRemove italic and set bold again \\u001b[0mReset all\"\n)"
87+
]
88+
}
89+
],
90+
"metadata": {
91+
"kernelspec": {
92+
"display_name": "Python 3",
93+
"language": "python",
94+
"name": "python3"
95+
},
96+
"language_info": {
97+
"codemirror_mode": {
98+
"name": "ipython",
99+
"version": 3
100+
},
101+
"file_extension": ".py",
102+
"mimetype": "text/x-python",
103+
"name": "python",
104+
"nbconvert_exporter": "python",
105+
"pygments_lexer": "ipython3",
106+
"version": "3.12.4"
107+
}
108+
},
109+
"nbformat": 4,
110+
"nbformat_minor": 0
111+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
"""1D func animation
2+
===============
3+
4+
This example demonstrates how matplotlib can be used to create
5+
animated movie and export these in the mp4 movie format.
6+
It is shown here with some random generated 2d images, which ware plotted via matplotlib.
7+
By using the figure handle the animation is created. So you can plot your matplot
8+
figures in your own way and used some similar syntax to create an animation.
9+
10+
First of all you must install the matplotlib package, e.g. from
11+
https://pypi.org/project/matplotlib/
12+
13+
Then you must install the ffmpeg codec. A detailed description can be found on:
14+
http://blog.gregzaal.com/how-to-install-ffmpeg-on-windows/
15+
16+
The build version of the ffmpeg codec can be downloaded here:
17+
http://ffmpeg.zeranoe.com/builds/
18+
19+
Download and unzip the builds files to your harddrive. Typically the folder is like:
20+
C:\\Program files\\ffmpeg
21+
22+
The bin folder of ffmpeg must be added to the path variables of your system:
23+
C:\\Program files\\ffmpeg\\bin
24+
25+
Finally start the command prompt and run the command:
26+
C:\\Program files\\ffmpeg\\bin\\ffmpeg.exe -codecs
27+
28+
or easier:
29+
ffmpeg -codecs
30+
31+
"""
32+
33+
import numpy as np
34+
35+
###############################################################################
36+
# Import namespaces
37+
import matplotlib.pyplot as plt
38+
from matplotlib.animation import FuncAnimation
39+
40+
41+
###############################################################################
42+
# Function to generate parametric plot
43+
def parametric_plot(T, e):
44+
t = np.linspace(0, T, 1000)
45+
x = np.cos(-t)
46+
y = np.cos(-t + e)
47+
48+
plt.plot(x, y, color="b")
49+
50+
plt.xlim(-1.1, 1.1)
51+
plt.ylim(-1.1, 1.1)
52+
plt.gca().set_aspect("equal", adjustable="box")
53+
plt.title(f"T = {T:.2f}, e = {e:.2f}")
54+
55+
56+
###############################################################################
57+
# Function to calculate ellipse parameters
58+
def calculate_ellipse_params(T, e):
59+
t = np.linspace(0, T, 1000)
60+
x = np.cos(-t)
61+
y = np.cos(-t + e)
62+
63+
# Calculate width and height
64+
width = np.max(x) - np.min(x)
65+
height = np.max(y) - np.min(y)
66+
67+
# Calculate covariance matrix
68+
covariance_matrix = np.cov(x, y)
69+
70+
# Calculate eigenvalues and eigenvectors
71+
eigenvalues, eigenvectors = np.linalg.eig(covariance_matrix)
72+
73+
# Get angle of rotation (angle of major axis with respect to x-axis)
74+
major_axis_index = np.argmax(eigenvalues)
75+
major_axis_vector = eigenvectors[:, major_axis_index]
76+
angle_rad = np.arctan2(major_axis_vector[1], major_axis_vector[0])
77+
angle_deg = np.degrees(angle_rad)
78+
79+
return width, height, angle_deg
80+
81+
82+
###############################################################################
83+
# Calculate ellipse parameters for a full oscillation
84+
T_full = 2 * np.pi
85+
e_full = 45
86+
width, height, angle_deg = calculate_ellipse_params(T_full, e_full)
87+
88+
# Create figure and plot ellipse
89+
fig, ax = plt.subplots()
90+
91+
92+
# Setting up the animation
93+
def update(frame):
94+
ax.clear()
95+
parametric_plot(frame, e)
96+
97+
98+
e = 45
99+
ani = FuncAnimation(
100+
fig, update, frames=np.linspace(0.01, T_full, 100), repeat=True, interval=50
101+
)
102+
103+
plt.show()
Binary file not shown.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Sankey diagram\n\nThis demo shows how to use the Python ``plotly`` package under itom.\n\nIn order to show plotly outputs in itom figures, it is only necessary\nto import the ``itomPlotlyRenderer`` module once at the beginning of your\nscript. This adds an itom specific renderer to Plotly and uses it as default.\n\nThe plotly outputs are then shown in an itom designerPlugin with the name\n``plotlyPlot``.\n"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {
14+
"collapsed": false
15+
},
16+
"outputs": [],
17+
"source": [
18+
"import itomPlotlyRenderer\n\n\nimport plotly.graph_objects as go\nimport json\n\nwith open(\"sankey_energy.json\") as file:\n data = json.load(file)\n\n# override gray link colors with 'source' colors\nopacity = 0.4\n# change 'magenta' to its 'rgba' value to add opacity\ndata[\"data\"][0][\"node\"][\"color\"] = [\n \"rgba(255,0,255, 0.8)\" if color == \"magenta\" else color\n for color in data[\"data\"][0][\"node\"][\"color\"]\n]\ndata[\"data\"][0][\"link\"][\"color\"] = [\n data[\"data\"][0][\"node\"][\"color\"][src].replace(\"0.8\", str(opacity))\n for src in data[\"data\"][0][\"link\"][\"source\"]\n]\n\nfig = go.Figure(\n data=[\n go.Sankey(\n valueformat=\".0f\",\n valuesuffix=\"TWh\",\n # Define nodes\n node=dict(\n pad=15,\n thickness=15,\n line=dict(color=\"black\", width=0.5),\n label=data[\"data\"][0][\"node\"][\"label\"],\n color=data[\"data\"][0][\"node\"][\"color\"],\n ),\n # Add links\n link=dict(\n source=data[\"data\"][0][\"link\"][\"source\"],\n target=data[\"data\"][0][\"link\"][\"target\"],\n value=data[\"data\"][0][\"link\"][\"value\"],\n label=data[\"data\"][0][\"link\"][\"label\"],\n color=data[\"data\"][0][\"link\"][\"color\"],\n ),\n )\n ]\n)\n\nfig.update_layout(\n title_text=\"Energy forecast for 2050<br>Source: Department of Energy & Climate Change, \"\n \"Tom Counsell via <a href='https://bost.ocks.org/mike/sankey/'>Mike Bostock</a>\",\n font_size=10,\n)\nfig.show()"
19+
]
20+
}
21+
],
22+
"metadata": {
23+
"kernelspec": {
24+
"display_name": "Python 3",
25+
"language": "python",
26+
"name": "python3"
27+
},
28+
"language_info": {
29+
"codemirror_mode": {
30+
"name": "ipython",
31+
"version": 3
32+
},
33+
"file_extension": ".py",
34+
"mimetype": "text/x-python",
35+
"name": "python",
36+
"nbconvert_exporter": "python",
37+
"pygments_lexer": "ipython3",
38+
"version": "3.12.4"
39+
}
40+
},
41+
"nbformat": 4,
42+
"nbformat_minor": 0
43+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)