Commit 8b1029ef authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Merge branch 'bugfix/fix_importerror_spectral' into 'master'

Moved import of 'spectral' package to function level.

See merge request !12
parents 28db628b 914a51d2
Pipeline #4374 failed with stages
in 15 minutes
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
import os import os
import multiprocessing import multiprocessing
from spectral.io import envi
try: try:
import gdal import gdal
...@@ -54,6 +53,8 @@ def write_numpy_to_image(array, path_out, outFmt='GTIFF', gt=None, prj=None): ...@@ -54,6 +53,8 @@ def write_numpy_to_image(array, path_out, outFmt='GTIFF', gt=None, prj=None):
def write_envi(arr, outpath, gt=None, prj=None): def write_envi(arr, outpath, gt=None, prj=None):
from spectral.io import envi
if gt or prj: if gt or prj:
assert gt and prj, 'gt and prj must be provided together or left out.' assert gt and prj, 'gt and prj must be provided together or left out.'
...@@ -69,6 +70,8 @@ shared_array_on_disk__memmap = None ...@@ -69,6 +70,8 @@ shared_array_on_disk__memmap = None
def init_SharedArray_on_disk(out_path, dims, gt=None, prj=None): def init_SharedArray_on_disk(out_path, dims, gt=None, prj=None):
from spectral.io import envi
global shared_array_on_disk__memmap global shared_array_on_disk__memmap
global shared_array_on_disk__path global shared_array_on_disk__path
path = out_path if not os.path.splitext(out_path)[1] == '.bsq' else \ path = out_path if not os.path.splitext(out_path)[1] == '.bsq' else \
......
...@@ -19,5 +19,5 @@ ...@@ -19,5 +19,5 @@
# You should have received a copy of the GNU Lesser General Public License along # You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.14.19' __version__ = '0.14.20'
__versionalias__ = '20190722_01' __versionalias__ = '20190726_01'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment