From b0d91b17830c5725ea74b0da2c3c71a7375e8b42 Mon Sep 17 00:00:00 2001 From: Will Gebhardt Date: Tue, 9 Jul 2024 16:04:47 -0400 Subject: [PATCH] Added functionality to the resolver --- ngcsimlib/compilers/component_compiler.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ngcsimlib/compilers/component_compiler.py b/ngcsimlib/compilers/component_compiler.py index 28ea42d..eed9b92 100644 --- a/ngcsimlib/compilers/component_compiler.py +++ b/ngcsimlib/compilers/component_compiler.py @@ -37,9 +37,16 @@ def parse(component, compile_key): the compartments needed """ - (pure_fn, output_compartments), ( - args, parameters, compartments, parse_varnames) = \ - get_resolver(component.__class__, compile_key) + if component.__class__.__dict__.get("auto_resolve", True): + (pure_fn, output_compartments), ( + args, parameters, compartments, parse_varnames) = \ + get_resolver(component.__class__, compile_key) + else: + build_method = component.__class__.__dict__.get(f"build_{compile_key}", None) + if build_method is None: + critical(f"Component {component.name} if flagged to not use resolvers but " + f"does not have a build_{compile_key} method") + return build_method(component) if parse_varnames: args = []