|
27 | 27 | # sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) |
28 | 28 |
|
29 | 29 | from typing import Set, Tuple, Dict, Union |
30 | | -import gempy as _gempy |
| 30 | + |
| 31 | +from gempy_viewer import optional_dependencies |
31 | 32 | from gempy_viewer.DEP._visualization_2d import PlotData2D, PlotSolution |
32 | 33 | from gempy_viewer.DEP.visualization_3d import GemPyvtkInteract |
33 | 34 |
|
@@ -99,6 +100,7 @@ def export_to_vtk(geo_data, path=None, name=None, voxels=True, block=None, surfa |
99 | 100 | path=path) |
100 | 101 | if surfaces is True: |
101 | 102 | geo_data.solutions.compute_all_surfaces() |
| 103 | + _gempy = optional_dependencies.require_gempy() |
102 | 104 | ver, sim = _gempy.get_surfaces(geo_data) |
103 | 105 | GemPyvtkInteract.export_vtk_surfaces(geo_data, ver, sim, path=path, |
104 | 106 | name=name) |
@@ -387,39 +389,3 @@ def plot_topology( |
387 | 389 | edge_kwargs=edge_kwargs |
388 | 390 | ) |
389 | 391 |
|
390 | | - |
391 | | -def plot_ar(geo_model, path=None, project_name=None, api_token=None, secret=None): |
392 | | - """ Create, upload and retrieve tag to visualize the model in AR in rexview |
393 | | -
|
394 | | - https://www.rexos.org/getting-started/ |
395 | | -
|
396 | | - Args: |
397 | | - geo_model (gempy.Model): |
398 | | - path: Location for rex files. Default cwd |
399 | | - project_name: Name of the project in rexos |
400 | | - api_token: rexos api token |
401 | | - secret: rexos secret |
402 | | -
|
403 | | - Returns: |
404 | | - gempy.addons.rex_api.Rextag |
405 | | - """ |
406 | | - from gempy.addons.rex_api import upload_to_rexcloud |
407 | | - from gempy.addons.gempy_to_rexfile import write_rex, geomodel_to_rex |
408 | | - if project_name is None: |
409 | | - project_name = geo_model.meta.project_name |
410 | | - |
411 | | - if path is None: |
412 | | - path = '/' |
413 | | - |
414 | | - rex_bytes = geomodel_to_rex(geo_model) |
415 | | - files_path = write_rex(rex_bytes, path) |
416 | | - project_name_ = project_name |
417 | | - for i in range(40): |
418 | | - try: |
419 | | - tag = upload_to_rexcloud(files_path, project_name=project_name_, api_token=api_token, secret=secret) |
420 | | - break |
421 | | - except ConnectionError: |
422 | | - project_name_ = project_name + str(i) |
423 | | - pass |
424 | | - |
425 | | - return tag |
0 commit comments