From 88a5fafe5650f1de172c6525cbeb09ee80939b53 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Tue, 25 Feb 2020 20:30:35 -0600 Subject: [PATCH 1/2] Increment IDD min-fields to 4 to make it openable in EPLaunch -- test to come --- idd/Energy+.idd.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index b4ef1d998c3..ed2ea80e19b 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -108243,7 +108243,7 @@ PythonPlugin:SearchPaths, PythonPlugin:Instance, \memo A single plugin to be executed during the simulation, which can contain multiple calling points \memo for the same class instance by overriding multiple calling point methods. - \min-fields 5 + \min-fields 4 A1, \field Name \required-field \type alpha From 672db85fcb0f1fe6234505a1138182513e6e4de8 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 26 Feb 2020 09:50:17 -0600 Subject: [PATCH 2/2] Add check for min-fields > num-fields in schema idd_parser --- scripts/dev/generate_epJSON_schema/idd_parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/dev/generate_epJSON_schema/idd_parser.py b/scripts/dev/generate_epJSON_schema/idd_parser.py index 14d93effd17..6f47c2c8839 100644 --- a/scripts/dev/generate_epJSON_schema/idd_parser.py +++ b/scripts/dev/generate_epJSON_schema/idd_parser.py @@ -145,6 +145,10 @@ def parse_idd(data): if 'memo' in obj_data: root['properties'][obj_name]['memo'] = obj_data.pop('memo') if 'min_fields' in obj_data: + num_fields_with_name = len(obj_data['properties']) + 1 + if int(obj_data['min_fields']) > num_fields_with_name: + if 'extensions' not in obj_data['properties']: + raise RuntimeError("Object with min-fields > num_fields. Object name = " + obj_name) root['properties'][obj_name]['min_fields'] = obj_data.pop('min_fields') if 'extensible_size' in obj_data: root['properties'][obj_name]['extensible_size'] = obj_data.pop('extensible_size')