Skip to content

Commit de5d698

Browse files
committed
Demo overhaul
1 parent c552908 commit de5d698

3 files changed

Lines changed: 117 additions & 136 deletions

File tree

notebooks/demo2.ipynb

Lines changed: 0 additions & 136 deletions
This file was deleted.

notebooks/internal_k3d_demo.ipynb

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 3,
6+
"id": "e183c9b2",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"name": "stdout",
11+
"output_type": "stream",
12+
"text": [
13+
"Defaulting to user installation because normal site-packages is not writeable\n",
14+
"Processing c:\\Users\\Orzeł\\Desktop\\Studia\\sem6\\RSE\\nbody_sim\n",
15+
" Installing build dependencies: started\n",
16+
" Installing build dependencies: finished with status 'done'\n",
17+
" Getting requirements to build wheel: started\n",
18+
" Getting requirements to build wheel: finished with status 'done'\n",
19+
" Preparing metadata (pyproject.toml): started\n",
20+
" Preparing metadata (pyproject.toml): finished with status 'done'\n",
21+
"Requirement already satisfied: numpy in d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages (from nbody-sim-RO==0.1.dev13) (2.4.3)\n",
22+
"Requirement already satisfied: numba in d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages (from nbody-sim-RO==0.1.dev13) (0.65.0)\n",
23+
"Requirement already satisfied: pint in d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages (from nbody-sim-RO==0.1.dev13) (0.25.3)\n",
24+
"Requirement already satisfied: llvmlite<0.48,>=0.47.0dev0 in d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages (from numba->nbody-sim-RO==0.1.dev13) (0.47.0)\n",
25+
"Requirement already satisfied: flexcache>=0.3 in d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages (from pint->nbody-sim-RO==0.1.dev13) (0.3)\n",
26+
"Requirement already satisfied: flexparser>=0.4 in d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages (from pint->nbody-sim-RO==0.1.dev13) (0.4)\n",
27+
"Requirement already satisfied: platformdirs>=2.1.0 in d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages (from pint->nbody-sim-RO==0.1.dev13) (4.9.6)\n",
28+
"Requirement already satisfied: typing-extensions>=4.0.0 in d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages (from pint->nbody-sim-RO==0.1.dev13) (4.15.0)\n",
29+
"Building wheels for collected packages: nbody-sim-RO\n",
30+
" Building wheel for nbody-sim-RO (pyproject.toml): started\n",
31+
" Building wheel for nbody-sim-RO (pyproject.toml): finished with status 'done'\n",
32+
" Created wheel for nbody-sim-RO: filename=nbody_sim_ro-0.1.dev13-py3-none-any.whl size=38247 sha256=96d5a518bdff7f640ab554fd8e7a616d08ae4007df67f516afc8faab78a1eaea\n",
33+
" Stored in directory: C:\\Users\\Orzeł\\AppData\\Local\\Temp\\pip-ephem-wheel-cache-_na2m1gi\\wheels\\76\\94\\1d\\1b9dc61c5a0ed1a41f095998757e9a971e3147500318307e3a\n",
34+
"Successfully built nbody-sim-RO\n",
35+
"Installing collected packages: nbody-sim-RO\n",
36+
"Successfully installed nbody-sim-RO-0.1.dev13\n",
37+
"Note: you may need to restart the kernel to use updated packages.\n"
38+
]
39+
}
40+
],
41+
"source": [
42+
"pip install .."
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": 4,
48+
"id": "d8c0bf52",
49+
"metadata": {},
50+
"outputs": [
51+
{
52+
"name": "stderr",
53+
"output_type": "stream",
54+
"text": [
55+
"d:\\Program\\anaconda3\\envs\\RSE\\Lib\\site-packages\\traittypes\\traittypes.py:98: UserWarning: Given trait value dtype \"uint32\" does not match required type \"uint32\". A coerced copy has been created.\n",
56+
" warnings.warn(\n"
57+
]
58+
},
59+
{
60+
"data": {
61+
"application/vnd.jupyter.widget-view+json": {
62+
"model_id": "2ea176ad497c4eeebee6f595a7a29d90",
63+
"version_major": 2,
64+
"version_minor": 0
65+
},
66+
"text/plain": [
67+
"Output()"
68+
]
69+
},
70+
"metadata": {},
71+
"output_type": "display_data"
72+
}
73+
],
74+
"source": [
75+
"from nbody_sim.api import Simulation\n",
76+
"from nbody_sim.render import create_k3d_animation\n",
77+
"\n",
78+
"sim, config = Simulation.from_json('scenarios/asteroid_belt.json')\n",
79+
"\n",
80+
"name = config.get('name', 'Simulation')\n",
81+
"\n",
82+
"plot = create_k3d_animation(\n",
83+
" sim, \n",
84+
" dt=config['dt'], \n",
85+
" sizes=config['sizes'], \n",
86+
" colours=config['colours'], \n",
87+
" steps=300 \n",
88+
")\n",
89+
"\n",
90+
"plot.display()\n",
91+
"\n",
92+
"plot.camera = [0, -15, 10, 0, 0, 0, 0, 0, 1]"
93+
]
94+
}
95+
],
96+
"metadata": {
97+
"kernelspec": {
98+
"display_name": "RSE",
99+
"language": "python",
100+
"name": "python3"
101+
},
102+
"language_info": {
103+
"codemirror_mode": {
104+
"name": "ipython",
105+
"version": 3
106+
},
107+
"file_extension": ".py",
108+
"mimetype": "text/x-python",
109+
"name": "python",
110+
"nbconvert_exporter": "python",
111+
"pygments_lexer": "ipython3",
112+
"version": "3.14.3"
113+
}
114+
},
115+
"nbformat": 4,
116+
"nbformat_minor": 5
117+
}

0 commit comments

Comments
 (0)