lbfgsb 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. lbfgsb-0.1.0/AUTHORS.rst +20 -0
  2. lbfgsb-0.1.0/CHANGELOG.rst +8 -0
  3. lbfgsb-0.1.0/CONTRIBUTING.rst +143 -0
  4. lbfgsb-0.1.0/LICENSE +21 -0
  5. lbfgsb-0.1.0/MANIFEST.in +11 -0
  6. lbfgsb-0.1.0/PKG-INFO +146 -0
  7. lbfgsb-0.1.0/README.rst +89 -0
  8. lbfgsb-0.1.0/docs/Makefile +20 -0
  9. lbfgsb-0.1.0/docs/build/html/_static/file.png +0 -0
  10. lbfgsb-0.1.0/docs/build/html/_static/minus.png +0 -0
  11. lbfgsb-0.1.0/docs/build/html/_static/plus.png +0 -0
  12. lbfgsb-0.1.0/docs/make.bat +36 -0
  13. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.clip2bounds.rst +12 -0
  14. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.count_var_at_bounds.rst +12 -0
  15. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.display_iter.rst +12 -0
  16. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.display_iter_ensemble.rst +12 -0
  17. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.display_results.rst +12 -0
  18. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.display_start.rst +12 -0
  19. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.get_bounds.rst +12 -0
  20. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.projgr.rst +12 -0
  21. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.base.projgr_ens.rst +12 -0
  22. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.bfgsmats.bmv.rst +12 -0
  23. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.bfgsmats.form_invMfactors.rst +12 -0
  24. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.bfgsmats.update_X_and_G.rst +12 -0
  25. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.bfgsmats.update_lbfgs_matrices.rst +12 -0
  26. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.cauchy.get_cauchy_point.rst +12 -0
  27. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.linesearch.line_search.rst +12 -0
  28. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.linesearch.max_allowed_steplength.rst +12 -0
  29. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.subspacemin.direct_primal_subspace_minimization.rst +12 -0
  30. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.subspacemin.form_k_from_wm.rst +12 -0
  31. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.subspacemin.form_k_from_xgza.rst +12 -0
  32. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.subspacemin.formk.rst +12 -0
  33. lbfgsb-0.1.0/docs/sources/_autosummary/_autosummary/lbfgsb.subspacemin.freev.rst +12 -0
  34. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.ackley.rst +12 -0
  35. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.ackley_grad.rst +12 -0
  36. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.base.rst +25 -0
  37. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.bfgsmats.rst +25 -0
  38. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.cauchy.rst +25 -0
  39. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.extract_hess_inv_diag.rst +12 -0
  40. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.griewank.rst +12 -0
  41. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.griewank_grad.rst +12 -0
  42. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.linesearch.rst +25 -0
  43. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.minimize_lbfgsb.rst +12 -0
  44. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.quartic.rst +12 -0
  45. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.quartic_grad.rst +12 -0
  46. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.rastrigin.rst +12 -0
  47. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.rastrigin_grad.rst +12 -0
  48. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.rosenbrock.rst +12 -0
  49. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.rosenbrock_grad.rst +12 -0
  50. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.scalar_function.rst +32 -0
  51. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.sphere.rst +12 -0
  52. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.sphere_grad.rst +12 -0
  53. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.styblinski_tang.rst +12 -0
  54. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.styblinski_tang_grad.rst +12 -0
  55. lbfgsb-0.1.0/docs/sources/_autosummary/lbfgsb.subspacemin.rst +25 -0
  56. lbfgsb-0.1.0/docs/sources/_templates/autosummary/base.rst +11 -0
  57. lbfgsb-0.1.0/docs/sources/_templates/autosummary/class.rst +21 -0
  58. lbfgsb-0.1.0/docs/sources/_templates/autosummary/module.rst +56 -0
  59. lbfgsb-0.1.0/docs/sources/api_reference.rst +11 -0
  60. lbfgsb-0.1.0/docs/sources/authors.rst +1 -0
  61. lbfgsb-0.1.0/docs/sources/bibliography.rst +6 -0
  62. lbfgsb-0.1.0/docs/sources/changelog.rst +1 -0
  63. lbfgsb-0.1.0/docs/sources/conf.py +458 -0
  64. lbfgsb-0.1.0/docs/sources/contributing.rst +1 -0
  65. lbfgsb-0.1.0/docs/sources/index.rst +22 -0
  66. lbfgsb-0.1.0/docs/sources/installation.rst +51 -0
  67. lbfgsb-0.1.0/docs/sources/readme.rst +1 -0
  68. lbfgsb-0.1.0/docs/sources/usage.rst +10 -0
  69. lbfgsb-0.1.0/lbfgsb/__about__.py +5 -0
  70. lbfgsb-0.1.0/lbfgsb/__init__.py +136 -0
  71. lbfgsb-0.1.0/lbfgsb/base.py +297 -0
  72. lbfgsb-0.1.0/lbfgsb/benchmarks.py +308 -0
  73. lbfgsb-0.1.0/lbfgsb/bfgsmats.py +278 -0
  74. lbfgsb-0.1.0/lbfgsb/cauchy.py +262 -0
  75. lbfgsb-0.1.0/lbfgsb/linesearch.py +258 -0
  76. lbfgsb-0.1.0/lbfgsb/main.py +631 -0
  77. lbfgsb-0.1.0/lbfgsb/scalar_function.py +268 -0
  78. lbfgsb-0.1.0/lbfgsb/subspacemin.py +451 -0
  79. lbfgsb-0.1.0/lbfgsb/types.py +7 -0
  80. lbfgsb-0.1.0/lbfgsb/utils.py +33 -0
  81. lbfgsb-0.1.0/lbfgsb.egg-info/PKG-INFO +146 -0
  82. lbfgsb-0.1.0/lbfgsb.egg-info/SOURCES.txt +96 -0
  83. lbfgsb-0.1.0/lbfgsb.egg-info/dependency_links.txt +1 -0
  84. lbfgsb-0.1.0/lbfgsb.egg-info/not-zip-safe +1 -0
  85. lbfgsb-0.1.0/lbfgsb.egg-info/requires.txt +2 -0
  86. lbfgsb-0.1.0/lbfgsb.egg-info/top_level.txt +2 -0
  87. lbfgsb-0.1.0/pyproject.toml +61 -0
  88. lbfgsb-0.1.0/setup.cfg +62 -0
  89. lbfgsb-0.1.0/tests/__init__.py +1 -0
  90. lbfgsb-0.1.0/tests/test_base.py +0 -0
  91. lbfgsb-0.1.0/tests/test_benchmarks.py +42 -0
  92. lbfgsb-0.1.0/tests/test_bfgsmats.py +0 -0
  93. lbfgsb-0.1.0/tests/test_cauchy.py +0 -0
  94. lbfgsb-0.1.0/tests/test_main.py +174 -0
  95. lbfgsb-0.1.0/tests/test_scalar_function.py +0 -0
  96. lbfgsb-0.1.0/tests/test_subspacemin.py +0 -0
  97. lbfgsb-0.1.0/tests/test_utils.py +54 -0
