lavavu 1.8.80__cp38-cp38-macosx_11_0_arm64.whl → 1.8.81__cp38-cp38-macosx_11_0_arm64.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.
lavavu/LavaVuPython.py CHANGED
@@ -481,6 +481,7 @@ class LavaVu(object):
481
481
  web = _swig_new_instance_method(_LavaVuPython.LavaVu_web)
482
482
  video = _swig_new_instance_method(_LavaVuPython.LavaVu_video)
483
483
  encodeVideo = _swig_new_instance_method(_LavaVuPython.LavaVu_encodeVideo)
484
+ pauseVideo = _swig_new_instance_method(_LavaVuPython.LavaVu_pauseVideo)
484
485
  defaultModel = _swig_new_instance_method(_LavaVuPython.LavaVu_defaultModel)
485
486
  addColourMap = _swig_new_instance_method(_LavaVuPython.LavaVu_addColourMap)
486
487
  updateColourMap = _swig_new_instance_method(_LavaVuPython.LavaVu_updateColourMap)
Binary file
lavavu/html/webview.html CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
  <input id="fileinput" type="file" style="visibility:hidden" onchange="useFileInput(this)" />
29
29
 
30
- <script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.80/LavaVu-amalgamated.min.js"></script>
30
+ <script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.81/LavaVu-amalgamated.min.js"></script>
31
31
  <!--script src="dat.gui.min.js"></script>
32
32
  <script src="OK-min.js"></script>
33
33
 
lavavu/lavavu.py CHANGED
@@ -172,7 +172,7 @@ def is_documented_by(original):
172
172
  return target
173
173
  return wrapper
174
174
 
175
- def _brightness_contrast_saturation(target, brightness=0.5, contrast=0.5, saturation=0.5):
175
+ def _brightness_contrast_saturation(target, brightness=None, contrast=None, saturation=None, normalise=True):
176
176
  """
177
177
  Set brightness, contrast and saturation in the range [0,1]
178
178
  Zero is minimum level
@@ -192,10 +192,10 @@ def _brightness_contrast_saturation(target, brightness=0.5, contrast=0.5, satura
192
192
  0 is greyscale, 0.5 is normal and 1.0 is maximum over-saturation
193
193
  """
194
194
  #Brightness in shader is [-1,1] where 0 is default
195
- target["brightness"] = brightness * 2.0 - 1.0
195
+ target["brightness"] = None if brightness is None else brightness * 2.0 - 1.0
196
196
  #Contrast and saturation range from [0,2] where 1 is default
197
- target["contrast"] = contrast * 2.0
198
- target["saturation"] = saturation * 2.0
197
+ target["contrast"] = None if contrast is None else contrast * 2.0
198
+ target["saturation"] = None if saturation is None else saturation * 2.0
199
199
 
200
200
  def grid2d(corners=((0.,1.), (1.,0.)), dims=[2,2]):
201
201
  """
@@ -1629,7 +1629,7 @@ class Object(dict):
1629
1629
  self.parent.export_mesh(filepath, [self], rgba)
1630
1630
 
1631
1631
  @is_documented_by(_brightness_contrast_saturation)
1632
- def brightness_contrast_saturation(self, brightness=0, contrast=0, saturation=0):
1632
+ def brightness_contrast_saturation(self, brightness=None, contrast=None, saturation=None):
1633
1633
  return _brightness_contrast_saturation(self)
1634
1634
 
1635
1635
  #Wrapper dict+list of objects
@@ -4742,7 +4742,7 @@ class Viewer(dict):
4742
4742
  convert.export_any(filepath, objects)
4743
4743
 
4744
4744
  @is_documented_by(_brightness_contrast_saturation)
4745
- def brightness_contrast_saturation(self, brightness=0, contrast=0, saturation=0):
4745
+ def brightness_contrast_saturation(self, brightness=None, contrast=None, saturation=None):
4746
4746
  return _brightness_contrast_saturation(self, brightness, contrast, saturation)
4747
4747
 
4748
4748
  def set_properties(self, objects=None, **kwargs):
@@ -5232,7 +5232,7 @@ class DrawData(object):
5232
5232
  renderlist = [geomnames[value] for value in geomtypes if value == self.data.type]
5233
5233
  return ' '.join(['DrawData("' + r + '")' for r in renderlist]) + ' ==> ' + str(self.available)
5234
5234
 
5235
- def player(filename, width=None, height=None, params="", nocache=True):
5235
+ def player(filename, width=None, height=None, params=""):
5236
5236
  """
5237
5237
  Shows a video inline within an ipython notebook.
5238
5238
  If IPython is not running, just returns
@@ -5247,49 +5247,37 @@ def player(filename, width=None, height=None, params="", nocache=True):
5247
5247
  Fixed height of player window, otherwise will use video resolution
5248
5248
  params : str
5249
5249
  Any other parameters to add to the <video> tag, eg: "autoplay"
5250
- nocache : bool
5251
- Add a timestamp to the filename url to prevent caching
5252
5250
  """
5253
5251
 
5254
5252
  if is_notebook():
5255
- from IPython.display import display,HTML
5256
- #try:
5257
- # #Newer IPython versions have a Video display function
5258
- # from IPython.display import Video
5259
- # display(Video(filename))
5260
- #except (ImportError) as e:
5253
+ from IPython.display import display,HTML,Video
5261
5254
  extra_params = params
5262
5255
  if width and height:
5263
5256
  extra_params += ' width=' + str(width) + ' height=' + str(height)
5264
- html = """
5265
- <video controls loop {params}>
5266
- <source src="{fn1}">
5267
- <source src="{fn2}">
5268
- <source src="http://localhost:{port}/{fn1}">
5269
- Sorry, your browser doesn't support embedded videos,
5270
- </video><br>
5271
- """
5272
- #Jupyterlab adds it's own timestamp but notebook doesn't
5273
- #don't know a way to detect jupyterlab, so provide source url with and without
5274
- #Browser should load the first working url
5275
-
5276
- #Get path relative to cwd
5277
- #(this works in notebook/lab but not voila)
5278
- #import pathlib
5279
- #path = pathlib.Path(filename)
5280
- #filename = str(path.relative_to(os.getcwd()))
5281
-
5282
- global server_ports
5257
+
5258
+ def get_fn(filename):
5259
+ import os
5260
+ nbpath = os.getenv('JPY_SESSION_NAME')
5261
+ if nbpath is not None:
5262
+ import os.path
5263
+ relpath = os.path.relpath(os.getcwd(), start=nbpath)
5264
+ return relpath + '/' + filename
5265
+ return filename
5266
+
5283
5267
  import uuid
5284
5268
  uid = uuid.uuid1()
5285
- #Append a UUID based on host ID and current time
5286
- filename_ts = filename
5287
- if nocache:
5288
- filename_ts += "?" + str(uid)
5289
- html = HTML(html.format(params=extra_params, fn1=filename_ts, fn2=filename, port=server_ports[-1] if len(server_ports) else 8080))
5290
- display(html)
5269
+ filename_rel = get_fn(filename)
5270
+
5271
+ display(Video(filename, width=width, height=height))
5272
+ #display(HTML(f"""
5273
+ #<video controls loop {extra_params}>
5274
+ # <source src="{filename_rel}">
5275
+ #Sorry, your browser doesn't support embedded videos
5276
+ #</video><br>
5277
+ #"""))
5278
+
5291
5279
  #Add download link
5292
- display(HTML('<a href="{fn}">Download Video</a>'.format(fn=filename)))
5280
+ display(HTML('<a href="{fn}" download>Download Video</a>'.format(fn=filename)))
5293
5281
 
5294
5282
  #Class for managing video animation recording
5295
5283
  class Video(object):
@@ -5360,6 +5348,15 @@ class Video(object):
5360
5348
  for f in glob.glob(self.filename + "/frame_*.jpg"):
5361
5349
  os.remove(f)
5362
5350
 
5351
+ def pause(self):
5352
+ """
5353
+ Pause/resume recording, no rendered frames will be added to the video while paused
5354
+ """
5355
+ if self.encoder:
5356
+ self.encoder.render = not self.encoder.render
5357
+ else:
5358
+ self.viewer.app.pauseVideo()
5359
+
5363
5360
  def stop(self):
