speth/ember

Improve validation of input profiles

speth opened this issue · 0 comments

speth commented

Currently, no input validation is performed on the InitialCondition object based on the contents of the x, Y, T, U and V variables. These could be checked at a minimum to make sure they are all of compatible dimensions, with Y being a matrix of shape n_species by n_points. The lack of checking here leads to unhelpful errors such as:

Traceback (most recent call last):
  File "/Users/speth/src/cantera-related/ember-profiles/example_diffusion.py", line 83, in <module>
    conf.run()
  File "/Users/speth/src/ember/build/python/ember/input.py", line 1049, in run
    concrete = self.evaluate()
  File "/Users/speth/src/ember/build/python/ember/input.py", line 902, in evaluate
    return ConcreteConfig(self)
  File "/Users/speth/src/ember/build/python/ember/input.py", line 1129, in __init__
    self.apply_options()
  File "python/ember/_ember.pyx", line 235, in ember._ember.ConfigOptions.apply_options
ValueError: Buffer has wrong number of dimensions (expected 2, got 1)