Skip to content

Commit

Permalink
Added functionality to the resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
willgebhardt committed Jul 9, 2024
1 parent 7d016ed commit b0d91b1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ngcsimlib/compilers/component_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit b0d91b1

Please sign in to comment.