You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Presently, when theta_names are provided to parmest.Estimator incorrectly, the exception provided is cryptic and unhelpful. An error is logged that the variables were not able to be found, but it's not clear to the user that it is the reason for the exception. Explicitly raising an exception would be more helpful.
Rationale
Yesterday, I attempted to use parmest for the first time. However, I wrote theta_names = ["m.params.PR_kappa['H2','H2O']", "m.params.PR_kappa['H2O','H2']"] instead of ["params.PR_kappa['H2','H2O']", "params.PR_kappa['H2O','H2']"]. The traceback I got was not helpful for debugging:
File "[Redacted]\IDAES\IDAES-doug\H2_H2O_VLE_validation.py", line 62, in <module>
obj_value, parameters = pest.theta_est()
File "[Redacted]\miniconda3\envs\idaes-fresh\lib\site-packages\pyomo\contrib\parmest\parmest.py", line 674, in theta_est
return self._Q_opt(solver=solver, return_values=return_values,
File "[Redacted]\miniconda3\envs\idaes-fresh\lib\site-packages\pyomo\contrib\parmest\parmest.py", line 426, in _Q_opt
ef = local_ef.create_EF(scen_names,
File "[Redacted]\miniconda3\envs\idaes-fresh\lib\site-packages\pyomo\contrib\parmest\create_ef.py", line 88, in create_EF
scen_dict = {
File "[Redacted]\miniconda3\envs\idaes-fresh\lib\site-packages\pyomo\contrib\parmest\create_ef.py", line 89, in <dictcomp>
name: scenario_creator(name, **scenario_creator_kwargs)
File "[Redacted]\miniconda3\envs\idaes-fresh\lib\site-packages\pyomo\contrib\parmest\parmest.py", line 163, in _experiment_instance_creation_callback
instance._mpisppy_node_list = [scenario_tree.ScenarioNode(
File "[Redacted]\miniconda3\envs\idaes-fresh\lib\site-packages\pyomo\contrib\parmest\scenario_tree.py", line 86, in __init__
self.nonant_vardata_list = build_vardatalist(self,
File "[Redacted]\miniconda3\envs\idaes-fresh\lib\site-packages\pyomo\contrib\parmest\scenario_tree.py", line 39, in build_vardatalist
if v.is_indexed():
AttributeError: 'NoneType' object has no attribute 'is_indexed'
Above all of that, I saw the logged error:
Message: 'theta_name[%s] (%s) was not found on the model'
Arguments: ((1, "m.params.PR_kappa['H2O','H2']"),)
but after quickly validating that such a variable was, in fact, created on my model I started looking for other causes. It wasn't obvious to me that such an error message might not get generated during normal operation of parmest as a result of whatever necessitated specifying a variable name instead of the actual variable object.
Description
If such an error is going to prevent further execution of the code and no rescue is possible, it should raise an exception instead of just being a logged error.
The text was updated successfully, but these errors were encountered:
Summary
Presently, when
theta_names
are provided toparmest.Estimator
incorrectly, the exception provided is cryptic and unhelpful. An error is logged that the variables were not able to be found, but it's not clear to the user that it is the reason for the exception. Explicitly raising an exception would be more helpful.Rationale
Yesterday, I attempted to use
parmest
for the first time. However, I wrotetheta_names = ["m.params.PR_kappa['H2','H2O']", "m.params.PR_kappa['H2O','H2']"]
instead of["params.PR_kappa['H2','H2O']", "params.PR_kappa['H2O','H2']"]
. The traceback I got was not helpful for debugging:Above all of that, I saw the logged error:
but after quickly validating that such a variable was, in fact, created on my model I started looking for other causes. It wasn't obvious to me that such an error message might not get generated during normal operation of
parmest
as a result of whatever necessitated specifying a variable name instead of the actual variable object.Description
If such an error is going to prevent further execution of the code and no rescue is possible, it should raise an exception instead of just being a logged error.
The text was updated successfully, but these errors were encountered: