Skip to content

Commit

Permalink
another exception
Browse files Browse the repository at this point in the history
  • Loading branch information
grburgess committed Apr 28, 2023
1 parent 15e21c7 commit 40314f3
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions astromodels/functions/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -2477,7 +2477,6 @@ def get_function(function_name, composite_function_expression=None):

instance = EmulatorModel(function_name)


except Exception as e:

log.debug(e)
Expand All @@ -2496,7 +2495,6 @@ def get_function(function_name, composite_function_expression=None):

return instance


else:

return instance
Expand Down Expand Up @@ -2673,6 +2671,28 @@ def _parse_function_expression(function_specification):
% (unique_function, function_specification)
)

except astromodels.functions.template_model.InvalidTemplateModelFile:

# It's not a template

try:

import netspec

instance = netspec.EmulatorModel(unique_function)

except Exception:

raise UnknownFunction(
"Function %s in expression %s is unknown. If this is a template model, you are "
"probably missing the data file"
% (unique_function, function_specification)
)

else:

instances[complete_function_specification] = instance

else:

# It's a template
Expand Down

0 comments on commit 40314f3

Please sign in to comment.