osiris-utils 1.2.0__py3-none-any.whl → 1.2.1__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.
Binary file
@@ -1,6 +1,7 @@
1
1
  /* Sidebar background */
2
2
  .wy-nav-side {
3
- background: #88cbf8; /* Change to your preferred color */
3
+ background: #88cbf8;
4
+ /* Change to your preferred color */
4
5
  }
5
6
 
6
7
  /* Sidebar link color */
@@ -18,12 +19,17 @@
18
19
  background: #2f93f0;
19
20
  }
20
21
 
21
- .wy-menu-vertical li.current > a {
22
+ .wy-menu-vertical li.current>a {
22
23
  background: #aeecff;
23
24
  }
24
25
 
25
26
  /* Header (H1, H2, etc.) colors */
26
- h1, h2, h3, h4, h5, h6 {
27
+ h1,
28
+ h2,
29
+ h3,
30
+ h4,
31
+ h5,
32
+ h6 {
27
33
  color: #57bafb;
28
34
  }
29
35
 
@@ -43,11 +49,21 @@ a:hover {
43
49
 
44
50
  /* Keep your existing table width overrides */
45
51
  @media screen and (min-width: 767px) {
46
- .wy-table-responsive table td {
47
- white-space: normal !important;
48
- }
52
+ .wy-table-responsive table td {
53
+ white-space: normal !important;
54
+ }
49
55
 
50
- .wy-table-responsive {
51
- overflow: visible !important;
56
+ .wy-table-responsive {
57
+ overflow: visible !important;
58
+ }
52
59
  }
60
+
61
+ /* Small easter-egg logo sizing */
62
+ .wy-side-nav-search .logo img,
63
+ .wy-side-nav .logo img,
64
+ .rst-sidebar .logo img,
65
+ .logo img {
66
+ max-width: 80px;
67
+ margin: 6px 8px;
68
+ height: auto;
53
69
  }
docs/source/api/decks.rst CHANGED
@@ -25,7 +25,7 @@ InputDeckIO
25
25
 
26
26
  .. code-block:: python
27
27
 
28
- from osiris_utils.decks import InputDeckIO
28
+ from osiris_utils import InputDeckIO
29
29
 
30
30
  # Load an input deck
31
31
  deck = InputDeckIO("osiris.inp")
@@ -86,7 +86,7 @@ Derivative_Simulation Class
86
86
  from osiris_utils.postprocessing import Derivative_Simulation
87
87
 
88
88
  # Create a simulation interface
89
- sim = Simulation('/path/to/input/deck')
89
+ sim = Simulation('/path/to/input/deck.inp')
90
90
 
91
91
  # Create a derivative processor for x₁ derivatives
92
92
  dx1 = Derivative_Simulation(sim, 'x1')
@@ -206,7 +206,7 @@ This example shows how to compute the z-component of curl(B):
206
206
  from osiris_utils.postprocessing import Derivative
207
207
 
208
208
  # Setup
209
- sim = Simulation('/path/to/input/deck')
209
+ sim = Simulation('/path/to/input/deck.inp')
210
210
  dx1 = Derivative_Simulation(sim, 'x1')
211
211
  dx2 = Derivative_Simulation(sim, 'x2')
212
212
 
@@ -227,7 +227,7 @@ This example shows how to compute the divergence of E:
227
227
  from osiris_utils.postprocessing import Derivative_Diagnostic
228
228
 
229
229
  # Setup
230
- e1 = Diagnostic('/path/to/folder', Species, "path/to/input/deck")
230
+ e1 = Diagnostic('/path/to/folder', species=None, input_deck="/path/to/input/deck.inp")
231
231
 
232
232
  # Create derivative processor for x₁ and x₂ derivatives
233
233
  de1_dx1 = Derivative_Diagnostic(e1, 'x1')
@@ -281,7 +281,7 @@ FFT_Simulation Class
281
281
  from osiris_utils.postprocessing import FFT_Simulation
282
282
 
283
283
  # Create a simulation interface
284
- sim = Simulation('/path/to/input/deck')
284
+ sim = Simulation('/path/to/input/deck.inp')
285
285
 
286
286
  # Create an FFT processor for the first spatial dimension
287
287
  fft = FFT_Simulation(sim, 1)
@@ -379,7 +379,7 @@ This example shows how to compute and visualize a dispersion relation:
379
379
  import matplotlib.pyplot as plt
380
380
 
381
381
  # Setup
382
- sim = Simulation('/path/to/input/deck')
382
+ sim = Simulation('/path/to/input/deck.inp')
383
383
 
384
384
  # Create FFT processor for both time and space
385
385
  # We'll do a 2D FFT - time (axis 0) and x1 (axis 1)
@@ -467,7 +467,7 @@ MFT_Simulation Class
467
467
  from osiris_utils.postprocessing import MFT_Simulation
468
468
 
469
469
  # Create a simulation interface
470
- sim = Simulation('/path/to/input/deck')
470
+ sim = Simulation('/path/to/input/deck.inp')
471
471
 
472
472
  # Create MFT analyzer for x₁ direction (axis=1)
473
473
  mft = MFT_Simulation(sim, 1)
@@ -643,7 +643,7 @@ FieldCentering_Simulation Class
643
643
  from osiris_utils.postprocessing import FieldCentering_Simulation
644
644
 
645
645
  # Create a simulation interface
646
- sim = Simulation('/path/to/input/deck')
646
+ sim = Simulation('/path/to/input/deck.inp')
647
647
 
648
648
  # Create a field centering processor
649
649
  centered_sim = FieldCentering_Simulation(sim)
@@ -36,8 +36,8 @@ Simulation Class
36
36
 
37
37
  from osiris_utils.data import Simulation
38
38
 
39
- # Create a simulation interface for electron data
40
- sim = Simulation('path/to/simulation', "name_of_input_deck")
39
+ # Create a simulation interface
40
+ sim = Simulation('path/to/simulation/osiris.inp')
41
41
 
42
42
  # Access the E1 field diagnostic (doesn't load data yet) - this is a Diagnostic object
43
43
  # Since it is a diagnostic not related with the species, the species argument is not needed
@@ -63,7 +63,7 @@ Simulation Class
63
63
  b3 = sim['b3']
64
64
 
65
65
  # Load specific timesteps
66
- e1[10:20] # Load timesteps 10-19
66
+ e1[10:20, 0:10] # Load timesteps 10-19 and x1 0-10
67
67
 
68
68
  # Clean up to free memory
69
69
  sim.delete_diagnostic('e1')
@@ -134,7 +134,9 @@ Diagnostic Base Class
134
134
  .. code-block:: python
135
135
 
136
136
  # Create diagnostic for electron charge
137
- diag = Diagnostic("/path/to/simulation", species)
137
+ # Note: Use Simulation class for easier access instead of Diagnostic directly
138
+ electrons = Species("electrons", rqm=-1, q=-1)
139
+ diag = Diagnostic("/path/to/simulation", species=electrons)
138
140
  diag.get_quantity("charge")
139
141
 
140
142
  # Access specific timestep (without loading all data)
@@ -151,7 +153,7 @@ Diagnostic Base Class
151
153
  .. code-block:: python
152
154
 
153
155
  # Operations between diagnostics
154
- sim = Simulation("/path/to/simulation", species)
156
+ sim = Simulation("/path/to/simulation/osiris.inp")
155
157
  e1 = sim["e1"]
156
158
  vfl1 = sim["electron"]["vfl1"]
157
159
 
@@ -221,7 +223,7 @@ One of the most powerful features of the Diagnostic system is that new diagnosti
221
223
  .. code-block:: python
222
224
 
223
225
  # Create base diagnostics
224
- sim = Simulation("/path/to/simulation", "file_input_deck")
226
+ sim = Simulation("/path/to/simulation/osiris.inp")
225
227
  e1 = sim["e1"]
226
228
  e2 = sim["e2"]
227
229
  e3 = sim["e3"]
@@ -79,7 +79,7 @@ Particle Data
79
79
  .. code-block:: python
80
80
 
81
81
  import osiris_utils as ou
82
- raw = ou.raw = ou.OsirisRawFile("path/to/raw/file.h5")
82
+ raw = ou.OsirisRawFile("path/to/raw/file.h5")
83
83
  print(raw.data.keys())
84
84
  print(raw.data["x1"][0:10]) # Access x1 position of first 10 particles
85
85
 
@@ -107,7 +107,7 @@ Particle Data
107
107
  raw = ou.OsirisRawFile("path/to/raw/file/.../.h5")
108
108
  # Selecting 5 random tags from particles with energy>5
109
109
  mask = raw.data["ene"] > 5.
110
- raw_to_file_tags("output.tag", type="random", n_tags=5, mask=mask)
110
+ raw.raw_to_file_tags("output.tag", type="random", n_tags=5, mask=mask)
111
111
 
112
112
 
113
113
 
@@ -149,7 +149,7 @@ TRACK Data
149
149
  .. code-block:: python
150
150
 
151
151
  import osiris_utils as ou
152
- track = ou.OsirisTrackFile(path/to/track_file.h5)
152
+ track = ou.OsirisTrackFile("path/to/track_file.h5")
153
153
  print(track.data[0:10, :]["x1"]) # Access x1 position of first 10 particles over all time steps
154
154
 
155
155
 
@@ -175,7 +175,7 @@ Convert track file to the older more readable format
175
175
  .. code-block:: python
176
176
 
177
177
  >>> import osiris_utils as ou
178
- >>> ou.utils.convert_tracks('path/to/input_trackfile.h5')
178
+ >>> ou.convert_tracks('path/to/input_trackfile.h5')
179
179
  >>> # The output will be saved as 'path/to/input_trackfile-v2.h5'
180
180
 
181
181
  **Notes:**
@@ -209,7 +209,7 @@ To create a tag file directly from raw data, see :class:`osiris_utils.data.data.
209
209
  import osiris_utils as ou
210
210
  import numpy as np
211
211
  tags = np.array([[1, 12345], [2, 67890], [3, 11111]]) # Example tags
212
- ou.utils.create_file_tags('output.tag', tags)
212
+ ou.create_file_tags('output.tag', tags)
213
213
  # This will generate a file 'output.tag' with the particle tags.
214
214
 
215
215
  **Notes:**
docs/source/conf.py CHANGED
@@ -52,11 +52,30 @@ extensions = [
52
52
  nb_execution_mode = "off" # use stored output; avoids long CI builds
53
53
  # options for sphinx_github_style
54
54
  top_level = "OSIRIS Utils"
55
- linkcode_blob = "head"
55
+ linkcode_blob = "main"
56
56
  linkcode_url = r"https://github.com/joaopedrobiu6/osiris_utils/"
57
57
  linkcode_link_text = "Source"
58
58
 
59
59
 
60
+ def linkcode_resolve(domain, info):
61
+ """Return a URL to the source code for ``info``.
62
+
63
+ This implementation avoids invoking git or requiring a tag; it
64
+ constructs URLs pointing at the `linkcode_blob` branch on GitHub.
65
+ """
66
+ if domain != "py":
67
+ return None
68
+
69
+ module = info.get("module")
70
+ if not module:
71
+ return None
72
+
73
+ # Convert module path to file path
74
+ filename = module.replace(".", "/") + ".py"
75
+
76
+ return f"{linkcode_url}blob/{linkcode_blob}/{filename}"
77
+
78
+
60
79
  # numpydoc_class_members_toctree = False
61
80
  # Napoleon settings
62
81
  napoleon_google_docstring = False
@@ -81,11 +100,11 @@ templates_path = ["_templates"]
81
100
  # The suffix(es) of source filenames.
82
101
  # You can specify multiple suffix as a list of string:
83
102
  #
84
- source_suffix = [".rst", ".md"]
85
- # source_suffix = {
86
- # '.rst': 'restructuredtext',
87
- # '.md': 'markdown',
88
- # }
103
+ # source_suffix = [".rst", ".md"]
104
+ source_suffix = {
105
+ '.rst': 'restructuredtext',
106
+ '.md': 'markdown',
107
+ }
89
108
  # The master toctree document.
90
109
  master_doc = "index"
91
110
 
@@ -136,7 +155,7 @@ html_css_files = ["custom.css"]
136
155
 
137
156
  # The name of an image file (relative to this directory) to place at the top
138
157
  # of the sidebar.
139
- # html_logo = '_static/images/logo_small_clear.png'
158
+ html_logo = '_static/Imagem1.png'
140
159
 
141
160
  # The name of an image file (within the static path) to use as favicon of the
142
161
  # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
@@ -93,7 +93,7 @@ print('After', deck['simulation'])
93
93
  ```python
94
94
  # add a parameter
95
95
  print("Before", deck["simulation"])
96
- deck.set_param("simulation", "new_parameter", value='HI!', unexistent_ok=True)
96
+ deck.set_param("simulation", "new_parameter", value='HI', unexistent_ok=True)
97
97
  print("After", deck["simulation"])
98
98
  ```
99
99
 
@@ -144,5 +144,6 @@ Once you did your changes, you can simply generate a new input deck with `print_
144
144
 
145
145
  ```python
146
146
  deck.print_to_file("edited-deck.1d")
147
- ! cat edited-deck.1d
147
+ with open("edited-deck.1d") as f:
148
+ print(f.read())
148
149
  ```
@@ -13,14 +13,14 @@ import osiris_utils as ou
13
13
 
14
14
  # Example notebook for the `Simulation` and `Diagnostic` classes
15
15
 
16
- ### `Simulation`
16
+ ## `Simulation`
17
17
  The `Simulation` class takes in:
18
18
  - `simulation_folder`: the folder where the input deck is located
19
19
  - `species`: the species in case we are interested in diagnostics that are species-specific (such as vfl1, T11, etc.)
20
20
 
21
21
  Acts as a wrapper for the `Diagnostic` class, allowing for an easy access to diagnostics of the simulation using a **dictionary-like** syntax.
22
22
 
23
- ### `Diagnostic`
23
+ ## `Diagnostic`
24
24
 
25
25
  The `Diagnostic` class takes in:
26
26
  - `simulation_folder`: the folder where the input deck is located
@@ -46,7 +46,7 @@ print(sim.__dict__.keys())
46
46
  print(f"\n")
47
47
 
48
48
  # e3 is a Diagnostic object
49
- e3 = ou.Diagnostic("example_data", "electrons")
49
+ e3 = ou.Diagnostic(simulation_folder="example_data")
50
50
  # now we need to load the data
51
51
  e3.get_quantity("e3") # it knows the path there since OSIRIS always saves the data in the same way
52
52
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osiris_utils
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Utilities to manipulate and visualise OSIRIS plasma PIC output data
5
5
  Author-email: João Pedro Ferreira Biu <joaopedrofbiu@tecnico.ulisboa.pt>
6
6
  License: MIT
@@ -43,6 +43,11 @@ Dynamic: license-file
43
43
 
44
44
  OSIRIS_UTILS
45
45
  ============
46
+ .. image:: https://raw.githubusercontent.com/joaopedrobiu6/osiris_utils/main/docs/source/_static/Imagem1.png
47
+ :width: 200px
48
+ :align: right
49
+
50
+
46
51
  |Pypi|
47
52
 
48
53
  .. image:: https://github.com/joaopedrobiu6/osiris_utils/actions/workflows/ci.yml/badge.svg
@@ -158,3 +163,4 @@ Contributors
158
163
  - Diogo Carvalho
159
164
  - João Cândido
160
165
  - Margarida Pereira
166
+
@@ -1,19 +1,20 @@
1
1
  benchmarks/benchmark_hdf5_io.py,sha256=62TM4A6XuNKUNh7-B9lE7Zbd7IlGBXbiTNeJCXvVdhE,1228
2
2
  benchmarks/benchmark_load_all.py,sha256=GKCFf-aJIGZ7E7IfyiziSd1dqFnC_jzgmsAW50f9OyM,1589
3
- docs/source/conf.py,sha256=MT6jDTKyZQJTq5iEQ9W1yEWcUO2sqiW9ocs6pN8kzzQ,6096
3
+ docs/source/conf.py,sha256=1y08f-JzVCs_revzNsKO6PB6J4KIz4wGVCZEmz-6ozM,6573
4
4
  docs/source/contrib.rst,sha256=CkYSzy3msde38fy0zROAjDsdRHYYvQSAJwjkJczFmGI,35
5
5
  docs/source/examples.rst,sha256=IFl6kRAYUHO1hmExBYKBCPPFjS82gol8cQYXLNawsi8,303
6
6
  docs/source/index.rst,sha256=djTvENMR-HNC5q0Wh8hsrB7in5IY6augL9OLxnlpsFA,599
7
- docs/source/_static/custom.css,sha256=aLsKMK8rejJzzCdISkHhDG8Eq-f7T4v4DmQInYzeRDI,909
7
+ docs/source/_static/Imagem1.png,sha256=4NtHIBlqc1qoryC9qPz8PzAl2WCkegb1eQTXBDePfv8,878979
8
+ docs/source/_static/custom.css,sha256=KJO7s8zlu2_16WICQB7U5NTfcJelwmHmA1Uj3WqfSLg,1103
8
9
  docs/source/_static/quick_start_ez.png,sha256=_pxXBOTl30EMkCcbiehp-F0vk-nd8r9VF25Cz4tORPU,50829
9
- docs/source/api/decks.rst,sha256=i-4T68MWYtsIF6uoMJPeOuL5zHnbpRu8mxBwBz9MXVA,1153
10
- docs/source/api/postprocess.rst,sha256=2E5z_xevGPYeWjdN_6RAtU-XWK83mmixzOznbWEs3_k,21706
11
- docs/source/api/sim_diag.rst,sha256=S02gqg55jenzpLpbUvWBuOBRkLLOZhgtILz6SXhhTZQ,8787
12
- docs/source/api/utilities.rst,sha256=B1mI2I7AKl3tXQ0MqNSN6Vxj_ZHU_Qvmp20hiYgK5jw,9614
10
+ docs/source/api/decks.rst,sha256=iTcMUiSSlb7rmqzwLG4T5bjShFiAWdSIsDBWQljkbwE,1147
11
+ docs/source/api/postprocess.rst,sha256=8Uhtp9V3CVeYghk_aavWJqGEccOj3v67ZJR1FpdWHoI,21751
12
+ docs/source/api/sim_diag.rst,sha256=Ma4jMZXSLvVMxiDQtJzM51iskh3hx2NX6MD-ATIIqNs,8919
13
+ docs/source/api/utilities.rst,sha256=DlJVDykwuoN7YEF6e75UbSG3fQiCNbcDGM89mNMOcUI,9599
13
14
  docs/source/examples/example_Derivatives.md,sha256=p0tLobnmLyFKPkDSeFshKpzYi4rYVjBnn2oo_ekcB7g,2378
14
15
  docs/source/examples/example_FFT.md,sha256=JbFNm0C8EVEhnY6vTiKFD2IKBVwFoCpv-35OcrzRl7M,6086
15
- docs/source/examples/example_InputDeck.md,sha256=Cf4s7_XFqPXp5eovHsPhQGu7UKF4GXis4eVel2TUrXw,4327
16
- docs/source/examples/example_Simulation_Diagnostic.md,sha256=ixCw2fg-08Y2NHKjAIiPeZX2DUuQ3BdxFYuh07xwTso,7456
16
+ docs/source/examples/example_InputDeck.md,sha256=OOch34FN-nmqQAqw0R17aiLsmTs0D3Qc4icdulbNTBw,4359
17
+ docs/source/examples/example_Simulation_Diagnostic.md,sha256=IpW5xJITRcKoxAoqYqSZuBDk3M4RxnKiK7oD-lEezCQ,7459
17
18
  docs/source/examples/quick_start.md,sha256=yt0b9Lz85ylMGEZPKLQpD7qFeISkEJo_FutMJP6wSu4,837
18
19
  examples/edited-deck.1d,sha256=D6fIVzw_mtSnQbQPALs9tl9Fnm2oBnRJuWu7ecCKv4U,1018
19
20
  examples/example_Derivatives.ipynb,sha256=L9NBEdTLMv7n7og0o9tvQ0We77vuCJVAzMIAAQcRd4k,4584
@@ -1071,9 +1072,9 @@ osiris_utils/postprocessing/postprocess.py,sha256=-_zydCuK7RsH2kTT5vGpIZd5dQco9i
1071
1072
  osiris_utils/postprocessing/pressure_correction.py,sha256=N0UwUmW7eEcr1OdgzyIwY-rFxUKXomfsQvTUobKXBlw,7223
1072
1073
  osiris_utils/vis/__init__.py,sha256=Vr0o8wtRFtPOJdSK5cRIa_bDvbylAe2sHTk8c7qO_tM,51
1073
1074
  osiris_utils/vis/plot3d.py,sha256=ywP9UGI4i3SRgUdsz-ILHxc7W_StCSN1D1U4Tmpd_6o,4658
1074
- osiris_utils-1.2.0.dist-info/licenses/LICENSE.txt,sha256=z1lVzLA_QsfcnLffhfWMrFw5cR_nuwpvbOGCOFUN7iY,1066
1075
- osiris_utils-1.2.0.dist-info/METADATA,sha256=7IgAe88iZbzaZ53jT5toI4FEnM9LZXyb6GWAHAtRI84,5436
1076
- osiris_utils-1.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
1077
- osiris_utils-1.2.0.dist-info/entry_points.txt,sha256=s3WXJWsWF5AWEFhJ8rXscjGttQCOXvViOiNmX45AJjo,49
1078
- osiris_utils-1.2.0.dist-info/top_level.txt,sha256=tSs2XcOs-JtYsqVepo5WVSNcilf6ALHfKyYuPaVZLco,38
1079
- osiris_utils-1.2.0.dist-info/RECORD,,
1075
+ osiris_utils-1.2.1.dist-info/licenses/LICENSE.txt,sha256=z1lVzLA_QsfcnLffhfWMrFw5cR_nuwpvbOGCOFUN7iY,1066
1076
+ osiris_utils-1.2.1.dist-info/METADATA,sha256=p7q91bTXXIo2cZzX2gXsDno84ItWr4_x9oI3kKG4uM0,5582
1077
+ osiris_utils-1.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
1078
+ osiris_utils-1.2.1.dist-info/entry_points.txt,sha256=s3WXJWsWF5AWEFhJ8rXscjGttQCOXvViOiNmX45AJjo,49
1079
+ osiris_utils-1.2.1.dist-info/top_level.txt,sha256=tSs2XcOs-JtYsqVepo5WVSNcilf6ALHfKyYuPaVZLco,38
1080
+ osiris_utils-1.2.1.dist-info/RECORD,,