Skip to content

Commit

Permalink
Fix docstrings causing doctest failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
anugrahjo committed Nov 25, 2024
1 parent e224973 commit c427ede
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyslsqp/save_and_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def load_variables(filepath, vars, itr_start=0, itr_end=-1, major_only=False):
Summary saved to : slsqp_summary.out
Iteration data saved to : slsqp_recorder.hdf5
>>> from pyslsqp.postprocessing import load_variables
>>> load_variables('slsqp_recorder.hdf5', ['objective', 'optimality', 'x[0]'], itr_start=0, itr_end=-1, major_only=True)
{'objective': [np.float64(0.5), np.float64(0.0), np.float64(0.0)], 'optimality': [np.float64(99.0), np.float64(0.0), np.float64(0.0)], 'x[0]': [np.float64(0.5), np.float64(0.0), np.float64(0.0)]}
>>> load_variables('slsqp_recorder.hdf5', ['objective', 'optimality', 'x[0]'], itr_start=0, itr_end=-1, major_only=True) # doctest: +ELLIPSIS
{'objective': [...0.5..., ...0.0..., ...0.0...], 'optimality': [...99.0..., ...0.0..., ...0.0...], 'x[0]': [...0.5..., ...0.0..., ...0.0...]}
'''
if not isinstance(filepath, str):
raise ValueError("filepath must be a string.")
Expand Down

0 comments on commit c427ede

Please sign in to comment.