Crash with vary if the variable is float type
If the variable is integer there is no crash.
$ texts session
Input > vary ((a: 1., 2.))
Input > %hist
WAITING 2024-11-04T13:34:07+01:00 a = 1.0
Input > %uuid
uuids: '94930fe886594b79b912396a6e4c1d34' ('94930fe886594b79b912396a6e4c1d34', '36770f88ffda4fb8a490b12f9be88329')
Input > %uuid 36770f88ffda4fb8a490b12f9be88329
Input > %hist
WAITING 2024-11-04T13:34:07+01:00 a = 2.0
Input > vary ((a: 4.5))
Traceback (most recent call last):
File "vre-language/src/virtmat/language/utilities/errors.py", line 302, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/interpreter/session_manager.py", line 121, in get_model_value
return getattr(self.session.get_model(*args, uuid=self.uuid, **kwargs), 'value', '')
File "vre-language/src/virtmat/language/interpreter/session.py", line 149, in get_model
self.process_models(model_str, model_path)
File "vre-language/src/virtmat/language/interpreter/session.py", line 225, in process_models
strns, paths, varies = self._process_strings_paths(model_str, model_path)
File "vre-language/src/virtmat/language/interpreter/session.py", line 257, in _process_strings_paths
strns, varies = self._update_models(*self._parse_vary(model_str_))
File "vre-language/src/virtmat/language/interpreter/session.py", line 434, in _update_models
return self._update_models_old_vars(vary, df_old, model_str)
File "vre-language/src/virtmat/language/interpreter/session.py", line 495, in _update_models_old_vars
df_aux = pandas.merge(df_norm, df_old, on=list(df_norm.columns), how='inner')
File "python-3.10.12_new/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 170, in merge
op = _MergeOperation(
File "python-3.10.12_new/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 807, in __init__
self._maybe_coerce_merge_keys()
File "python-3.10.12_new/lib/python3.10/site-packages/pandas/core/reshape/merge.py", line 1508, in _maybe_coerce_merge_keys
raise ValueError(msg)
ValueError: You are trying to merge on object and pint[dimensionless] columns for key 'a'. If you wish to proceed you should use pd.concat
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "vre-language/src/virtmat/language/utilities/errors.py", line 302, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/interpreter/session_manager.py", line 168, in process_input
output = self.get_model_value(model_str=input_str)
File "vre-language/src/virtmat/language/utilities/errors.py", line 337, in wrapper
raise RuntimeError('non-handled exception') from err
RuntimeError: non-handled exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "vre-language/src/virtmat/language/utilities/errors.py", line 302, in wrapper
return func(*args, **kwargs)
File "vre-language/src/virtmat/language/cli/run_session.py", line 93, in main
mgr.main_loop()
File "vre-language/src/virtmat/language/interpreter/session_manager.py", line 137, in main_loop
if self.process_input(input_str):
File "vre-language/src/virtmat/language/utilities/errors.py", line 337, in wrapper
raise RuntimeError('non-handled exception') from err
RuntimeError: non-handled exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "python-3.10.12_new/bin/texts", line 8, in <module>
sys.exit(texts())
File "vre-language/src/virtmat/language/cli/__init__.py", line 28, in texts
clargs.func(clargs)
File "vre-language/src/virtmat/language/utilities/errors.py", line 337, in wrapper
raise RuntimeError('non-handled exception') from err
RuntimeError: non-handled exception