lavavu 1.8.76__cp311-cp311-macosx_11_0_arm64.whl → 1.8.80__cp311-cp311-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.
Binary file
lavavu/dict.json CHANGED
@@ -214,10 +214,10 @@
214
214
  ]
215
215
  },
216
216
  "uniforms": {
217
- "default": [],
217
+ "default": {},
218
218
  "target": "object",
219
219
  "type": "object",
220
- "desc": "Custom shader uniforms for rendering objects, list of uniform names, will be copied from property data",
220
+ "desc": "Custom shader uniforms for rendering objects, dict of uniform names/values, will be copied from property data",
221
221
  "strict": true,
222
222
  "redraw": 0,
223
223
  "control": [
lavavu/html/control.js CHANGED
@@ -86,12 +86,17 @@ function WindowInteractor(id, uid, port) {
86
86
  } else {
87
87
 
88
88
  //Several possible modes to try
89
- //JupyterHub URL
90
- var regex = /\/user\/[a-z0-9-]+\//i;
89
+ //Modern JupyterHub lab URL
90
+ var regex = /\/lab\//;
91
91
  var parsed = regex.exec(loc.href);
92
92
  if (parsed && parsed.length > 0) {
93
- var base = parsed[0];
94
- connect(loc.href.substring(0,parsed.index) + base + "proxy/" + port);
93
+ connect(loc.href.substring(0,parsed.index) + "/proxy/" + port);
94
+ }
95
+ //Old JupyterHub URL
96
+ regex = /\/user\/[a-z0-9-]+\//i;
97
+ parsed = regex.exec(loc.href);
98
+ if (parsed && parsed.length > 0) {
99
+ connect(loc.href.substring(0,parsed.index) + parsed[0] + "proxy/" + port);
95
100
  }
96
101
 
97
102
  if (loc.protocol != '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.76/LavaVu-amalgamated.min.js"></script>
30
+ <script async src="https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@1.8.80/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
@@ -2319,29 +2319,29 @@ class _LavaVuWrapper(LavaVuPython.LavaVu):
2319
2319
  if _LavaVuWrapper._ctx:
2320
2320
  self.ctx = _LavaVuWrapper._ctx
2321
2321
  else:
2322
- self.ctx = moderngl.create_standalone_context(require=330)
2322
+ import platform
2323
+ if platform.system() == 'Linux':
2324
+ self.ctx = moderngl.create_context(standalone=True, require=330, backend='egl')
2325
+ else:
2326
+ self.ctx = moderngl.create_standalone_context(require=330)
2327
+ #print(self.ctx.info)
2323
2328
  _LavaVuWrapper._ctx = self.ctx
2324
2329
 
2325
2330
  if self.use_moderngl_window and self.ctx:
2326
2331
  # Activate the context
2327
2332
  moderngl_window.activate_context(ctx=self.ctx)
2328
- if self.use_moderngl_window == 'window':
2329
- # Configure with default window class / settings
2330
- from moderngl_window.conf import settings
2331
- settings.WINDOW['gl_version'] = (3, 3)
2332
- settings.WINDOW['samples'] = 4
2333
- if self.resolution:
2334
- settings.WINDOW['size'] = self.resolution
2335
- # Creates the window instance and activates its context
2336
- self.wnd = moderngl_window.create_window_from_settings()
2337
- else:
2338
- # Configure to use provided window class
2339
- window_str = 'moderngl_window.context.' + self.use_moderngl_window + '.Window'
2340
- window_cls = moderngl_window.get_window_cls(window_str)
2341
- if self.resolution:
2342
- self.wnd = window_cls(title="LavaVu", gl_version=(3, 3), samples=4, vsync=True, cursor=True, size=self.resolution)
2343
- else:
2344
- self.wnd = window_cls(title="LavaVu", gl_version=(3, 3), samples=4, vsync=True, cursor=True)
2333
+
2334
+ # Configure with default window class / settings
2335
+ from moderngl_window.conf import settings
2336
+ settings.WINDOW['gl_version'] = (3, 3)
2337
+ if self.use_moderngl_window != 'window':
2338
+ #Use specified class
2339
+ settings.WINDOW['class'] = f'moderngl_window.context.{self.use_moderngl_window}.Window'
2340
+ settings.WINDOW['samples'] = 4
2341
+ if self.resolution:
2342
+ settings.WINDOW['size'] = self.resolution
2343
+ # Creates the window instance and activates its context
2344
+ self.wnd = moderngl_window.create_window_from_settings()
2345
2345
 
2346
2346
  # register event methods
2347
2347
  self.wnd.resize_func = self.resized
@@ -3695,6 +3695,56 @@ class Viewer(dict):
3695
3695
  else:
3696
3696
  return c.tolist()
3697
3697
 
3698
+ def texture(self, label, data=None, flip=True, filter=2, bgr=False):
3699
+ """
3700
+ Load or clear global/shared texture data
3701
+
3702
+ Parameters
3703
+ ----------
3704
+ label : string
3705
+ Label to load a custom texture by name of uniform used
3706
+ Will attempt to find the texture by this label and replace its data
3707
+ data : list or array or string
3708
+ (If data is not provided, the object's texture data will be cleared)
3709
+ Pass a list or numpy uint32 or uint8 array
3710
+ texture data is loaded as raw image data
3711
+ shape of array must be 2d or 3d,
3712
+ either (height, width, channels) for RGB(A) image
3713
+ or (height, width) for single channel grayscale image
3714
+ Pass a string to load a texture from given filename
3715
+ flip : boolean
3716
+ flip the texture vertically after loading
3717
+ (default is enabled as usually required for OpenGL but can be disabled)
3718
+ filter : int
3719
+ type of filtering, 0=None/nearest, 1=linear, 2=mipmap linear
3720
+ bgr : boolean
3721
+ rgb data is in BGR/BGRA format instead of RGB/RGBA
3722
+ """
3723
+ if data is None:
3724
+ #Clear texture
3725
+ self.app.clearTexture(None, label)
3726
+ return
3727
+ if isinstance(data, str):
3728
+ self.app.setTexture(None, data, flip, filter, bgr, label)
3729
+ return
3730
+
3731
+ data = _convert(data)
3732
+ if len(data.shape) < 2:
3733
+ raise ValueError(data.shape + " : Must pass a 2D or 3D data set")
3734
+ if len(data.shape) < 3:
3735
+ height, width = data.shape
3736
+ channels = 1
3737
+ else:
3738
+ height, width, channels = data.shape
3739
+
3740
+ #Convert floating point data
3741
+ if data.dtype == numpy.float32:
3742
+ data = _convert(data, numpy.uint8)
3743
+ if data.dtype == numpy.uint32:
3744
+ self.app.textureUInt(None, data.ravel(), width, height, channels, flip, filter, bgr, label)
3745
+ elif data.dtype == numpy.uint8:
3746
+ self.app.textureUChar(None, data.ravel(), width, height, channels, flip, filter, bgr, label)
3747
+
3698
3748
  def clear(self, objects=True, colourmaps=True):
3699
3749
  """
3700
3750
  Clears all data from the visualisation
@@ -4740,6 +4790,7 @@ class Viewer(dict):
4740
4790
  else:
4741
4791
  obj = o
4742
4792
  uniforms = obj['uniforms']
4793
+ if len(uniforms) == 0: uniforms = {}
4743
4794
  for key in kwargs:
4744
4795
  uniforms[key] = kwargs[key]
4745
4796
  obj['uniforms'] = uniforms
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lavavu
3
- Version: 1.8.76
3
+ Version: 1.8.80
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.76)
224
+ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.80)
225
225
 
226
226
  A scientific visualisation tool with a python interface for fast and flexible visual analysis.
227
227
 
@@ -1,6 +1,12 @@
1
- lavavu/lavavu.py,sha256=_6kKbk3KXUTDWYoSCkcnYLKOQPRkZteDepBApKepPUs,205612
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=wZi4olA0NR6c8yfzURN7DX9ImcSoHfH-g7UT7-9uFnE,109
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
2
8
  lavavu/vutils.py,sha256=6Vm_xl1bp9mWlfk7jgLDwbRw-tdE_oxin77YkLel3_4,5437
3
- lavavu/dict.json,sha256=Zb1QnJOsx2DK3M1tRSXRUQ5PjEpOo3SMM3tTNHIKMPs,52722
9
+ lavavu/dict.json,sha256=lsZEHc7Bb6_lt7tkSBQMgkq7AEn_2hnhWzzdokmvIY8,52729
4
10
  lavavu/server.py,sha256=L-_yPCbNfwYxJCPjDQtr_lxPnDp4oMNVFyxXhBERYrQ,12468
5
11
  lavavu/points.py,sha256=jRRtA6CrcA46Y2jUJmkxnIiVoMC5a14xEd_ojhmjhz4,5871
6
12
  lavavu/LavaVuPython.py,sha256=ZdBJROEPysd_N_Od88PEO8Y1fjCOd05_vP6YBnJymN0,33131
@@ -12,9 +18,9 @@ lavavu/amalgamate.py,sha256=Xloq1IZ4VUvYiROzQtwKcQIWC65c7EZrdiGVhZdolL8,586
12
18
  lavavu/aserver.py,sha256=SfFvLeDTcx1XtS8fY_HIrDmh3q9HicCBRSAriY5yyOE,12003
13
19
  lavavu/font.bin,sha256=fvi5zkvmq6gh9v3jXedBVuxNJWKmHtbjECzv6eT9wb4,225360
14
20
  lavavu/__main__.py,sha256=EbDetijCjyoiNxmExqnDGoRVs996tSVave5DML9zuMY,235
15
- lavavu/_LavaVuPython.cpython-311-darwin.so,sha256=yV7qOwkN529hoSKxSWaUJw6Ah3MMgyxJO7nvxo2sQ9k,3840896
21
+ lavavu/_LavaVuPython.cpython-311-darwin.so,sha256=8kA0tnhScc0YYjtUN6BWmKyr5BwZuUKnzycSBZMA8Cw,3842192
16
22
  lavavu/html/control.css,sha256=PVLwmle00ciEckUV5ZIRmI3Whxhl7-mlVexnyyxoU70,3259
17
- lavavu/html/control.js,sha256=Gi3eszKip1JsrM1HrMvSJWjqFZql6DPXdMUkU6Zuj7Q,11466
23
+ lavavu/html/control.js,sha256=oV24eJZ0vfuCxF3fO60eeJSkNFJ9hUkSCThHGJS1Wvc,11652
18
24
  lavavu/html/gui.css,sha256=PRDLsYwM6cgLC9zZsEAG0dnnSd-HYH6oSEfsdEBkuxk,582
19
25
  lavavu/html/favicon.ico,sha256=OrIWwvxOSnOCuynrGRUyEIVQng0ZwA9Rrz89S9eiog0,1150
20
26
  lavavu/html/LavaVu-amalgamated.css,sha256=iE2xrxFcwmY0AcASrXxNa_RpvFEbS_YO4H5OILbPteE,8640
@@ -27,7 +33,7 @@ lavavu/html/dat.gui.min.js,sha256=S4_QjoXe4IOpU0f0Sj5jEQLTWPoX9uRl1ohB91jyhuw,56
27
33
  lavavu/html/OK-min.js,sha256=-4Gc1-dWfxP_w6r9ZOHa8u-X2BlGUoSQbX68lwCxQ3E,39115
28
34
  lavavu/html/emscripten.css,sha256=wkaIJhXaxuMchinQX9Z8c12cJomyvFQMeIZ62WGQEPQ,1813
29
35
  lavavu/html/drawbox.js,sha256=SJxFSmWd7QVFI5__66hFkKzLKeqg1JPcx-gJuqdMkXw,34590
30
- lavavu/html/webview.html,sha256=vD2cFL5mpl1TLA_-Ys6_yiOt8snXxu5YrGfDiVAmRoI,1522
36
+ lavavu/html/webview.html,sha256=zif0TjI2RtOeuLl5yaQCPy5SeWJGkgJOa_amsMVq3Z0,1522
31
37
  lavavu/html/emscripten-template.js,sha256=h63mzl3Lv7aQT1wMOiOucPOvHTJjpKkzsL-SFVYaZlA,6135
32
38
  lavavu/html/draw.js,sha256=57LlHlYRh0IvWVwzGDnF6PaCxYLzokpokLNCuZlG1ds,84108
33
39
  lavavu/html/dat-gui-light-theme.css,sha256=uPhvJs-1IAsdxudItyOw8lZy8Hrih0zmFM1u-xRwZ-M,1142
@@ -45,9 +51,3 @@ lavavu/shaders/fontShader.vert,sha256=yCBmRugaPUeUQUdIh62-AK_5KELiJqVS2M82iyIqPw
45
51
  lavavu/shaders/pointShader.frag,sha256=T1PA9Z6FiE66rS2sAmmFIbYM2VqEkLBycxV-sx3nACY,3384
46
52
  lavavu/shaders/volumeShader.vert,sha256=uGdQjGqi7V5kE6V7nxymfugtU4cbf6u570xBy13RgmY,78
47
53
  lavavu/shaders/default.frag,sha256=xCkYz8QriRlnAr-NtenZSIWI_liSxv9jz3Lp5immK9k,258
48
- lavavu-1.8.76.dist-info/LICENSE.md,sha256=EhfNgC6BYh5gDEaq4tcrN3S0wbO4CtJO46botJnCF8c,8603
49
- lavavu-1.8.76.dist-info/RECORD,,
50
- lavavu-1.8.76.dist-info/WHEEL,sha256=14CKxoVCfJ3KAIauGqtlVEBIkzvOXTVWMttVST6ktOc,109
51
- lavavu-1.8.76.dist-info/entry_points.txt,sha256=LC2qXR6EMe45Cb7zGAF99R9HFrAECP6Qkp_YuG6HZB0,44
52
- lavavu-1.8.76.dist-info/top_level.txt,sha256=JptS0k1nlBumjLs_0hITr3_XUJhxqvKBXD2jGho3E3A,7
53
- lavavu-1.8.76.dist-info/METADATA,sha256=_Q3RNrqe4mm_Qb3CM15xfNkX9b7Wq0ORAlIYrUdry-k,18237
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (75.2.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-macosx_11_0_arm64
5
5