Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
geomultisens
gms_preprocessing
Commits
04ca03c9
Commit
04ca03c9
authored
Nov 27, 2017
by
Daniel Scheffler
Browse files
Fixes
#2
.
Former-commit-id:
5daf3659
Former-commit-id:
6b122d4b
parent
550cccb5
Changes
3
Hide whitespace changes
Inline
Side-by-side
gms_preprocessing/config.py
View file @
04ca03c9
...
...
@@ -13,6 +13,7 @@ from collections import OrderedDict
import
multiprocessing
from
inspect
import
getargvalues
,
stack
,
getfullargspec
,
signature
,
_empty
import
json
from
json
import
JSONDecodeError
from
jsmin
import
jsmin
from
cerberus
import
Validator
import
pkgutil
...
...
@@ -515,7 +516,14 @@ class JobConfig(object):
# update default options with those from DB
if
self
.
DB_job_record
.
analysis_parameter
:
db_options
=
json_to_python
(
json
.
loads
(
jsmin
(
self
.
DB_job_record
.
analysis_parameter
)))
# type: dict
try
:
params_dict
=
json
.
loads
(
jsmin
(
self
.
DB_job_record
.
analysis_parameter
))
except
JSONDecodeError
:
warnings
.
warn
(
'The given JSON options file could not be decoded. JSON decoder failed with the '
'following error:'
)
raise
db_options
=
json_to_python
(
params_dict
)
# type: dict
default_options
.
update
(
db_options
)
if
validate
:
...
...
tests/test_exception_handler.py
View file @
04ca03c9
...
...
@@ -47,12 +47,12 @@ class BaseTest_ExceptionHandler:
raise
RuntimeError
(
'TestException raised by dummy_gms_mapper_fail()'
)
def
get_current_progress_stats
(
self
):
return
get_info_from_postgreSQLdb
(
self
.
PC
.
job
.
conn_database
,
'jobs'
,
'statistics'
,
cond_dict
=
dict
(
id
=
self
.
PC
.
job
.
ID
))[
0
][
0
]
return
get_info_from_postgreSQLdb
(
self
.
PC
.
config
.
conn_database
,
'jobs'
,
'statistics'
,
cond_dict
=
dict
(
id
=
self
.
PC
.
config
.
ID
))[
0
][
0
]
def
is_sceneid_in_failedIDs
(
self
,
sceneid
):
return
sceneid
in
get_info_from_postgreSQLdb
(
self
.
PC
.
job
.
conn_database
,
'jobs'
,
[
'failed_sceneids'
],
{
'id'
:
self
.
PC
.
job
.
ID
})[
0
][
0
]
return
sceneid
in
get_info_from_postgreSQLdb
(
self
.
PC
.
config
.
conn_database
,
'jobs'
,
[
'failed_sceneids'
],
{
'id'
:
self
.
PC
.
config
.
ID
})[
0
][
0
]
class
Test_ExceptionHandler_NoSubsystems
(
BaseTest_ExceptionHandler
.
Test_ExceptionHandler
):
...
...
@@ -72,7 +72,7 @@ class Test_ExceptionHandler_NoSubsystems(BaseTest_ExceptionHandler.Test_Exceptio
def
test_disabled_exception_handler
(
self
):
"""Check if exception handler raises exceptions of CFG.Job.disable_exception_handler = True."""
self
.
PC
.
job
.
disable_exception_handler
=
True
self
.
PC
.
config
.
disable_exception_handler
=
True
self
.
assertRaises
(
RuntimeError
,
self
.
dummy_gms_mapper_fail
,
self
.
PC
.
config
.
data_list
[
0
])
...
...
tests/test_gms_preprocessing.py
View file @
04ca03c9
...
...
@@ -139,7 +139,7 @@ class BaseTestCases:
self
.
assertIsInstance
(
self
.
L2C_newObjects
,
list
)
self
.
assertNotEqual
(
len
(
self
.
L2C_newObjects
),
0
,
msg
=
'L2C_processing did not output an L2C object.'
)
self
.
assertIsInstance
(
self
.
L2C_newObjects
[
0
],
L2C_object
)
# Setting the
job
.status manually.
# Setting the
config
.status manually.
# if self.L2C_newObjects:
# self.PC.config.status = "finished"
# FIXME after updating the job.status-attribute for the level-processes, delete the code that is commented
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment