Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 003_profiling/02_double_slit.py fails in v.2.10.0-pre1 #252

Open
cverstege opened this issue Jan 15, 2025 · 1 comment
Open

Example 003_profiling/02_double_slit.py fails in v.2.10.0-pre1 #252

cverstege opened this issue Jan 15, 2025 · 1 comment
Labels

Comments

@cverstege
Copy link
Member

Example 003_profiling/02_double_slit.py is failing with the latest pre-release after moving the derivation to numdifftools:

Traceback:

Traceback (most recent call last):
  File "/home/cedric/Projekte/kafe2/examples/003_profiling/02_double_slit.py", line 120, in <module>
    p.plot(asymmetric_parameter_errors=True)
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cedric/Projekte/kafe2/kafe2/fit/_base/plot.py", line 1344, in plot
    _plot_results = self._plot_and_get_results(plot_indices=(i,) if self._separate_figs else None)
  File "/home/cedric/Projekte/kafe2/kafe2/fit/_base/plot.py", line 832, in _plot_and_get_results
    _artist = _pdc.call_plot_method(_pt, target_axes=self._get_axes(_axes_key), **_plot_kwargs)
  File "/home/cedric/Projekte/kafe2/kafe2/fit/_base/plot.py", line 361, in call_plot_method
    return _callable(target_axes=target_axes, **kwargs)
  File "/home/cedric/Projekte/kafe2/kafe2/fit/xy/plot.py", line 169, in plot_model_error_band
    _band_y = self.y_error_band
              ^^^^^^^^^^^^^^^^^
  File "/home/cedric/Projekte/kafe2/kafe2/fit/xy/plot.py", line 117, in y_error_band
    return self._fit.error_band(self.model_line_x)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/cedric/Projekte/kafe2/kafe2/fit/xy/fit.py", line 741, in error_band
    _f_deriv_by_params = self.eval_model_function_derivative_by_parameters(x=x)
  File "/home/cedric/Projekte/kafe2/kafe2/fit/xy/fit.py", line 723, in eval_model_function_derivative_by_parameters
    return self._param_model.eval_model_function_derivative_by_parameters(x=x, model_parameters=model_parameters, par_dx=par_dx)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cedric/Projekte/kafe2/kafe2/fit/xy/model.py", line 141, in eval_model_function_derivative_by_parameters
    _ret[_par_idx] = _first_derivative(_par_val)
                     ~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/cedric/Projekte/kafe2/venv/lib64/python3.13/site-packages/numdifftools/core.py", line 288, in __call__
    results, f_xi = self._derivative(x_i, args, kwds)
                    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/cedric/Projekte/kafe2/venv/lib64/python3.13/site-packages/numdifftools/core.py", line 242, in _derivative_nonzero_order
    return self.fd_rule.apply(results, steps, step_ratio), fxi
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cedric/Projekte/kafe2/venv/lib64/python3.13/site-packages/numdifftools/finite_difference.py", line 583, in apply
    f_del, h, original_shape = self._vstack(sequence, steps)
                               ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/cedric/Projekte/kafe2/venv/lib64/python3.13/site-packages/numdifftools/finite_difference.py", line 563, in _vstack
    original_shape = np.shape(sequence[0])
                              ~~~~~~~~^^^
IndexError: list index out of range
@cverstege cverstege added the bug label Jan 15, 2025
@JohannesGaessler
Copy link
Collaborator

Thank you, I forgot to check the examples. The problem is that the step size for fixed parameters was 0, should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants