osiris-utils 1.1.10a0__py3-none-any.whl → 1.2.0__py3-none-any.whl

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 (52) hide show
  1. benchmarks/benchmark_hdf5_io.py +46 -0
  2. benchmarks/benchmark_load_all.py +54 -0
  3. docs/source/api/decks.rst +48 -0
  4. docs/source/api/postprocess.rst +66 -2
  5. docs/source/api/sim_diag.rst +1 -1
  6. docs/source/api/utilities.rst +1 -1
  7. docs/source/conf.py +2 -1
  8. docs/source/examples/example_Derivatives.md +78 -0
  9. docs/source/examples/example_FFT.md +152 -0
  10. docs/source/examples/example_InputDeck.md +148 -0
  11. docs/source/examples/example_Simulation_Diagnostic.md +213 -0
  12. docs/source/examples/quick_start.md +51 -0
  13. docs/source/examples.rst +14 -0
  14. docs/source/index.rst +8 -0
  15. examples/edited-deck.1d +1 -1
  16. examples/example_Derivatives.ipynb +24 -36
  17. examples/example_FFT.ipynb +44 -23
  18. examples/example_InputDeck.ipynb +24 -277
  19. examples/example_Simulation_Diagnostic.ipynb +27 -17
  20. examples/quick_start.ipynb +17 -1
  21. osiris_utils/__init__.py +10 -6
  22. osiris_utils/cli/__init__.py +6 -0
  23. osiris_utils/cli/__main__.py +85 -0
  24. osiris_utils/cli/export.py +199 -0
  25. osiris_utils/cli/info.py +156 -0
  26. osiris_utils/cli/plot.py +189 -0
  27. osiris_utils/cli/validate.py +247 -0
  28. osiris_utils/data/__init__.py +15 -0
  29. osiris_utils/data/data.py +41 -171
  30. osiris_utils/data/diagnostic.py +285 -274
  31. osiris_utils/data/simulation.py +20 -13
  32. osiris_utils/decks/__init__.py +4 -0
  33. osiris_utils/decks/decks.py +83 -8
  34. osiris_utils/decks/species.py +12 -9
  35. osiris_utils/postprocessing/__init__.py +28 -0
  36. osiris_utils/postprocessing/derivative.py +317 -106
  37. osiris_utils/postprocessing/fft.py +135 -24
  38. osiris_utils/postprocessing/field_centering.py +28 -14
  39. osiris_utils/postprocessing/heatflux_correction.py +39 -18
  40. osiris_utils/postprocessing/mft.py +10 -2
  41. osiris_utils/postprocessing/postprocess.py +8 -5
  42. osiris_utils/postprocessing/pressure_correction.py +29 -17
  43. osiris_utils/utils.py +26 -17
  44. osiris_utils/vis/__init__.py +3 -0
  45. osiris_utils/vis/plot3d.py +148 -0
  46. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/METADATA +55 -7
  47. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/RECORD +51 -34
  48. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/WHEEL +1 -1
  49. osiris_utils-1.2.0.dist-info/entry_points.txt +2 -0
  50. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/top_level.txt +1 -0
  51. osiris_utils/postprocessing/mft_for_gridfile.py +0 -55
  52. {osiris_utils-1.1.10a0.dist-info → osiris_utils-1.2.0.dist-info}/licenses/LICENSE.txt +0 -0
@@ -2,7 +2,7 @@
2
2
  "cells": [
3
3
  {
4
4
  "cell_type": "code",
5
- "execution_count": 1,
5
+ "execution_count": null,
6
6
  "metadata": {},
7
7
  "outputs": [],
8
8
  "source": [
@@ -12,7 +12,7 @@
12
12
  },
13
13
  {
14
14
  "cell_type": "code",
15
- "execution_count": 2,
15
+ "execution_count": null,
16
16
  "metadata": {},
17
17
  "outputs": [],
18
18
  "source": [
@@ -38,73 +38,9 @@
38
38
  },
39
39
  {
40
40
  "cell_type": "code",
41
- "execution_count": 3,
41
+ "execution_count": null,
42
42
  "metadata": {},
43
- "outputs": [
44
- {
45
- "name": "stdout",
46
- "output_type": "stream",
47
- "text": [
48
- "\n",
49
- "Parsing input deck : example_data/thermal.1d\n",
50
- "Reading simulation\n",
51
- " random_seed = 0\n",
52
- " wall_clock_limit = \"23:50:00\"\n",
53
- " wall_clock_check = 2000\n",
54
- " wall_clock_checkpoint = .true.\n",
55
- "Reading node_conf\n",
56
- " node_number(1:1) = 4\n",
57
- " if_periodic(1:1) = .true.\n",
58
- "Reading grid\n",
59
- " nx_p(1:1) = 500\n",
60
- " coordinates = \"cartesian\"\n",
61
- "Reading time_step\n",
62
- " dt = 0.0099\n",
63
- " ndump = 1\n",
64
- "Reading restart\n",
65
- " if_restart = .false.\n",
66
- "Reading space\n",
67
- " xmin(1:1) = 0.\n",
68
- " xmax(1:1) = 5.0\n",
69
- " if_move(1:1) = .false.\n",
70
- "Reading time\n",
71
- " tmin = 0.0d0\n",
72
- " tmax = 2.5\n",
73
- "Reading el_mag_fld\n",
74
- "Reading emf_bound\n",
75
- " type(1:2,1) = \"open\",\"open\"\n",
76
- "Reading diag_emf\n",
77
- " ndump_fac = 1\n",
78
- " ndump_fac_ene_int = 1\n",
79
- " reports = \"e1\",\"e2\",\"e3\"\n",
80
- "Reading particles\n",
81
- " interpolation = \"linear\"\n",
82
- " num_species = 1\n",
83
- "Reading species\n",
84
- " name = \"electrons\"\n",
85
- " num_par_max = 2048\n",
86
- " rqm = -1.0\n",
87
- " num_par_x(1:1) = 64\n",
88
- "Reading udist\n",
89
- " uth_type = \"thermal\"\n",
90
- " uth(1:3) = 0.01,0.01,0.01\n",
91
- "Reading profile\n",
92
- " density = 1\n",
93
- " profile_type = \"uniform\"\n",
94
- "Reading spe_bound\n",
95
- "Reading diag_species\n",
96
- " ndump_fac_ene = 1\n",
97
- " ndump_fac_temp = 1\n",
98
- " ndump_fac = 1\n",
99
- " reports = \"charge\"\n",
100
- " rep_udist = \"vfl1\",\"T11\"\n",
101
- "Reading smooth\n",
102
- "Reading diag_current\n",
103
- "Input deck successfully parsed\n",
104
- "\n"
105
- ]
106
- }
107
- ],
43
+ "outputs": [],
108
44
  "source": [
109
45
  "deck = ou.InputDeckIO('example_data/thermal.1d', verbose=True)"
110
46
  ]
@@ -123,19 +59,9 @@
123
59
  },
124
60
  {
125
61
  "cell_type": "code",
126
- "execution_count": 4,
62
+ "execution_count": null,
127
63
  "metadata": {},
128
- "outputs": [
129
- {
130
- "name": "stdout",
131
- "output_type": "stream",
132
- "text": [
133
- "Simulation Dimensions: 1\n",
134
- "Number of species: 1\n",
135
- "Species: {'electrons': Specie(name=electrons, rqm=-1.0, q=-1.0, m=1.0)}\n"
136
- ]
137
- }
138
- ],
64
+ "outputs": [],
139
65
  "source": [
140
66
  "print(\"Simulation Dimensions:\", deck.dim)\n",
141
67
  "print(\"Number of species:\", deck.n_species)\n",
@@ -155,19 +81,9 @@
155
81
  },
156
82
  {
157
83
  "cell_type": "code",
158
- "execution_count": 5,
84
+ "execution_count": null,
159
85
  "metadata": {},
160
- "outputs": [
161
- {
162
- "name": "stdout",
163
- "output_type": "stream",
164
- "text": [
165
- "['simulation', {'random_seed': '0', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n",
166
- "['node_conf', {'node_number(1:1)': '4', 'if_periodic(1:1)': '.true.'}]\n",
167
- "Number of sections: 18\n"
168
- ]
169
- }
170
- ],
86
+ "outputs": [],
171
87
  "source": [
172
88
  "print(deck.sections[0])\n",
173
89
  "print(deck.sections[1])\n",
@@ -187,18 +103,9 @@
187
103
  },
188
104
  {
189
105
  "cell_type": "code",
190
- "execution_count": 6,
106
+ "execution_count": null,
191
107
  "metadata": {},
192
- "outputs": [
193
- {
194
- "name": "stdout",
195
- "output_type": "stream",
196
- "text": [
197
- "[{'random_seed': '0', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n",
198
- "[{'node_number(1:1)': '4', 'if_periodic(1:1)': '.true.'}]\n"
199
- ]
200
- }
201
- ],
108
+ "outputs": [],
202
109
  "source": [
203
110
  "print(deck['simulation'])\n",
204
111
  "print(deck['node_conf'])"
@@ -213,18 +120,9 @@
213
120
  },
214
121
  {
215
122
  "cell_type": "code",
216
- "execution_count": 7,
123
+ "execution_count": null,
217
124
  "metadata": {},
218
- "outputs": [
219
- {
220
- "name": "stdout",
221
- "output_type": "stream",
222
- "text": [
223
- "0\n",
224
- "0\n"
225
- ]
226
- }
227
- ],
125
+ "outputs": [],
228
126
  "source": [
229
127
  "# this one returns a list since there can be multiple sections with the same name\n",
230
128
  "print(deck.get_param(section='simulation', param='random_seed')[0])\n",
@@ -245,18 +143,9 @@
245
143
  },
246
144
  {
247
145
  "cell_type": "code",
248
- "execution_count": 8,
146
+ "execution_count": null,
249
147
  "metadata": {},
250
- "outputs": [
251
- {
252
- "name": "stdout",
253
- "output_type": "stream",
254
- "text": [
255
- "Before [{'random_seed': '0', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n",
256
- "After [{'random_seed': '42', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n"
257
- ]
258
- }
259
- ],
148
+ "outputs": [],
260
149
  "source": [
261
150
  "# edit a parameter already exists\n",
262
151
  "print('Before', deck['simulation'])\n",
@@ -266,18 +155,9 @@
266
155
  },
267
156
  {
268
157
  "cell_type": "code",
269
- "execution_count": 9,
158
+ "execution_count": null,
270
159
  "metadata": {},
271
- "outputs": [
272
- {
273
- "name": "stdout",
274
- "output_type": "stream",
275
- "text": [
276
- "Before [{'random_seed': '42', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n",
277
- "After [{'random_seed': '42', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.', 'new_parameter': '\"HI!\"'}]\n"
278
- ]
279
- }
280
- ],
160
+ "outputs": [],
281
161
  "source": [
282
162
  "# add a parameter\n",
283
163
  "print(\"Before\", deck[\"simulation\"])\n",
@@ -294,18 +174,9 @@
294
174
  },
295
175
  {
296
176
  "cell_type": "code",
297
- "execution_count": 10,
177
+ "execution_count": null,
298
178
  "metadata": {},
299
- "outputs": [
300
- {
301
- "name": "stdout",
302
- "output_type": "stream",
303
- "text": [
304
- "Before [{'random_seed': '42', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.', 'new_parameter': '\"HI!\"'}]\n",
305
- "After [{'random_seed': '42', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n"
306
- ]
307
- }
308
- ],
179
+ "outputs": [],
309
180
  "source": [
310
181
  "# delete a parameter\n",
311
182
  "print(\"Before\", deck[\"simulation\"])\n",
@@ -328,19 +199,9 @@
328
199
  },
329
200
  {
330
201
  "cell_type": "code",
331
- "execution_count": 11,
202
+ "execution_count": null,
332
203
  "metadata": {},
333
- "outputs": [
334
- {
335
- "name": "stdout",
336
- "output_type": "stream",
337
- "text": [
338
- "Before [{'random_seed': '42', 'wall_clock_limit': '\"23:50:00\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n",
339
- "After 1 [{'random_seed': '#tag#', 'wall_clock_limit': '\"#tag#\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n",
340
- "After 2 [{'random_seed': 'BOTH CHANGED', 'wall_clock_limit': '\"BOTH CHANGED\"', 'wall_clock_check': '2000', 'wall_clock_checkpoint': '.true.'}]\n"
341
- ]
342
- }
343
- ],
204
+ "outputs": [],
344
205
  "source": [
345
206
  "# this a dummy example where we change some values to #tag#\n",
346
207
  "print(\"Before\", deck[\"simulation\"])\n",
@@ -373,123 +234,9 @@
373
234
  },
374
235
  {
375
236
  "cell_type": "code",
376
- "execution_count": 12,
237
+ "execution_count": null,
377
238
  "metadata": {},
378
- "outputs": [
379
- {
380
- "name": "stdout",
381
- "output_type": "stream",
382
- "text": [
383
- "simulation\n",
384
- "{\n",
385
- "\trandom_seed = BOTH CHANGED,\n",
386
- "\twall_clock_limit = \"BOTH CHANGED\",\n",
387
- "\twall_clock_check = 2000,\n",
388
- "\twall_clock_checkpoint = .true.,\n",
389
- "}\n",
390
- "\n",
391
- "node_conf\n",
392
- "{\n",
393
- "\tnode_number(1:1) = 4,\n",
394
- "\tif_periodic(1:1) = .true.,\n",
395
- "}\n",
396
- "\n",
397
- "grid\n",
398
- "{\n",
399
- "\tnx_p(1:1) = 500,\n",
400
- "\tcoordinates = \"cartesian\",\n",
401
- "}\n",
402
- "\n",
403
- "time_step\n",
404
- "{\n",
405
- "\tdt = 0.0099,\n",
406
- "\tndump = 1,\n",
407
- "}\n",
408
- "\n",
409
- "restart\n",
410
- "{\n",
411
- "\tif_restart = .false.,\n",
412
- "}\n",
413
- "\n",
414
- "space\n",
415
- "{\n",
416
- "\txmin(1:1) = 0.,\n",
417
- "\txmax(1:1) = 5.0,\n",
418
- "\tif_move(1:1) = .false.,\n",
419
- "}\n",
420
- "\n",
421
- "time\n",
422
- "{\n",
423
- "\ttmin = 0.0d0,\n",
424
- "\ttmax = 2.5,\n",
425
- "}\n",
426
- "\n",
427
- "el_mag_fld\n",
428
- "{\n",
429
- "}\n",
430
- "\n",
431
- "emf_bound\n",
432
- "{\n",
433
- "\ttype(1:2,1) = \"open\", \"open\",\n",
434
- "}\n",
435
- "\n",
436
- "diag_emf\n",
437
- "{\n",
438
- "\tndump_fac = 1,\n",
439
- "\tndump_fac_ene_int = 1,\n",
440
- "\treports = \"e1\", \"e2\", \"e3\",\n",
441
- "}\n",
442
- "\n",
443
- "particles\n",
444
- "{\n",
445
- "\tinterpolation = \"linear\",\n",
446
- "\tnum_species = 1,\n",
447
- "}\n",
448
- "\n",
449
- "species\n",
450
- "{\n",
451
- "\tname = \"electrons\",\n",
452
- "\tnum_par_max = 2048,\n",
453
- "\trqm = -1.0,\n",
454
- "\tnum_par_x(1:1) = 64,\n",
455
- "}\n",
456
- "\n",
457
- "udist\n",
458
- "{\n",
459
- "\tuth_type = \"thermal\",\n",
460
- "\tuth(1:3) = 0.01, 0.01, 0.01,\n",
461
- "}\n",
462
- "\n",
463
- "profile\n",
464
- "{\n",
465
- "\tdensity = 1,\n",
466
- "\tprofile_type = \"uniform\",\n",
467
- "}\n",
468
- "\n",
469
- "spe_bound\n",
470
- "{\n",
471
- "}\n",
472
- "\n",
473
- "diag_species\n",
474
- "{\n",
475
- "\tndump_fac_ene = 1,\n",
476
- "\tndump_fac_temp = 1,\n",
477
- "\tndump_fac = 1,\n",
478
- "\treports = \"charge\",\n",
479
- "\trep_udist = \"vfl1\", \"T11\",\n",
480
- "}\n",
481
- "\n",
482
- "smooth\n",
483
- "{\n",
484
- "}\n",
485
- "\n",
486
- "diag_current\n",
487
- "{\n",
488
- "}\n",
489
- "\n"
490
- ]
491
- }
492
- ],
239
+ "outputs": [],
493
240
  "source": [
494
241
  "deck.print_to_file(\"edited-deck.1d\")\n",
495
242
  "! cat edited-deck.1d"
@@ -498,7 +245,7 @@
498
245
  ],
499
246
  "metadata": {
500
247
  "kernelspec": {
501
- "display_name": "tese-env",
248
+ "display_name": "plasma",
502
249
  "language": "python",
503
250
  "name": "python3"
504
251
  },
@@ -512,7 +259,7 @@
512
259
  "name": "python",
513
260
  "nbconvert_exporter": "python",
514
261
  "pygments_lexer": "ipython3",
515
- "version": "3.12.8"
262
+ "version": "3.13.5"
516
263
  }
517
264
  },
518
265
  "nbformat": 4,
@@ -6,10 +6,20 @@
6
6
  "metadata": {},
7
7
  "outputs": [],
8
8
  "source": [
9
- "import osiris_utils as ou\n",
10
- "import numpy as np\n",
9
+ "%load_ext autoreload\n",
10
+ "%autoreload 2"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": null,
16
+ "metadata": {},
17
+ "outputs": [],
18
+ "source": [
11
19
  "import matplotlib.pyplot as plt\n",
12
- "from matplotlib.colors import LogNorm"
20
+ "import numpy as np\n",
21
+ "\n",
22
+ "import osiris_utils as ou"
13
23
  ]
14
24
  },
15
25
  {
@@ -68,7 +78,7 @@
68
78
  "# e3 is a Diagnostic object\n",
69
79
  "e3 = ou.Diagnostic(\"example_data\", \"electrons\")\n",
70
80
  "# now we need to load the data\n",
71
- "e3.get_quantity(\"e3\") # it knows the path there since OSIRIS always saves the data in the same way\n",
81
+ "e3.get_quantity(\"e3\") # it knows the path there since OSIRIS always saves the data in the same way\n",
72
82
  "\n",
73
83
  "print(\"Diagnostic: (e3)\")\n",
74
84
  "print(e3)\n",
@@ -118,7 +128,7 @@
118
128
  "metadata": {},
119
129
  "outputs": [],
120
130
  "source": [
121
- "sim[\"e3\"] # This is equivalent to e3\n",
131
+ "sim[\"e3\"] # This is equivalent to e3\n",
122
132
  "\n",
123
133
  "print(sim[\"e3\"])\n",
124
134
  "print(sim[\"e3\"].__dict__.keys())"
@@ -137,8 +147,8 @@
137
147
  "metadata": {},
138
148
  "outputs": [],
139
149
  "source": [
140
- "print(sim[\"e3\"][100].shape) # nx\n",
141
- "print(e3[100].shape) # nx\n",
150
+ "print(sim[\"e3\"][100].shape) # nx\n",
151
+ "print(e3[100].shape) # nx\n",
142
152
  "\n",
143
153
  "print(\"Are they the same?\", np.isclose(sim[\"e3\"][100], e3[100]).all())"
144
154
  ]
@@ -158,7 +168,7 @@
158
168
  "metadata": {},
159
169
  "outputs": [],
160
170
  "source": [
161
- "plt.figure(figsize=(12,4))\n",
171
+ "plt.figure(figsize=(12, 4))\n",
162
172
  "plt.subplot(121)\n",
163
173
  "plt.plot(sim[\"e3\"].x, sim[\"e3\"][100], label=\"Simulation\", c=\"tab:orange\")\n",
164
174
  "plt.title(\"Using Simulation\")\n",
@@ -200,7 +210,7 @@
200
210
  "sim[\"e3\"].load_all()\n",
201
211
  "\n",
202
212
  "# now, the data is loaded in memory\n",
203
- "print(sim[\"e3\"].data.shape) # (n_steps, nx)\n",
213
+ "print(sim[\"e3\"].data.shape) # (n_steps, nx)\n",
204
214
  "\n",
205
215
  "sim[\"e3\"].unload()"
206
216
  ]
@@ -220,7 +230,7 @@
220
230
  "metadata": {},
221
231
  "outputs": [],
222
232
  "source": [
223
- "sum_of_diag = sim[\"electrons\"][\"T11\"] + sim[\"electrons\"][\"vfl1\"] \n",
233
+ "sum_of_diag = sim[\"electrons\"][\"T11\"] + sim[\"electrons\"][\"vfl1\"]\n",
224
234
  "\n",
225
235
  "print(sum_of_diag)\n",
226
236
  "print(sum_of_diag.__dict__.keys())"
@@ -241,7 +251,7 @@
241
251
  "source": [
242
252
  "# we can load all the data at once\n",
243
253
  "sum_of_diag.load_all()\n",
244
- "print(sum_of_diag.data.shape) # (n_steps, nx)\n",
254
+ "print(sum_of_diag.data.shape) # (n_steps, nx)\n",
245
255
  "sum_of_diag.unload()"
246
256
  ]
247
257
  },
@@ -258,7 +268,7 @@
258
268
  "metadata": {},
259
269
  "outputs": [],
260
270
  "source": [
261
- "plt.figure(figsize=(12,4))\n",
271
+ "plt.figure(figsize=(12, 4))\n",
262
272
  "plt.subplot(121)\n",
263
273
  "plt.plot(sum_of_diag.x, sum_of_diag[100], label=\"T11 + vfl1\", c=\"tab:orange\")\n",
264
274
  "plt.title(\"Diagnostic from sum of two diagnostics\")\n",
@@ -280,7 +290,7 @@
280
290
  "metadata": {},
281
291
  "outputs": [],
282
292
  "source": [
283
- "nT = -1*sim[\"electrons\"][\"T11\"]*sim[\"electrons\"][\"charge\"] # -1 because we are dealing with electrons"
293
+ "nT = -1 * sim[\"electrons\"][\"T11\"] * sim[\"electrons\"][\"charge\"] # -1 because we are dealing with electrons"
284
294
  ]
285
295
  },
286
296
  {
@@ -289,7 +299,7 @@
289
299
  "metadata": {},
290
300
  "outputs": [],
291
301
  "source": [
292
- "plt.figure(figsize=(6,4))\n",
302
+ "plt.figure(figsize=(6, 4))\n",
293
303
  "plt.plot(nT.x, nT[100], label=r\"$n_eT_{11}$\", c=\"tab:green\")\n",
294
304
  "plt.title(r\"$n_eT_{11}$\")\n",
295
305
  "plt.xlabel(nT.axis[0][\"plot_label\"])\n",
@@ -313,7 +323,7 @@
313
323
  "sim[\"electrons\"][\"vfl1\"].load_all()\n",
314
324
  "sim[\"electrons\"][\"charge\"].load_all()\n",
315
325
  "\n",
316
- "v_times_charge = sim[\"electrons\"][\"vfl1\"]*sim[\"electrons\"][\"charge\"]\n",
326
+ "v_times_charge = sim[\"electrons\"][\"vfl1\"] * sim[\"electrons\"][\"charge\"]\n",
317
327
  "\n",
318
328
  "print(v_times_charge)\n",
319
329
  "print(v_times_charge.__dict__.keys())"
@@ -357,7 +367,7 @@
357
367
  ],
358
368
  "metadata": {
359
369
  "kernelspec": {
360
- "display_name": "tese-env",
370
+ "display_name": "plasma",
361
371
  "language": "python",
362
372
  "name": "python3"
363
373
  },
@@ -371,7 +381,7 @@
371
381
  "name": "python",
372
382
  "nbconvert_exporter": "python",
373
383
  "pygments_lexer": "ipython3",
374
- "version": "3.12.8"
384
+ "version": "3.14.2"
375
385
  }
376
386
  },
377
387
  "nbformat": 4,
@@ -1,5 +1,16 @@
1
1
  {
2
2
  "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "id": "cd01bded",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "%load_ext autoreload\n",
11
+ "%autoreload 2"
12
+ ]
13
+ },
3
14
  {
4
15
  "cell_type": "code",
5
16
  "execution_count": null,
@@ -24,8 +35,10 @@
24
35
  "source": [
25
36
  "import sys\n",
26
37
  "from pathlib import Path\n",
38
+ "\n",
27
39
  "import matplotlib.pyplot as plt\n",
28
- "import osiris_utils as ou"
40
+ "\n",
41
+ "import osiris_utils as ou\n"
29
42
  ]
30
43
  },
31
44
  {
@@ -75,6 +88,9 @@
75
88
  "cell_metadata_filter": "-all",
76
89
  "formats": "ipynb,py",
77
90
  "main_language": "python"
91
+ },
92
+ "language_info": {
93
+ "name": "python"
78
94
  }
79
95
  },
80
96
  "nbformat": 4,
osiris_utils/__init__.py CHANGED
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from importlib import metadata as _meta
2
4
 
3
5
  try:
@@ -7,6 +9,7 @@ except _meta.PackageNotFoundError: # package is being run from a checkout
7
9
  # Fallback for `pip install -e .` or direct source use
8
10
  __version__ = "0.0.0.dev0"
9
11
 
12
+
10
13
  from .data.data import (
11
14
  OsirisData,
12
15
  OsirisGridFile,
@@ -17,7 +20,7 @@ from .data.data import (
17
20
  from .data.diagnostic import Diagnostic
18
21
  from .data.simulation import Simulation, Species_Handler
19
22
  from .decks.decks import InputDeckIO
20
- from .decks.species import Specie
23
+ from .decks.species import Species
21
24
  from .postprocessing.derivative import Derivative_Diagnostic, Derivative_Simulation
22
25
  from .postprocessing.fft import FFT_Diagnostic, FFT_Simulation
23
26
  from .postprocessing.field_centering import (
@@ -34,14 +37,15 @@ from .postprocessing.mft import (
34
37
  MFT_Diagnostic_Fluctuations,
35
38
  MFT_Simulation,
36
39
  )
37
- from .postprocessing.mft_for_gridfile import MFT_Single
38
40
  from .postprocessing.postprocess import PostProcess
39
41
  from .postprocessing.pressure_correction import (
40
42
  PressureCorrection_Diagnostic,
41
43
  PressureCorrection_Simulation,
42
44
  )
43
45
  from .utils import (
46
+ convert_tracks,
44
47
  courant2D,
48
+ create_file_tags,
45
49
  filesize_estimation,
46
50
  integrate,
47
51
  read_data,
@@ -62,7 +66,7 @@ __all__ = [
62
66
  "Diagnostic",
63
67
  "Species_Handler",
64
68
  # Decks
65
- "Specie",
69
+ "Species",
66
70
  "InputDeckIO",
67
71
  # PostProcessing
68
72
  "PostProcess",
@@ -80,14 +84,14 @@ __all__ = [
80
84
  "PressureCorrection_Diagnostic",
81
85
  "HeatfluxCorrection_Simulation",
82
86
  "HeatfluxCorrection_Diagnostic",
83
- # Single file MFT
84
- "MFT_Single",
85
87
  # Utilities
88
+ "courant2D",
86
89
  "time_estimation",
87
90
  "filesize_estimation",
88
91
  "transverse_average",
89
92
  "integrate",
90
93
  "save_data",
91
94
  "read_data",
92
- "courant2D",
95
+ "convert_tracks",
96
+ "create_file_tags",
93
97
  ]
@@ -0,0 +1,6 @@
1
+ """CLI subcommands for osiris_utils."""
2
+
3
+ from . import export, info, plot, validate
4
+ from .__main__ import main
5
+
6
+ __all__ = ["info", "export", "plot", "validate", "main"]