File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 27
27
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28
28
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
30
+ import sys
30
31
import warnings
31
32
import datetime
32
- import scipy .io
33
33
import geopandas
34
- import h5py
35
34
import numpy as np
36
35
36
+ # imports with warnings if not present
37
+ try :
38
+ import scipy .io
39
+ import h5py
40
+ except ModuleNotFoundError as e :
41
+ sys .stderr .write ("Warning: missing packages, some functions will throw an exception if called. (%s)\n " % (str (e )))
42
+
37
43
# attributes for ATL06-SR variables
38
44
def get_attributes (** kwargs ):
39
45
# set default keyword arguments
Original file line number Diff line number Diff line change 28
28
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
30
30
import os
31
+ import sys
31
32
import copy
32
33
import datetime
33
- import ipywidgets
34
- import ipyleaflet
35
34
import numpy as np
36
35
from traitlets .utils .bunch import Bunch
37
- import tkinter .filedialog
38
- import IPython .display
39
36
import sliderule .io
40
37
38
+ # imports with warnings if not present
39
+ try :
40
+ import ipywidgets
41
+ import tkinter .filedialog
42
+ import IPython .display
43
+ except ModuleNotFoundError as e :
44
+ sys .stderr .write ("Warning: missing packages, some functions will throw an exception if called. (%s)\n " % (str (e )))
45
+
46
+ # imports that raise error if not present
47
+ try :
48
+ import ipyleaflet
49
+ except ModuleNotFoundError as e :
50
+ sys .stderr .write ("Error: missing required packages. (%s)\n " % (str (e )))
51
+ raise
52
+
41
53
class widgets :
42
54
def __init__ (self ):
43
55
# dropdown menu for setting asset
You can’t perform that action at this time.
0 commit comments