@@ -0,0 +1,20 @@
1
+ =======
2
+ Credits
3
+ =======
4
+
5
+ This demonstrator project was initiated as part of Antoine COLLET's thesis (add ref)
6
+ between 2020 and 2024. Although the current version of the LBFGSB code was written
7
+ in its entirety by Antoine COLLET, Irina SIN and Hervé CHAURIS, researchers
8
+ at the Ecole des Mines de Paris and supervisors for this work, are the writters of the
9
+ initial prototype (2020) and significantly contributed to the scientific content
10
+ and to the derivation of the equations.
11
+
12
+ Development Lead
13
+ ----------------
14
+
15
+ * Antoine Collet <antoine.collet5@gmail.com>
16
+
17
+ Contributors
18
+ ------------
19
+
20
+ None yet. Why not be the first?
@@ -0,0 +1,8 @@
1
+ ==============
2
+ Changelog
3
+ ==============
4
+
5
+ 0.1.0 (2023-08-04)
6
+ ------------------
7
+
8
+ * First release on PyPI.
@@ -0,0 +1,143 @@
1
+ .. highlight:: shell
2
+
3
+ ============
4
+ Contributing
5
+ ============
6
+
7
+ Contributions are welcome and greatly appreciated! Every little bit helps, and credit will always be given.
8
+
9
+ You can contribute in many ways:
10
+
11
+ Types of Contributions
12
+ ----------------------
13
+
14
+ Reporting of Bugs and Defects
15
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16
+
17
+ A defect is any variance between actual and expected result, this can include bugs in the code or defects in the documentation or visualization.
18
+
19
+ Please report defects to the `the GitLab Tracker <https://github.com/antoinecollet5/lbfgsb/issues>`_
20
+ using the **Defect** description template.
21
+
22
+ `Merge Request Guidelines`_ for details on best developmental practices.
23
+
24
+ Features
25
+ ~~~~~~~~
26
+
27
+ If you wish to propose a feature, please file an issue on `the GitLab Tracker <https://github.com/antoinecollet5/lbfgsb/issues>`_ using the **Feature** description template. Community members will help refine and design your idea until it is ready for implementation.
28
+ Via these early reviews, we hope to steer contributors away from producing work outside of the project boundaries.
29
+
30
+ Please see the `Merge Request Guidelines`_ for details on best developmental practices.
31
+
32
+ Documentation
33
+ ~~~~~~~~~~~~~
34
+
35
+ Python Reactive Transport Inversion Demonstrator could always use more documentation, whether as part of the official Python Reactive Transport Inversion Demonstrator docs, in docstrings, tutorials and even on the web in blog posts, articles and such.
36
+
37
+ For docstrings, please use the `numpy docstring format <https://numpydoc.readthedocs.io/en/latest/format.html>`_.
38
+
39
+ Working on issues
40
+ ------------------
41
+
42
+ After an issue is created, the progress of the issues is tracked on the `GitHub issue board <https://github.com/antoinecollet5/lbfgsb/pulse>`_.
43
+ The maintainers will update the state using `labels <https://github.com/antoinecollet5/lbfgsblabels>`_ .
44
+ Once an issue is ready for review a Merge Request can be opened.
45
+
46
+
47
+
48
+ Merge Request Guidelines
49
+ --------------------------
50
+
51
+ Please make merge requests into the *develop* branch (not the *master* branch). Each request should be self-contained and address a single issue on the tracker.
52
+
53
+ Before you submit a merge request, check that it meets these guidelines:
54
+
55
+ 1. New code should be fully tested; running pytest in coverage mode can help identify gaps.
56
+ 2. Documentation is updated, this includes docstrings and any necessary changes to existing tutorials, user documentation and so forth. We use the `numpy docstring format <https://numpydoc.readthedocs.io/en/latest/format.html>`_.
57
+ 3. The CI pipelines should pass for all merge requests.
58
+
59
+ - Check the status of the pipelines, the status is also reported in the merge request.
60
+ - flake8 linter should pass.
61
+ - No degradation in code coverage.
62
+ - Documentation should build.
63
+ 4. Ensure your merge request contains a clear description of the changes made and how it addresses the issue. If useful, add a screenshot to showcase your work to facilitate an easier review.
64
+
65
+ Congratulations! The maintainers will now review your work and suggest any necessary changes.
66
+ If no changes are required, a maintainer will "approve" the review.
67
+ If you are
68
+ Thank you very much
69
+ for your hard work in improving Python Reactive Transport Inversion Demonstrator.
70
+
71
+
72
+ Setting up lbfgsb for local development
73
+ ---------------------------------------
74
+
75
+ Ready to contribute? Here's how to set up `Python Reactive Transport Inversion Demonstrator` for local development.
76
+
77
+ 1. Fork the `lbfgsb` repo on GitLab.
78
+ 2. Clone your fork locally::
79
+
80
+ $ git clone git@github.com:your_name_here/lbfgsb.git
81
+
82
+ 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
83
+
84
+ $ mkvirtualenv lbfgsb
85
+ $ cd lbfgsb/
86
+ $ pip install -e .
87
+ $ pip install -r requirements_dev.txt
88
+
89
+ 4. Create a branch for local development::
90
+
91
+ $ git checkout -b name-of-your-bugfix-or-feature
92
+
93
+ Now you can make your changes locally.
94
+
95
+ 5. When you're done making changes, check that your changes pass flake8, the tests and have test coverage::
96
+
97
+ $ flake8 lbfgsb tests
98
+ $ pytest --cov
99
+
100
+ If you have worked on documentation instead of code you may want to preview how your docs look locally.
101
+ You can build the docs locally using:
102
+
103
+ .. code-block:: shell
104
+
105
+ $ cd docs
106
+ $ make html
107
+
108
+ The docs will be located in `lbfgsb/docs/_build`.
109
+
110
+
111
+ 6. Commit your changes and push your branch to GitLab::
112
+
113
+ $ git add .
114
+ $ git commit -m "Your detailed description of your changes."
115
+ $ git push origin name-of-your-bugfix-or-feature
116
+
117
+ 7. Submit a merge request through the GitLab website.
118
+
119
+
120
+ .. tip:: Autobuild documentation
121
+
122
+ If you are working on documentation it can be useful to automatically rebuild
123
+ the docs after every change. This can be done using the `sphinx-autobuild`
124
+ package. Through the following command:
125
+
126
+
127
+ .. code-block:: shell
128
+
129
+ $ sphinx-autobuild docs docs/_build/html
130
+
131
+ The documentation will then be hosted on `localhost:8000`
132
+
133
+ .. tip:: Running parts of the test suite
134
+
135
+ To run only parts of the test suite, specify the folder in which to look for
136
+ tests as an argument to pytest. The following example
137
+
138
+
139
+ .. code-block:: shell
140
+
141
+ $ py.test tests/measurement --cov lbfgsb/measurement
142
+
143
+ will look for tests located in the tests/measurement directory and report test coverage of the lbfgsb/measurement module.
lbfgsb-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Antoine COLLET
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ include AUTHORS.rst
2
+ include CONTRIBUTING.rst
3
+ include CHANGELOG.rst
4
+ include LICENSE
5
+ include README.rst
6
+
7
+ recursive-include tests *
8
+ recursive-exclude * __pycache__
9
+ recursive-exclude * *.py[co]
10
+
11
+ recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
lbfgsb-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,146 @@
1
+ Metadata-Version: 2.1
2
+ Name: lbfgsb
3
+ Version: 0.1.0
4
+ Summary: Reactive Transport Inversion demonstrator written in Python.
5
+ Home-page: https://github.com/antoinecollet5/lbfgsb
6
+ Author: attr: lbfgsb.__author__
7
+ Author-email: antoinecollet5@gmail.com
8
+ License: MIT license
9
+ Keywords: Inversion,Gradient descent,Reactive transport,Parameters estimation,Adjoint State,Demonstrator
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.7
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Requires-Python: <4,>=3.7
22
+ License-File: LICENSE
23
+ License-File: AUTHORS.rst
24
+ Requires-Dist: importlib_metadata
25
+ Requires-Dist: numpy
26
+
27
+ ======
28
+ LBFGSB
29
+ ======
30
+
31
+ |License| |Stars| |Python| |PyPI| |Downloads| |Build Status| |Documentation Status| |Coverage| |Codacy| |Precommit: enabled| |Code style: black| |Ruff| |Mypy| |DOI|
32
+
33
+ A python impementation of the famous L-BFGS-B quasi-Newton solver [1].
34
+
35
+ This code is a python port of the famous implementation of Limited-memory
36
+ Broyden-Fletcher-Goldfarb-Shanno (L-BFGS), algorithm 778 written in Fortran [2,3]
37
+ (last update in 2011).
38
+ Note that this is not a wrapper like `minimize`` in scipy but a complete
39
+ reimplementation (pure python).
40
+ The original Fortran code can be found here: https://dl.acm.org/doi/10.1145/279232.279236
41
+
42
+ References
43
+ ----------
44
+ [1] R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for Bound
45
+ Constrained Optimization, (1995), SIAM Journal on Scientific and
46
+ Statistical Computing, 16, 5, pp. 1190-1208.
47
+ [2] C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778: L-BFGS-B,
48
+ FORTRAN routines for large scale bound constrained optimization (1997),
49
+ ACM Transactions on Mathematical Software, 23, 4, pp. 550 - 560.
50
+ [3] J.L. Morales and J. Nocedal. L-BFGS-B: Remark on Algorithm 778: L-BFGS-B,
51
+ FORTRAN routines for large scale bound constrained optimization (2011),
52
+ ACM Transactions on Mathematical Software, 38, 1.
53
+
54
+ The aim of this reimplementation was threefold. First, familiarize ourselves with
55
+ the code, its logic and inner optimizations. Second, gain access to certain
56
+ parameters that are hard-coded in the Fortran code and cannot be modified (typically
57
+ wolfe conditions parameters for the line search). Third,
58
+ implement additional functionalities that require significant modification of
59
+ the code core.
60
+
61
+ * Free software: MIT license
62
+ * Documentation: https://lbfgsb.readthedocs.io.
63
+
64
+ .. |License| image:: https://img.shields.io/badge/License-MIT license-blue.svg
65
+ :target: https://github.com/antoinecollet5/lbfgsb/-/blob/master/LICENSE
66
+
67
+ .. |Stars| image:: https://img.shields.io/github/stars/antoinecollet5/lbfgsb.svg?style=social&label=Star&maxAge=2592000
68
+ :target: https://github.com/antoinecollet5/lbfgsb/stargazers
69
+ :alt: Stars
70
+
71
+ .. |Python| image:: https://img.shields.io/pypi/pyversions/lbfgsb.svg
72
+ :target: https://pypi.org/pypi/lbfgsb
73
+ :alt: Python
74
+
75
+ .. |PyPI| image:: https://img.shields.io/pypi/v/lbfgsb.svg
76
+ :target: https://pypi.org/pypi/lbfgsb
77
+ :alt: PyPI
78
+
79
+ .. |Downloads| image:: https://static.pepy.tech/badge/lbfgsb
80
+ :target: https://pepy.tech/project/lbfgsb
81
+ :alt: Downoads
82
+
83
+ .. |Build Status| image:: https://github.com/antoinecollet5/lbfgsb/actions/workflows/main.yml/badge.svg
84
+ :target: https://github.com/antoinecollet5/lbfgsb/actions/workflows/main.yml
85
+ :alt: Build Status
86
+
87
+ .. |Documentation Status| image:: https://readthedocs.org/projects/lbfgsb/badge/?version=latest
88
+ :target: https://lbfgsb.readthedocs.io/en/latest/?badge=latest
89
+ :alt: Documentation Status
90
+
91
+ .. |Coverage| image:: https://codecov.io/gh/antoinecollet5/lbfgsb/branch/master/graph/badge.svg?token=ISE874MMOF
92
+ :target: https://codecov.io/gh/antoinecollet5/lbfgsb
93
+ :alt: Coverage
94
+
95
+ .. |Codacy| image:: https://app.codacy.com/project/badge/Grade/a3ad37554c5845e6a27e096e77dcca2f
96
+ :target: https://app.codacy.com/gh/antoinecollet5/lbfgsb/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
97
+ :alt: codacy
98
+
99
+ .. |Precommit: enabled| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit
100
+ :target: https://github.com/pre-commit/pre-commit
101
+
102
+ .. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat
103
+ :target: https://github.com/psf/black
104
+ :alt: Black
105
+
106
+ .. |Ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
107
+ :target: https://github.com/astral-sh/ruff
108
+ :alt: Ruff
109
+
110
+ .. |Mypy| image:: https://www.mypy-lang.org/static/mypy_badge.svg
111
+ :target: https://mypy-lang.org/
112
+ :alt: Checked with mypy
113
+
114
+ .. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11384588.svg
115
+ :target: https://doi.org/10.5281/zenodo.11384588
116
+
117
+ ==============
118
+ Changelog
119
+ ==============
120
+
121
+ 0.1.0 (2023-08-04)
122
+ ------------------
123
+
124
+ * First release on PyPI.
125
+
126
+ MIT License
127
+
128
+ Copyright (c) 2024 Antoine COLLET
129
+
130
+ Permission is hereby granted, free of charge, to any person obtaining a copy
131
+ of this software and associated documentation files (the "Software"), to deal
132
+ in the Software without restriction, including without limitation the rights
133
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
134
+ copies of the Software, and to permit persons to whom the Software is
135
+ furnished to do so, subject to the following conditions:
136
+
137
+ The above copyright notice and this permission notice shall be included in all
138
+ copies or substantial portions of the Software.
139
+
140
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
141
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
142
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
143
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
144
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
145
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
146
+ SOFTWARE.
@@ -0,0 +1,89 @@
1
+ ======
2
+ LBFGSB
3
+ ======
4
+
5
+ |License| |Stars| |Python| |PyPI| |Downloads| |Build Status| |Documentation Status| |Coverage| |Codacy| |Precommit: enabled| |Code style: black| |Ruff| |Mypy| |DOI|
6
+
7
+ A python impementation of the famous L-BFGS-B quasi-Newton solver [1].
8
+
9
+ This code is a python port of the famous implementation of Limited-memory
10
+ Broyden-Fletcher-Goldfarb-Shanno (L-BFGS), algorithm 778 written in Fortran [2,3]
11
+ (last update in 2011).
12
+ Note that this is not a wrapper like `minimize`` in scipy but a complete
13
+ reimplementation (pure python).
14
+ The original Fortran code can be found here: https://dl.acm.org/doi/10.1145/279232.279236
15
+
16
+ References
17
+ ----------
18
+ [1] R. H. Byrd, P. Lu and J. Nocedal. A Limited Memory Algorithm for Bound
19
+ Constrained Optimization, (1995), SIAM Journal on Scientific and
20
+ Statistical Computing, 16, 5, pp. 1190-1208.
21
+ [2] C. Zhu, R. H. Byrd and J. Nocedal. L-BFGS-B: Algorithm 778: L-BFGS-B,
22
+ FORTRAN routines for large scale bound constrained optimization (1997),
23
+ ACM Transactions on Mathematical Software, 23, 4, pp. 550 - 560.
24
+ [3] J.L. Morales and J. Nocedal. L-BFGS-B: Remark on Algorithm 778: L-BFGS-B,
25
+ FORTRAN routines for large scale bound constrained optimization (2011),
26
+ ACM Transactions on Mathematical Software, 38, 1.
27
+
28
+ The aim of this reimplementation was threefold. First, familiarize ourselves with
29
+ the code, its logic and inner optimizations. Second, gain access to certain
30
+ parameters that are hard-coded in the Fortran code and cannot be modified (typically
31
+ wolfe conditions parameters for the line search). Third,
32
+ implement additional functionalities that require significant modification of
33
+ the code core.
34
+
35
+ * Free software: MIT license
36
+ * Documentation: https://lbfgsb.readthedocs.io.
37
+
38
+ .. |License| image:: https://img.shields.io/badge/License-MIT license-blue.svg
39
+ :target: https://github.com/antoinecollet5/lbfgsb/-/blob/master/LICENSE
40
+
41
+ .. |Stars| image:: https://img.shields.io/github/stars/antoinecollet5/lbfgsb.svg?style=social&label=Star&maxAge=2592000
42
+ :target: https://github.com/antoinecollet5/lbfgsb/stargazers
43
+ :alt: Stars
44
+
45
+ .. |Python| image:: https://img.shields.io/pypi/pyversions/lbfgsb.svg
46
+ :target: https://pypi.org/pypi/lbfgsb
47
+ :alt: Python
48
+
49
+ .. |PyPI| image:: https://img.shields.io/pypi/v/lbfgsb.svg
50
+ :target: https://pypi.org/pypi/lbfgsb
51
+ :alt: PyPI
52
+
53
+ .. |Downloads| image:: https://static.pepy.tech/badge/lbfgsb
54
+ :target: https://pepy.tech/project/lbfgsb
55
+ :alt: Downoads
56
+
57
+ .. |Build Status| image:: https://github.com/antoinecollet5/lbfgsb/actions/workflows/main.yml/badge.svg
58
+ :target: https://github.com/antoinecollet5/lbfgsb/actions/workflows/main.yml
59
+ :alt: Build Status
60
+
61
+ .. |Documentation Status| image:: https://readthedocs.org/projects/lbfgsb/badge/?version=latest
62
+ :target: https://lbfgsb.readthedocs.io/en/latest/?badge=latest
63
+ :alt: Documentation Status
64
+
65
+ .. |Coverage| image:: https://codecov.io/gh/antoinecollet5/lbfgsb/branch/master/graph/badge.svg?token=ISE874MMOF
66
+ :target: https://codecov.io/gh/antoinecollet5/lbfgsb
67
+ :alt: Coverage
68
+
69
+ .. |Codacy| image:: https://app.codacy.com/project/badge/Grade/a3ad37554c5845e6a27e096e77dcca2f
70
+ :target: https://app.codacy.com/gh/antoinecollet5/lbfgsb/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
71
+ :alt: codacy
72
+
73
+ .. |Precommit: enabled| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit
74
+ :target: https://github.com/pre-commit/pre-commit
75
+
76
+ .. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat
77
+ :target: https://github.com/psf/black
78
+ :alt: Black
79
+
80
+ .. |Ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
81
+ :target: https://github.com/astral-sh/ruff
82
+ :alt: Ruff
83
+
84
+ .. |Mypy| image:: https://www.mypy-lang.org/static/mypy_badge.svg
85
+ :target: https://mypy-lang.org/
86
+ :alt: Checked with mypy
87
+
88
+ .. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.11384588.svg
89
+ :target: https://doi.org/10.5281/zenodo.11384588
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = python -msphinx
7
+ SPHINXPROJ = lbfgsb
8
+ SOURCEDIR = sources
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,36 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=python -msphinx
9
+ )
10
+ set SOURCEDIR=sources
11
+ set BUILDDIR=build
12
+ set SPHINXPROJ=lbfgsb
13
+
14
+ if "%1" == "" goto help
15
+
16
+ %SPHINXBUILD% >NUL 2>NUL
17
+ if errorlevel 9009 (
18
+ echo.
19
+ echo.The Sphinx module was not found. Make sure you have Sphinx installed,
20
+ echo.then set the SPHINXBUILD environment variable to point to the full
21
+ echo.path of the 'sphinx-build' executable. Alternatively you may add the
22
+ echo.Sphinx directory to PATH.
23
+ echo.
24
+ echo.If you don't have Sphinx installed, grab it from
25
+ echo.http://sphinx-doc.org/
26
+ exit /b 1
27
+ )
28
+
29
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30
+ goto end
31
+
32
+ :help
33
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34
+
35
+ :end
36
+ popd
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.clip2bounds
8
+ =======================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: clip2bounds
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.count\_var\_at\_bounds
8
+ ==================================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: count_var_at_bounds
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.display\_iter
8
+ =========================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: display_iter
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.display\_iter\_ensemble
8
+ ===================================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: display_iter_ensemble
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.display\_results
8
+ ============================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: display_results
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.display\_start
8
+ ==========================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: display_start
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.get\_bounds
8
+ =======================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: get_bounds
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.projgr
8
+ ==================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: projgr
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.base.projgr\_ens
8
+ =======================
9
+
10
+ .. currentmodule:: lbfgsb.base
11
+
12
+ .. autofunction:: projgr_ens
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.bfgsmats.bmv
8
+ ===================
9
+
10
+ .. currentmodule:: lbfgsb.bfgsmats
11
+
12
+ .. autofunction:: bmv
@@ -0,0 +1,12 @@
1
+ ..
2
+ Template for the html base rendering
3
+
4
+ Modified from
5
+ https://github.com/sphinx-doc/sphinx/tree/master/sphinx/ext/autosummary/templates/autosummary/base.rst
6
+
7
+ lbfgsb.bfgsmats.form\_invMfactors
8
+ =================================
9
+
10
+ .. currentmodule:: lbfgsb.bfgsmats
11
+
12
+ .. autofunction:: form_invMfactors