Commit 7a11d8f9 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fix tests. Deleted deprecated GMS_system_setup.py.

parent 15b51ddc
# -*- coding: utf-8 -*-
from __future__ import (division, print_function, unicode_literals,absolute_import)
import os
#wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.4.1-Linux-x86_64.sh
# bash Anaconda3-2.4.1-Linux-x86_64.sh
# conda update --all
# conda install gdal dill pyproj
# pip install pyorbital pyephem usgs urllib3 spectral imreg_dft python-hdf4 psycopg2
# conda install /misc/hy5/scheffler/setups/linux-64_nansat-libgdal-2.0.0-7.tar.bz2 ### funktioniert nur im internen netzwerk
# conda install -c https://conda.anaconda.org/asmeurer proj4
# conda install -c https://conda.anaconda.org/hovren opencv
# conda install -c https://conda.anaconda.org/anaconda hdf4
# conda install -c https://conda.anaconda.org/numba numba
# conda install -c https://conda.anaconda.org/richli pyfftw ### nicht Python 3.5-kompatibel
# conda install -c scopatz xonsh
print("Where can I find the root directory of Anaconda?")
PREFIX = input('Input (without '/' at the end): ')
TEMPDIR = 'compile_gdal_including_ecw_and_jasper_for_anaconda__TEMP'
if not os.path.isdir(TEMPDIR): os.makedirs(TEMPDIR)
os.chdir(TEMPDIR)
csh = lambda command: os.system(command)
# Download and compile ECW
print("Downloading ECW Plugin for GDAL...")
csh("wget –mirror http://meuk.technokrat.nl/libecwj2-3.3-2006-09-06.zip")
csh("unzip libecwj2-3.3-2006-09-06.zip")
os.chdir("cd libecwj2-3.3")
csh("chmod -R 755 *")
csh("./configure --prefix=%s" %PREFIX)
csh("make -j")
csh("make install")
csh("cd..")
# Download and compile JasPer
print("Downloading JasPer Plugin for GDAL...")
csh("wget –mirror ftp://ftp.remotesensing.org/gdal/jasper-1.900.1.uuid.tar.gz")
csh("tar -xzvf jasper-1.900.1.uuid.tar.gz")
os.chdir("jasper-1.900.1.uuid")
csh("""setenv CFLAGS "-O2 -fPIC""""")
csh("chmod -R 755 *")
csh("./configure --prefix=%s" %PREFIX)
csh("make -j")
csh("make install")
csh("cd..")
# Download and compile GDAL
print("Downloading GDAL...")
csh("wget –mirror http://download.osgeo.org/gdal/2.0.1/gdal-2.0.1.tar.gz")
csh("tar -xzvf gdal-2.0.1.tar.gz")
os.chdir("cd gdal-2.0.1")
csh("chmod -R 755 *")
csh("./configure --prefix=%s --with-python=yes --with-ecw=%s --with-jasper=%s/lib" %(PREFIX,PREFIX,PREFIX))
csh("make -j")
csh("make install")
csh("cd..")
csh("cd..")
csh("rm -rf %s" %TEMPDIR)
print("Deleting temporary files...")
......@@ -82,10 +82,6 @@ class process_controller(object):
# called_from_iPyNb = 1 if 'ipykernel/__main__.py' in sys.argv[0] else 0
# save config
self._path_job_optionsfile = os.path.join(self.config.path_job_logs, '%s_options.json' % self.config.ID)
self.config.save(self._path_job_optionsfile)
# create job log
self._path_job_logfile = os.path.join(self.config.path_job_logs, '%s.log' % self.config.ID)
if os.path.exists(self._path_job_logfile):
......@@ -95,6 +91,10 @@ class process_controller(object):
self.logger.info('Process Controller initialized for job ID %s (comment: %s).'
% (self.config.ID, self.DB_job_record.comment))
self.logger.info('Job logfile: %s' % self._path_job_logfile)
# save config
self._path_job_optionsfile = os.path.join(self.config.path_job_logs, '%s_options.json' % self.config.ID)
self.config.save(self._path_job_optionsfile)
self.logger.info('Job options file: %s' % self._path_job_optionsfile)
if self.config.delete_old_output:
......
......@@ -28,9 +28,11 @@ class Base_CLITester:
def setUp(self):
self.parser_run = run_path(path_run_gms)['get_gms_argparser']()
os.environ['GMS_IS_TEST'] = 'True'
os.environ['GMS_IS_TEST_CONFIG'] = 'True'
def tearDown(self):
del os.environ['GMS_IS_TEST']
del os.environ['GMS_IS_TEST_CONFIG']
# delete the created test job in case the created subparser creates a new job
......@@ -43,7 +45,6 @@ class Base_CLITester:
@property
def current_CFG(self):
from gms_preprocessing.options.config import GMS_config
GMS_config.is_test = True
return GMS_config
####################################
......
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