Skip to content

Commit 06a8c7c

Browse files
committed
Updated documentation and version number
1 parent 4d163a3 commit 06a8c7c

31 files changed

+226
-98
lines changed

dfols/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from __future__ import absolute_import, division, print_function, unicode_literals
4040

4141
# DFO-LS version
42-
__version__ = '1.5.3'
42+
__version__ = '1.5.4'
4343

4444
# Main solver & exit flags
4545
from .solver import *
6.43 KB
Binary file not shown.

docs/build/doctrees/history.doctree

724 Bytes
Binary file not shown.

docs/build/doctrees/index.doctree

1 Byte
Binary file not shown.

docs/build/doctrees/userguide.doctree

3.65 KB
Binary file not shown.

docs/build/html/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: e27aac59f14e76a4142e0b9f9d374216
3+
config: 412cd91ff985b9489bd71148f8919cdf
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/build/html/_sources/history.rst.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,7 @@ Version 1.5.2 (28 Oct 2024)
7979
Version 1.5.3 (30 Oct 2024)
8080
---------------------------
8181
* Bugfix when starting solver at problem minimizer (bug introduced in v1.5.1)
82+
83+
Version 1.5.4 (11 Feb 2025)
84+
---------------------------
85+
* Add ability to save/load results to/from a dictionary

docs/build/html/_sources/userguide.rst.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,30 @@ These variables are defined in the :code:`soln` object, so can be accessed with,
6767
if soln.flag == soln.EXIT_SUCCESS:
6868
print("Success!")
6969
70+
In newer versions DFO-LS (v1.5.4 onwards), the results object can be converted to, or loaded from, a serialized Python dictionary. This allows the results to be saved as a JSON file.
71+
For example, to save the results to a JSON file, you may use
72+
73+
.. code-block:: python
74+
75+
import json
76+
soln_dict = soln.to_dict() # convert soln to serializable dict object
77+
with open("dfols_results.json", 'w') as f:
78+
json.dump(soln_dict, f, indent=2)
79+
80+
The :code:`to_dict()` function takes an optional boolean, :code:`to_dict(replace_nan=True)`. If :code:`replace_nan` is :code:`True`, any NaN values in the results object are converted to :code:`None`.
81+
82+
To load results from a JSON file and convert to a solution object, you may use
83+
84+
.. code-block:: python
85+
86+
import json
87+
soln_dict = None
88+
with open("dfols_results.json") as f:
89+
soln_dict = json.load(f) # read JSON into dict
90+
soln = dfols.OptimResults.from_dict(soln_dict) # convert to DFO-LS results object
91+
print(soln)
92+
93+
7094
Optional Arguments
7195
------------------
7296
The :code:`solve` function has several optional arguments which the user may provide:

docs/build/html/_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const DOCUMENTATION_OPTIONS = {
2-
VERSION: '1.5.3',
2+
VERSION: '1.5.4',
33
LANGUAGE: 'en',
44
COLLAPSE_INDEX: false,
55
BUILDER: 'html',

docs/build/html/advanced.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
55

66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Advanced Usage &mdash; DFO-LS v1.5.3 documentation</title>
7+
<title>Advanced Usage &mdash; DFO-LS v1.5.4 documentation</title>
88
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
99
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
1010

@@ -15,7 +15,7 @@
1515

1616
<script src="_static/jquery.js?v=5d32c60e"></script>
1717
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
18-
<script src="_static/documentation_options.js?v=d75fd82e"></script>
18+
<script src="_static/documentation_options.js?v=1cd648e3"></script>
1919
<script src="_static/doctools.js?v=888ff710"></script>
2020
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
2121
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
@@ -38,7 +38,7 @@
3838
DFO-LS
3939
</a>
4040
<div class="version">
41-
1.5.3
41+
1.5.4
4242
</div>
4343
<div role="search">
4444
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
@@ -276,7 +276,7 @@ <h2>References<a class="headerlink" href="#references" title="Link to this headi
276276
<hr/>
277277

278278
<div role="contentinfo">
279-
<p>&#169; Copyright 2017-2024, Lindon Roberts.</p>
279+
<p>&#169; Copyright 2017-2025, Lindon Roberts.</p>
280280
</div>
281281

282282
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a

0 commit comments

Comments
 (0)