@@ -43,28 +43,36 @@ def _xprint(msg):
4343
4444_xprint ("XTGEO __init__ ..." )
4545
46+ ROXAR = True
47+ try :
48+ import roxar
49+ except Exception :
50+ ROXAR = False
51+
52+
4653# to avoid problems in batch runs when no DISPLAY is set:
4754_xprint ("Import matplotlib etc..." )
48- import matplotlib as mplib
55+ if not ROXAR :
56+ import matplotlib as mplib
4957
50- display = os .environ .get ("DISPLAY" , "" )
51- host1 = os .environ .get ("HOSTNAME" , "" )
52- host2 = os .environ .get ("HOST" , "" )
53- dhost = host1 + host2 + display
58+ display = os .environ .get ("DISPLAY" , "" )
59+ host1 = os .environ .get ("HOSTNAME" , "" )
60+ host2 = os .environ .get ("HOST" , "" )
61+ dhost = host1 + host2 + display
5462
55- ertbool = "LSB_JOBID" in os .environ
63+ ertbool = "LSB_JOBID" in os .environ
5664
57- if display == "" or "grid" in dhost or "lgc" in dhost or ertbool :
65+ if display == "" or "grid" in dhost or "lgc" in dhost or ertbool :
5866
59- _xprint ("" )
60- _xprint ("=" * 79 )
67+ _xprint ("" )
68+ _xprint ("=" * 79 )
6169
62- _xprint (
63- "XTGeo info: No display found or a batch (e.g. ERT) server. "
64- "Using non-interactive Agg backend for matplotlib"
65- )
66- mplib .use ("Agg" )
67- _xprint ("=" * 79 )
70+ _xprint (
71+ "XTGeo info: No display found or a batch (e.g. ERT) server. "
72+ "Using non-interactive Agg backend for matplotlib"
73+ )
74+ mplib .use ("Agg" )
75+ _xprint ("=" * 79 )
6876
6977#
7078# Order matters!
@@ -103,11 +111,11 @@ def _xprint(msg):
103111_xprint ("Import various XTGeo modules... wells..." )
104112
105113from xtgeo .surface import regular_surface
114+ from xtgeo .surface .regular_surface import RegularSurface
106115
107116_xprint ("Import various XTGeo modules... surface..." )
108117
109118from xtgeo .cube import cube1
110-
111119from xtgeo .cube .cube1 import Cube
112120
113121_xprint ("Import various XTGeo modules... cube..." )
@@ -130,11 +138,11 @@ def _xprint(msg):
130138
131139_xprint ("Import various XTGeo modules... xyz..." )
132140
133-
134- from xtgeo .plot import baseplot
135- from xtgeo .plot import xsection
136- from xtgeo .plot import xtmap
137- from xtgeo .plot import grid3d_slice
141+ if not ROXAR :
142+ from xtgeo .plot import baseplot
143+ from xtgeo .plot import xsection
144+ from xtgeo .plot import xtmap
145+ from xtgeo .plot import grid3d_slice
138146
139147_xprint ("Import various XTGeo modules... plots..." )
140148
0 commit comments