GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit 393e0655 authored by Pierre Paleo's avatar Pierre Paleo

Compare current nabu_configuration with file dump nabu configuration

parent af15f694
Pipeline #46335 passed with stage
in 5 minutes and 42 seconds
import os
import posixpath
from ..utils import copy_dict_items
from ..io.config import NabuConfigParser, validate_nabu_config
from ..utils import copy_dict_items, compare_dicts
from ..io.config import NabuConfigParser, validate_nabu_config, import_h5_to_dict
from ..io.utils import hdf5_entry_exists, get_h5_value
from .dataset_analyzer import analyze_dataset, DatasetAnalyzer
from .dataset_validator import NabuValidator
......@@ -569,6 +569,29 @@ class ProcessConfig:
return None
self.logger.fatal(msg)
raise ValueError(msg)
# Check parameters other than reconstruction
filedump_nabu_config = import_h5_to_dict(
process_file,
posixpath.join(
self.dataset_infos.hdf5_entry or "entry",
self.resume_from_step,
"configuration/nabu_config"
)
)
sections_to_ignore = ["reconstruction"]
for section in sections_to_ignore:
filedump_nabu_config[section] = self.nabu_config[section]
diff = compare_dicts(filedump_nabu_config, self.nabu_config)
if diff is not None:
msg = "Nabu configuration in file %s differ from the current one: %s" % (process_file, diff)
if not raise_on_error:
self.logger.error(msg)
return None
self.logger.fatal(msg)
raise ValueError(msg)
#
return (dump_start_z, dump_end_z)
......
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