5364
5361
  """
5365
5362
  Stop recording, final frames will be written and file closed, ready to play.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lavavu
3
- Version: 1.8.80
3
+ Version: 1.8.81
4
4
  Summary: Python interface to LavaVu OpenGL 3D scientific visualisation utilities
5
5
  Author-email: Owen Kaluza <owen@kaluza.id.au>
6
6
  License: ### Licensing
@@ -221,7 +221,7 @@ Requires-Dist: jupyter-server-proxy
221
221
  [![Build Status](https://github.com/lavavu/LavaVu/workflows/Test/badge.svg)](https://github.com/lavavu/LavaVu/actions?query=workflow:Test)
222
222
  [![Deploy Status](https://github.com/lavavu/LavaVu/workflows/Deploy/badge.svg?branch=1.7.3)](https://github.com/lavavu/LavaVu/actions?query=workflow:Deploy)
223
223
  [![DOI](https://zenodo.org/badge/45163055.svg)](https://zenodo.org/badge/latestdoi/45163055)
224
- [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.80)
224
+ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.81)
225
225
 
226
226
  A scientific visualisation tool with a python interface for fast and flexible visual analysis.
227
227
 
@@ -1,15 +1,9 @@
1
- lavavu-1.8.80.dist-info/LICENSE.md,sha256=EhfNgC6BYh5gDEaq4tcrN3S0wbO4CtJO46botJnCF8c,8603
2
- lavavu-1.8.80.dist-info/RECORD,,
3
- lavavu-1.8.80.dist-info/WHEEL,sha256=_9othfhg7kan2-Qy6AzVyjJqVfmHglUjs_8PIfaNfwA,107
4
- lavavu-1.8.80.dist-info/entry_points.txt,sha256=LC2qXR6EMe45Cb7zGAF99R9HFrAECP6Qkp_YuG6HZB0,44
5
- lavavu-1.8.80.dist-info/top_level.txt,sha256=JptS0k1nlBumjLs_0hITr3_XUJhxqvKBXD2jGho3E3A,7
6
- lavavu-1.8.80.dist-info/METADATA,sha256=BPSb003FOQmpqNLJ1o0bIdHrZfRAAA1FKNvZSWMO0ys,18237
7
- lavavu/lavavu.py,sha256=MJyUnl8MzVPDLRe5LoX_TRWRKFJC_OU7Du3k0REZvU4,207579
1
+ lavavu/lavavu.py,sha256=BvswUID0WxpWuxV29qHfRj5AAeHkmm-QvuhfYnxqhZc,207324
8
2
  lavavu/vutils.py,sha256=6Vm_xl1bp9mWlfk7jgLDwbRw-tdE_oxin77YkLel3_4,5437
9
3
  lavavu/dict.json,sha256=lsZEHc7Bb6_lt7tkSBQMgkq7AEn_2hnhWzzdokmvIY8,52729
10
4
  lavavu/server.py,sha256=L-_yPCbNfwYxJCPjDQtr_lxPnDp4oMNVFyxXhBERYrQ,12468
11
5
  lavavu/points.py,sha256=jRRtA6CrcA46Y2jUJmkxnIiVoMC5a14xEd_ojhmjhz4,5871
12
- lavavu/LavaVuPython.py,sha256=ZdBJROEPysd_N_Od88PEO8Y1fjCOd05_vP6YBnJymN0,33131
6
+ lavavu/LavaVuPython.py,sha256=ixhceiAr0gGGfCe3d2cY0IIgS4hbgoYJGa_RfgAmmrU,33207
13
7
  lavavu/tracers.py,sha256=0dB6v9Jg5G-IeZxiVFvbPoTycGvyAQBtgyEAZUmq4XU,4257
14
8
  lavavu/convert.py,sha256=tbYRjLE2l1hI4d6tsW41Lia1JXmrWSc0-JAYCiMrjys,35516
15
9
  lavavu/control.py,sha256=eNocZPc-2Dz-nSty_KRz_9RzLvbU0clJGuAV3qnzxbU,65841
@@ -17,7 +11,7 @@ lavavu/__init__.py,sha256=JroZQiUbuVN7ifixk2zNDGlyLGaM8bqfRbw4D_F9qIQ,191
17
11
  lavavu/amalgamate.py,sha256=Xloq1IZ4VUvYiROzQtwKcQIWC65c7EZrdiGVhZdolL8,586
18
12
  lavavu/aserver.py,sha256=SfFvLeDTcx1XtS8fY_HIrDmh3q9HicCBRSAriY5yyOE,12003
19
13
  lavavu/font.bin,sha256=fvi5zkvmq6gh9v3jXedBVuxNJWKmHtbjECzv6eT9wb4,225360
20
- lavavu/_LavaVuPython.cpython-38-darwin.so,sha256=GveV8GQV4ABt34cDIWYqXs-kat90YJXthbVINTE1PUI,3842096
14
+ lavavu/_LavaVuPython.cpython-38-darwin.so,sha256=7mBV__pMFGbWdEtN7_hHYdKqvJ_5-s3KfwnQcSCX2lY,3842400
21
15
  lavavu/__main__.py,sha256=EbDetijCjyoiNxmExqnDGoRVs996tSVave5DML9zuMY,235
22
16
  lavavu/html/control.css,sha256=PVLwmle00ciEckUV5ZIRmI3Whxhl7-mlVexnyyxoU70,3259
23
17
  lavavu/html/control.js,sha256=oV24eJZ0vfuCxF3fO60eeJSkNFJ9hUkSCThHGJS1Wvc,11652
@@ -33,7 +27,7 @@ lavavu/html/dat.gui.min.js,sha256=S4_QjoXe4IOpU0f0Sj5jEQLTWPoX9uRl1ohB91jyhuw,56
33
27
  lavavu/html/OK-min.js,sha256=-4Gc1-dWfxP_w6r9ZOHa8u-X2BlGUoSQbX68lwCxQ3E,39115
34
28
  lavavu/html/emscripten.css,sha256=wkaIJhXaxuMchinQX9Z8c12cJomyvFQMeIZ62WGQEPQ,1813
35
29
  lavavu/html/drawbox.js,sha256=SJxFSmWd7QVFI5__66hFkKzLKeqg1JPcx-gJuqdMkXw,34590
36
- lavavu/html/webview.html,sha256=zif0TjI2RtOeuLl5yaQCPy5SeWJGkgJOa_amsMVq3Z0,1522
30
+ lavavu/html/webview.html,sha256=XMXO4b4vKNYXBp5Duzur80g86yT-9tTkbEJtMp1emrY,1522
37
31
  lavavu/html/emscripten-template.js,sha256=h63mzl3Lv7aQT1wMOiOucPOvHTJjpKkzsL-SFVYaZlA,6135
38
32
  lavavu/html/draw.js,sha256=57LlHlYRh0IvWVwzGDnF6PaCxYLzokpokLNCuZlG1ds,84108
39
33
  lavavu/html/dat-gui-light-theme.css,sha256=uPhvJs-1IAsdxudItyOw8lZy8Hrih0zmFM1u-xRwZ-M,1142
@@ -51,3 +45,9 @@ lavavu/shaders/fontShader.vert,sha256=yCBmRugaPUeUQUdIh62-AK_5KELiJqVS2M82iyIqPw
51
45
  lavavu/shaders/pointShader.frag,sha256=T1PA9Z6FiE66rS2sAmmFIbYM2VqEkLBycxV-sx3nACY,3384
52
46
  lavavu/shaders/volumeShader.vert,sha256=uGdQjGqi7V5kE6V7nxymfugtU4cbf6u570xBy13RgmY,78
53
47
  lavavu/shaders/default.frag,sha256=xCkYz8QriRlnAr-NtenZSIWI_liSxv9jz3Lp5immK9k,258
48
+ lavavu-1.8.81.dist-info/LICENSE.md,sha256=EhfNgC6BYh5gDEaq4tcrN3S0wbO4CtJO46botJnCF8c,8603
49
+ lavavu-1.8.81.dist-info/RECORD,,
50
+ lavavu-1.8.81.dist-info/WHEEL,sha256=7_oe0rMIEoZOpgBhth1WRv0SCKz8pdiUZgyT0NjKRv8,107
51
+ lavavu-1.8.81.dist-info/entry_points.txt,sha256=LC2qXR6EMe45Cb7zGAF99R9HFrAECP6Qkp_YuG6HZB0,44
52
+ lavavu-1.8.81.dist-info/top_level.txt,sha256=JptS0k1nlBumjLs_0hITr3_XUJhxqvKBXD2jGho3E3A,7
53
+ lavavu-1.8.81.dist-info/METADATA,sha256=MixzuyZ7zRaBaAFueSgveLWgm7YrCR8fa5y6v_1MJQE,18237
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-cp38-macosx_11_0_arm64
5
5