loop-link 0.1.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.
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.4
2
+ Name: loop-link
3
+ Version: 0.1.0
4
+ Summary: Send geoscience data to the LoopConnect viewer
5
+ Author-email: Lachlan Grose <lachlan.grose@monash.edu>
6
+ License: MIT
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Intended Audience :: Science/Research
9
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: Microsoft :: Windows
12
+ Classifier: Operating System :: POSIX
13
+ Classifier: Operating System :: MacOS
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: numpy
21
+ Provides-Extra: pyvista
22
+ Requires-Dist: pyvista; extra == "pyvista"
23
+ Provides-Extra: loopstructural
24
+ Requires-Dist: loop-common; extra == "loopstructural"
25
+ Provides-Extra: pandas
26
+ Requires-Dist: pandas; extra == "pandas"
27
+ Provides-Extra: tests
28
+ Requires-Dist: pytest; extra == "tests"
29
+ Requires-Dist: pyvista; extra == "tests"
30
+ Requires-Dist: loop-common; extra == "tests"
31
+ Requires-Dist: pandas; extra == "tests"
32
+ Dynamic: license-file
33
+
34
+ # loop-link
35
+
36
+ Send geoscience data from Python to the LoopConnect viewer.
37
+
38
+ ## Install
39
+
40
+ ```
41
+ pip install loop-link
42
+ ```
43
+
44
+ Optional extras: `pyvista`, `loopstructural`, `pandas`.
45
+
46
+ ## Token
47
+
48
+ The package needs a token. It reads the `GEOVIEWER_TOKEN` environment
49
+ variable. If this variable is not set, it uses the token that the viewer
50
+ saved.
51
+
52
+ ## Example
53
+
54
+ ```python
55
+ import numpy as np
56
+ from loop_link import Viewer, Points
57
+
58
+ viewer = Viewer()
59
+ xyz = np.random.rand(100, 3)
60
+ viewer.connect()
61
+ viewer.send(Points(xyz), id="random-points", name="random points")
62
+ viewer.close()
63
+ ```
64
+
65
+ ## Select and fetch
66
+
67
+ ```python
68
+ from loop_link import Viewer, BlockModel
69
+
70
+ grid = BlockModel((0, 0, 0), (1, 1, 1), (4, 4, 4))
71
+ viewer = Viewer()
72
+ viewer.send(grid, id="grid")
73
+ viewer.select("grid", cells=[12, 13])
74
+ sel = viewer.selection()
75
+ print(sel.object_id, sel.cells)
76
+ watcher = viewer.watch_selection(print, interval=0.5)
77
+ watcher.stop()
78
+ result = viewer.fetch("grid")
79
+ print(result.object)
80
+ ```
81
+
82
+ Select, read and fetch use the tool connection. They work while another program holds the data connection.
83
+ A viewer without geoviewer protocol 1.18 gives `MissingFeatureError`.
84
+ A fetch of a drillhole keeps the first interval set. It warns about dropped properties.
85
+
86
+ ## Filter and colour
87
+
88
+ ```python
89
+ from loop_link import BlockModel, ColourSettings, Viewer
90
+
91
+ grid = BlockModel((0, 0, 0), (1, 1, 1), (4, 4, 4))
92
+ viewer = Viewer()
93
+ viewer.send(grid, id="grid", colour=ColourSettings(array="grade", colour_map="viridis", range=(0.0, 1.0), scale="linear"))
94
+ result = viewer.filter_range("grid", "grade", 0.5, 1.0)
95
+ print(result.passing, result.total)
96
+ viewer.filter_values("grid", "unit", [0, 2], exclude=True)
97
+ viewer.filter_remove("grid", "grade")
98
+ viewer.set_colour_map("grid", "coolwarm")
99
+ print(viewer.colour_map_names())
100
+ ```
101
+
102
+ Filter and colour use the tool connection. They work while another program holds the data connection.
103
+ The colour map names come from the viewer. A viewer without geoviewer protocol 1.18 gives `MissingFeatureError` for `colour_map_names()`.
104
+ A filter call waits for the end of the build by default. `wait=False` does not wait, `cancel` is a `threading.Event`, and `progress` gets the fraction.
105
+ The counts need a viewer of protocol 1.20. An older viewer gives a `FilterResult` with no counts.
106
+ `state` is `building` when the viewer stopped to wait (the build goes on) and `unbuilt` when the viewer has no counts for the new filters.
107
+ A value filter uses the integer ids of the categories. These are the codes of `Categorical`.
108
+
109
+ ## Test against the real codec
110
+
111
+ Some tests give the frames of `loop_link` to the real geoviewer codec.
112
+ The geoviewer repository is private, so these tests are optional.
113
+ Set `LOOP_LINK_GEOVIEWER_REPO` to a geoviewer checkout and install Rust (`cargo`).
114
+ The tests build a small validator program the first time that they run.
115
+ Without the variable, or without `cargo`, these tests skip.
@@ -0,0 +1,26 @@
1
+ loop_link/__init__.py,sha256=FiG6EostDWLHp5wgER6myFDgnjWNqGDIMhHVyh9147I,1419
2
+ loop_link/_websocket.py,sha256=kv06ASn1b1OgcqJWsNYONYDO2r6EovjxvA_IWUwqvUM,15337
3
+ loop_link/commands.py,sha256=NAsc7JkvLMP273wXeMwunOd7DmEqGBIJik7GZEFetW0,13077
4
+ loop_link/discovery.py,sha256=V5zdkFkKHsNw663mYJtzl734Ah50L9Re5xl0Swvdi-s,4770
5
+ loop_link/encode.py,sha256=-UpXGqYOr5E-ie5TXEpKRmdKzZOnZeJgha4UbNKoz88,22483
6
+ loop_link/errors.py,sha256=CmKf9E97KRv8j-t3CQZHAxemZjxUKzyJCyfA_TjDUKg,7011
7
+ loop_link/fetch.py,sha256=y0Krj_FIzrKF_NxVXLWJQ6kzpor-WkR0ZTDk0y7-XJQ,22808
8
+ loop_link/objects.py,sha256=cFmotGTY9hUSUhBWwba7PThYAcDNxm7Wiq8PPkFAQv0,20716
9
+ loop_link/orientation.py,sha256=oaZWWuU4cztvV7GZdj3kL4ZL-2RR3AydEhIuoyiu6ag,4976
10
+ loop_link/protocol.py,sha256=GyJeJeFwa0gCvPJugjnF8nL8qU68jT1_oWBNATGEgQ8,7897
11
+ loop_link/push.py,sha256=dtvE1XjuisTMfURVyrvb_1eiAO6t28BK_8IFrkXqg40,5262
12
+ loop_link/selection.py,sha256=Psowx76qfvyWaqOXxnS5JEO884lcOmKt4iq5PLBOWwM,6700
13
+ loop_link/tool.py,sha256=ParLZ2CXzt2iHDNfS-9CbybpsAkimVpFW_IYltr63oE,12419
14
+ loop_link/version.py,sha256=dO9g5r5W0pnCcEMzyyezRUxQceGLYFH2yoheTXVqOyw,519
15
+ loop_link/viewer.py,sha256=CmXO6rjUCj8_pvirvVdSiAnfvRtQB8ezpMHRCd087WE,55000
16
+ loop_link/adapters/__init__.py,sha256=hG3IbqZXRB7Q3dC84hNyvSQNsJ8OTBt9YaL9_N6oF_8,1606
17
+ loop_link/adapters/loopstructural.py,sha256=vV8ZTdXZyAqvWzYprEfInhz7gk0YA5XslD4kx4x-uk0,2948
18
+ loop_link/adapters/pandas.py,sha256=rGuCPaxw_u85kkhuDbZWfqE6lVAKXpItxGqpFDgQoV4,8123
19
+ loop_link/adapters/pyvista.py,sha256=MSJNC_rwlz225wwrNw-Yz72mrSErk65t6ytafpYh8nA,10020
20
+ loop_link/testing/__init__.py,sha256=cHXHN2CFCCDE-MQ1-GmJPDgzy3L2yyRyidqhMFuOOpo,163
21
+ loop_link/testing/fake_viewer.py,sha256=nBO5FxXtOi7g0Ys8R9nlszc5oM1DvgI_M_3USbfvuuc,64409
22
+ loop_link-0.1.0.dist-info/licenses/LICENSE,sha256=ZqGeNFOgmYevj7Ld7Q-kR4lAxWXuBRUdUmPC6XM_py8,1071
23
+ loop_link-0.1.0.dist-info/METADATA,sha256=8d9Zre3uJ2bhDA7go4sqw5P1cIkrCnxGm1H7o78qO6Y,4086
24
+ loop_link-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
25
+ loop_link-0.1.0.dist-info/top_level.txt,sha256=jfYRMQq3oOf3y1hcrPWhMVpt3hhoD8urCCjKZDDukdE,10
26
+ loop_link-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Lachlan Grose
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ loop_link