From 4159ae5f3d6ffad63fb71b98c79d385953681523 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 26 Oct 2020 21:43:21 +0100 Subject: [PATCH] keep order of keys --- python/damask/_config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/damask/_config.py b/python/damask/_config.py index 40b9e918f..f2ffbbbf3 100644 --- a/python/damask/_config.py +++ b/python/damask/_config.py @@ -17,7 +17,7 @@ class NiceDumper(yaml.SafeDumper): return super().increase_indent(flow, False) def represent_data(self, data): - """Cast Config objects and its qsubclasses to dict.""" + """Cast Config objects and its subclasses to dict.""" return self.represent_data(dict(data)) if isinstance(data, dict) and type(data) != dict else \ super().represent_data(data) @@ -70,6 +70,8 @@ class Config(dict): kwargs['width'] = 256 if 'default_flow_style' not in kwargs: kwargs['default_flow_style'] = None + if 'sort_keys' not in kwargs: + kwargs['sort_keys'] = False def array_representer(dumper, data): """Convert numpy array to list of native types."""