desdeo 1.2__tar.gz → 2.0.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 (123) hide show
  1. desdeo-2.0.0/LICENSE +21 -0
  2. desdeo-2.0.0/PKG-INFO +168 -0
  3. desdeo-2.0.0/README.md +137 -0
  4. desdeo-2.0.0/desdeo/__init__.py +9 -0
  5. desdeo-2.0.0/desdeo/api/README.md +73 -0
  6. desdeo-2.0.0/desdeo/api/__init__.py +15 -0
  7. desdeo-2.0.0/desdeo/api/app.py +40 -0
  8. desdeo-2.0.0/desdeo/api/config.py +69 -0
  9. desdeo-2.0.0/desdeo/api/config.toml +53 -0
  10. desdeo-2.0.0/desdeo/api/db.py +25 -0
  11. desdeo-2.0.0/desdeo/api/db_init.py +79 -0
  12. desdeo-2.0.0/desdeo/api/db_models.py +164 -0
  13. desdeo-2.0.0/desdeo/api/malaga_db_init.py +27 -0
  14. desdeo-2.0.0/desdeo/api/models/__init__.py +66 -0
  15. desdeo-2.0.0/desdeo/api/models/archive.py +34 -0
  16. desdeo-2.0.0/desdeo/api/models/preference.py +90 -0
  17. desdeo-2.0.0/desdeo/api/models/problem.py +507 -0
  18. desdeo-2.0.0/desdeo/api/models/reference_point_method.py +18 -0
  19. desdeo-2.0.0/desdeo/api/models/session.py +46 -0
  20. desdeo-2.0.0/desdeo/api/models/state.py +96 -0
  21. desdeo-2.0.0/desdeo/api/models/user.py +51 -0
  22. desdeo-2.0.0/desdeo/api/routers/_NAUTILUS.py +245 -0
  23. desdeo-2.0.0/desdeo/api/routers/_NAUTILUS_navigator.py +233 -0
  24. desdeo-2.0.0/desdeo/api/routers/_NIMBUS.py +762 -0
  25. desdeo-2.0.0/desdeo/api/routers/__init__.py +5 -0
  26. desdeo-2.0.0/desdeo/api/routers/problem.py +110 -0
  27. desdeo-2.0.0/desdeo/api/routers/reference_point_method.py +117 -0
  28. desdeo-2.0.0/desdeo/api/routers/session.py +76 -0
  29. desdeo-2.0.0/desdeo/api/routers/test.py +16 -0
  30. desdeo-2.0.0/desdeo/api/routers/user_authentication.py +366 -0
  31. desdeo-2.0.0/desdeo/api/schema.py +94 -0
  32. desdeo-2.0.0/desdeo/api/tests/__init__.py +0 -0
  33. desdeo-2.0.0/desdeo/api/tests/conftest.py +59 -0
  34. desdeo-2.0.0/desdeo/api/tests/test_models.py +701 -0
  35. desdeo-2.0.0/desdeo/api/tests/test_routes.py +216 -0
  36. desdeo-2.0.0/desdeo/api/utils/database.py +274 -0
  37. desdeo-2.0.0/desdeo/api/utils/logger.py +29 -0
  38. desdeo-2.0.0/desdeo/core.py +27 -0
  39. desdeo-2.0.0/desdeo/emo/__init__.py +29 -0
  40. desdeo-2.0.0/desdeo/emo/hooks/archivers.py +172 -0
  41. desdeo-2.0.0/desdeo/emo/methods/EAs.py +418 -0
  42. desdeo-2.0.0/desdeo/emo/methods/__init__.py +0 -0
  43. desdeo-2.0.0/desdeo/emo/methods/bases.py +59 -0
  44. desdeo-2.0.0/desdeo/emo/operators/__init__.py +1 -0
  45. desdeo-2.0.0/desdeo/emo/operators/crossover.py +780 -0
  46. desdeo-2.0.0/desdeo/emo/operators/evaluator.py +118 -0
  47. desdeo-2.0.0/desdeo/emo/operators/generator.py +356 -0
  48. desdeo-2.0.0/desdeo/emo/operators/mutation.py +1053 -0
  49. desdeo-2.0.0/desdeo/emo/operators/selection.py +1036 -0
  50. desdeo-2.0.0/desdeo/emo/operators/termination.py +178 -0
  51. desdeo-2.0.0/desdeo/explanations/__init__.py +6 -0
  52. desdeo-2.0.0/desdeo/explanations/explainer.py +100 -0
  53. desdeo-2.0.0/desdeo/explanations/utils.py +90 -0
  54. desdeo-2.0.0/desdeo/mcdm/__init__.py +19 -0
  55. desdeo-2.0.0/desdeo/mcdm/nautili.py +345 -0
  56. desdeo-2.0.0/desdeo/mcdm/nautilus.py +477 -0
  57. desdeo-2.0.0/desdeo/mcdm/nautilus_navigator.py +655 -0
  58. desdeo-2.0.0/desdeo/mcdm/nimbus.py +417 -0
  59. desdeo-2.0.0/desdeo/mcdm/pareto_navigator.py +269 -0
  60. desdeo-2.0.0/desdeo/mcdm/reference_point_method.py +116 -0
  61. desdeo-2.0.0/desdeo/problem/__init__.py +79 -0
  62. desdeo-2.0.0/desdeo/problem/evaluator.py +561 -0
  63. desdeo-2.0.0/desdeo/problem/gurobipy_evaluator.py +562 -0
  64. desdeo-2.0.0/desdeo/problem/infix_parser.py +341 -0
  65. desdeo-2.0.0/desdeo/problem/json_parser.py +944 -0
  66. desdeo-2.0.0/desdeo/problem/pyomo_evaluator.py +468 -0
  67. desdeo-2.0.0/desdeo/problem/schema.py +1808 -0
  68. desdeo-2.0.0/desdeo/problem/simulator_evaluator.py +298 -0
  69. desdeo-2.0.0/desdeo/problem/sympy_evaluator.py +244 -0
  70. desdeo-2.0.0/desdeo/problem/testproblems/__init__.py +73 -0
  71. desdeo-2.0.0/desdeo/problem/testproblems/binh_and_korn_problem.py +88 -0
  72. desdeo-2.0.0/desdeo/problem/testproblems/dtlz2_problem.py +102 -0
  73. desdeo-2.0.0/desdeo/problem/testproblems/forest_problem.py +275 -0
  74. desdeo-2.0.0/desdeo/problem/testproblems/knapsack_problem.py +163 -0
  75. desdeo-2.0.0/desdeo/problem/testproblems/mcwb_problem.py +831 -0
  76. desdeo-2.0.0/desdeo/problem/testproblems/mixed_variable_dimenrions_problem.py +83 -0
  77. desdeo-2.0.0/desdeo/problem/testproblems/momip_problem.py +172 -0
  78. desdeo-2.0.0/desdeo/problem/testproblems/nimbus_problem.py +143 -0
  79. desdeo-2.0.0/desdeo/problem/testproblems/pareto_navigator_problem.py +89 -0
  80. desdeo-2.0.0/desdeo/problem/testproblems/re_problem.py +492 -0
  81. desdeo-2.0.0/desdeo/problem/testproblems/river_pollution_problem.py +434 -0
  82. desdeo-2.0.0/desdeo/problem/testproblems/rocket_injector_design_problem.py +140 -0
  83. desdeo-2.0.0/desdeo/problem/testproblems/simple_problem.py +351 -0
  84. desdeo-2.0.0/desdeo/problem/testproblems/simulator_problem.py +92 -0
  85. desdeo-2.0.0/desdeo/problem/testproblems/spanish_sustainability_problem.py +945 -0
  86. desdeo-2.0.0/desdeo/problem/testproblems/zdt_problem.py +271 -0
  87. desdeo-2.0.0/desdeo/problem/utils.py +245 -0
  88. desdeo-2.0.0/desdeo/tools/GenerateReferencePoints.py +181 -0
  89. desdeo-2.0.0/desdeo/tools/__init__.py +102 -0
  90. desdeo-2.0.0/desdeo/tools/generics.py +145 -0
  91. desdeo-2.0.0/desdeo/tools/gurobipy_solver_interfaces.py +258 -0
  92. desdeo-2.0.0/desdeo/tools/indicators_binary.py +11 -0
  93. desdeo-2.0.0/desdeo/tools/indicators_unary.py +375 -0
  94. desdeo-2.0.0/desdeo/tools/interaction_schema.py +38 -0
  95. desdeo-2.0.0/desdeo/tools/intersection.py +54 -0
  96. desdeo-2.0.0/desdeo/tools/iterative_pareto_representer.py +99 -0
  97. desdeo-2.0.0/desdeo/tools/message.py +234 -0
  98. desdeo-2.0.0/desdeo/tools/ng_solver_interfaces.py +199 -0
  99. desdeo-2.0.0/desdeo/tools/non_dominated_sorting.py +133 -0
  100. desdeo-2.0.0/desdeo/tools/patterns.py +281 -0
  101. desdeo-2.0.0/desdeo/tools/proximal_solver.py +99 -0
  102. desdeo-2.0.0/desdeo/tools/pyomo_solver_interfaces.py +464 -0
  103. desdeo-2.0.0/desdeo/tools/reference_vectors.py +462 -0
  104. desdeo-2.0.0/desdeo/tools/scalarization.py +3138 -0
  105. desdeo-2.0.0/desdeo/tools/scipy_solver_interfaces.py +454 -0
  106. desdeo-2.0.0/desdeo/tools/score_bands.py +464 -0
  107. desdeo-2.0.0/desdeo/tools/utils.py +320 -0
  108. desdeo-2.0.0/desdeo/utopia_stuff/__init__.py +0 -0
  109. desdeo-2.0.0/desdeo/utopia_stuff/data/1.json +15 -0
  110. desdeo-2.0.0/desdeo/utopia_stuff/data/2.json +13 -0
  111. desdeo-2.0.0/desdeo/utopia_stuff/data/3.json +15 -0
  112. desdeo-2.0.0/desdeo/utopia_stuff/data/4.json +17 -0
  113. desdeo-2.0.0/desdeo/utopia_stuff/data/5.json +15 -0
  114. desdeo-2.0.0/desdeo/utopia_stuff/from_json.py +40 -0
  115. desdeo-2.0.0/desdeo/utopia_stuff/reinit_user.py +38 -0
  116. desdeo-2.0.0/desdeo/utopia_stuff/utopia_db_init.py +212 -0
  117. desdeo-2.0.0/desdeo/utopia_stuff/utopia_problem.py +403 -0
  118. desdeo-2.0.0/desdeo/utopia_stuff/utopia_problem_old.py +415 -0
  119. desdeo-2.0.0/desdeo/utopia_stuff/utopia_reference_solutions.py +79 -0
  120. desdeo-2.0.0/pyproject.toml +215 -0
  121. desdeo-1.2/PKG-INFO +0 -16
  122. desdeo-1.2/desdeo/__init__.py +0 -9
  123. desdeo-1.2/pyproject.toml +0 -28
desdeo-2.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 The Multiobjective Optimization Group (http://www.mit.jyu.fi/optgroup/).
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.
desdeo-2.0.0/PKG-INFO ADDED
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.3
2
+ Name: desdeo
3
+ Version: 2.0.0
4
+ Summary: DESDEO is a modular and open source framework for interactive multiobjective optimization.
5
+ License: MIT
6
+ Author: Giovanni Misitano
7
+ Author-email: giovanni.a.misitano@jyu.fi
8
+ Requires-Python: >=3.12,<3.13
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Requires-Dist: bayesian-optimization (>=1.0,<2.0)
13
+ Requires-Dist: cvxpy[scip] (>=1.6.4,<2.0.0)
14
+ Requires-Dist: greenlet (>=3.1.1,<4.0.0)
15
+ Requires-Dist: gurobipy (>=12.0.0,<13.0.0)
16
+ Requires-Dist: nevergrad (>=1.0.12,<2.0.0)
17
+ Requires-Dist: numba (>=0.61.0,<0.62.0)
18
+ Requires-Dist: numpy (>=2.2.0,<3.0.0)
19
+ Requires-Dist: polars (>=1.17,<2.0)
20
+ Requires-Dist: pyarrow (>=20.0.0,<21.0.0)
21
+ Requires-Dist: pydantic (>=2.9,<3.0)
22
+ Requires-Dist: pymoo (>=0.6.1.2,<0.7.0.0)
23
+ Requires-Dist: pyomo (>=6.8,<7.0)
24
+ Requires-Dist: pyparsing (>=3.0,<4.0)
25
+ Requires-Dist: scipy (>=1.11.4,<2.0.0)
26
+ Requires-Dist: shap (>=0.47.0,<0.48.0)
27
+ Requires-Dist: sympy (>=1.0,<2.0)
28
+ Requires-Dist: tsp-solver (>=0.1,<0.2)
29
+ Description-Content-Type: text/markdown
30
+
31
+ # DESDEO: the open-source software framework for interactive multiobjective optimization
32
+
33
+ [![Documentation Status](https://img.shields.io/readthedocs/desdeo.svg?version=desdeo2&label=Documentation)](https://desdeo.readthedocs.io/en/latest/) ![Tests](https://img.shields.io/github/actions/workflow/status/industrial-optimization-group/DESDEO/unit_tests.yaml?branch=desdeo2&label=Tests)
34
+
35
+ [![Discord server](https://dcbadge.vercel.app/api/server/TgSnUmzv5M)](https://discord.gg/TgSnUmzv5M)
36
+
37
+ ## Introduction
38
+
39
+ DESDEO is an open-source framework for interactive multiobjective optimization
40
+ methods. The framework contains implementations of both scalarization- and
41
+ population-based interactive methods. There are currently no other open-source
42
+ software frameworks that focus solely on the implementation of interactive
43
+ multiobjective optimization methods.
44
+
45
+ The mission of DESDEO is to increase awareness of the benefits of interactive
46
+ multiobjective optimization methods, make interactive methods openly available,
47
+ and to function as _the_ central hub for implementations of various interactive
48
+ methods. Apart from existing methods, DESDEO offers various tools to facilitate
49
+ the development of new methods and their application as well. Another important
50
+ goal of DESDEO is to answer the needs of decision makers and practitioners when
51
+ it comes to modeling and solving real-life multiobjective optimization problems.
52
+
53
+ In the bigger picture, DESDEO will be composed of three major components:
54
+
55
+ 1. The __core-logic__, which contains the algorithmic implementation of
56
+ interactive methods, various tools related to multiobjective optimization, and
57
+ means to model a variety of multiobjective optimization problems. The core-logic
58
+ can be considered stable enough for use in research and applications.
59
+ 2. The __web-API__ (WIP), which implements a web-based application programming
60
+ interface (API) to allow the use of the various functionalities found in
61
+ DESDEO's core-logic through a web connection. The web-API implements also a
62
+ database, which is a vital component for managing and enabling
63
+ decision-support using the framework. __The
64
+ web-API is currently under heavy development, and is subject to changes.__
65
+ 3. The __web-GUI__ (WIP), which implements a web-based interface for utilizing
66
+ the interactive methods and tools for modeling and solving multiobjective
67
+ optimization problems. __The web-GUI relies heavily on the web-API, and is also being actively developed currently, and therefore subject to sudden changes.__
68
+
69
+ For developing and experimenting with interactive multiobjective optimization
70
+ methods on a "grass root" level, the __core-logic__ provides the necessary
71
+ tools. For deploying interactive methods, the __web-API__ and the __web_GUI__
72
+ play a central role.
73
+
74
+ DESDEO is an open-source project and everybody is welcome to contribute!
75
+
76
+ ## Core-logic: key features
77
+
78
+ DESDEO's core-logic offers various features that can facilitate the application and
79
+ development of new interactive multiobjective optimization methods. Some
80
+ of the key features include, but are not limited to,
81
+
82
+ - A powerful, pydantic-based, schema for modeling multiobjective optimization
83
+ problem of various kinds. Including, analytically defined problems, data-based
84
+ problems, surrogate-based problems, and simulation-based problems.
85
+ Both continuous and (mixed-)integer problems are supported as well.
86
+ - Support to interface to many popular and powerful optimization software for
87
+ solving multiobjective optimization problems. Including Gurobi, various solvers
88
+ from the COIN-OR project, and nevergrad, for instance.
89
+ - A wide assortment of modular software components for implementing existing
90
+ and new interactive multiobjective optimization methods. For example, many
91
+ scalarization functions and evolutionary operators for multiobjective
92
+ optimization are available.
93
+ - An extensive documentation suitable for both newcomers to DESDEO and
94
+ interactive multiobjective optimization in general, and seasoned veterans.
95
+
96
+ ## Web-API: key features
97
+
98
+ DESDEO's web-API is currently under active development. Once it stabilized, its
99
+ key features will be listed here. In the meantime, the interested user can
100
+ follow (and contribute!) the development progress of the web-API in [this
101
+ issue](https://github.com/industrial-optimization-group/DESDEO/issues/245).
102
+
103
+ ## Web-GUI: key features
104
+
105
+ DESDEO's web-GUI is currently in a planning stage. Once its active development
106
+ starts, an issue will be created for documenting its development, as is
107
+ currently the case with the web-API.
108
+
109
+ ## Installation instructions
110
+
111
+ For installing DESDEO, please see the documentation (TODO) for instructions.
112
+
113
+ ## Documentation
114
+
115
+ Care has been taken to make sure DESDEO is well documented, making it accessible
116
+ to both newcomers and seasoned users alike. [The documentation of DESDEO is
117
+ available online.](https://desdeo.readthedocs.io/en/desdeo2/)
118
+
119
+ ## Contributing
120
+
121
+ As DESDEO is an open source-project, anybody is welcome to contribute.
122
+ An extensive tutorial to get started contributing to DESDEO
123
+ [is available in the documentation](https://desdeo.readthedocs.io/en/desdeo2/tutorials/contributing/).
124
+ Be sure to check it out!
125
+
126
+ For additional support for contributing to DESDEO,
127
+ be sure to check out the DESDEO channels
128
+ in the MCDM Community's Discord server. You may join the server
129
+ [through this invite](https://discord.gg/TgSnUmzv5M).
130
+
131
+ ## License
132
+
133
+ DESDEO is licensed under the MIT license. For more information,
134
+ check the `LICENSE` file.
135
+
136
+ ## Citing DESDEO
137
+
138
+ To cite DESDEO, please include the following reference:
139
+
140
+ [Misitano, G., Saini, B. S., Afsar, B., Shavazipour, B., & Miettinen, K. (2021). DESDEO: The modular and open source framework for interactive multiobjective optimization. IEEE Access, 9, 148277-148295.](https://doi.org/10.1109/ACCESS.2021.3123825)
141
+
142
+ ```
143
+ @article{misitano2021desdeo,
144
+ title={DESDEO: The modular and open source framework for interactive multiobjective optimization},
145
+ author={Misitano, Giovanni and Saini, Bhupinder Singh and Afsar, Bekir and Shavazipour, Babooshka and Miettinen, Kaisa},
146
+ journal={IEEE Access},
147
+ volume={9},
148
+ pages={148277--148295},
149
+ year={2021},
150
+ publisher={IEEE}
151
+ }
152
+ ```
153
+
154
+ __Note__: A new article describing the latest iteration of the framework,
155
+ also known as _DESDEO 2.0_ is currently being prepared. The content of
156
+ this repository's master branch is considered to be _DESDEO 2.0_.
157
+
158
+ ## Funding
159
+
160
+ Currently, DESDEO's development is partly funded by two projects granted by the
161
+ [Research Council of Finland](https://www.aka.fi/en/). The most recent ones
162
+ include:
163
+
164
+ - DESIDES (project 355346)
165
+ - UTOPIA (project 352784)
166
+ - DAEMON (project 322221)
167
+
168
+
desdeo-2.0.0/README.md ADDED
@@ -0,0 +1,137 @@
1
+ # DESDEO: the open-source software framework for interactive multiobjective optimization
2
+
3
+ [![Documentation Status](https://img.shields.io/readthedocs/desdeo.svg?version=desdeo2&label=Documentation)](https://desdeo.readthedocs.io/en/latest/) ![Tests](https://img.shields.io/github/actions/workflow/status/industrial-optimization-group/DESDEO/unit_tests.yaml?branch=desdeo2&label=Tests)
4
+
5
+ [![Discord server](https://dcbadge.vercel.app/api/server/TgSnUmzv5M)](https://discord.gg/TgSnUmzv5M)
6
+
7
+ ## Introduction
8
+
9
+ DESDEO is an open-source framework for interactive multiobjective optimization
10
+ methods. The framework contains implementations of both scalarization- and
11
+ population-based interactive methods. There are currently no other open-source
12
+ software frameworks that focus solely on the implementation of interactive
13
+ multiobjective optimization methods.
14
+
15
+ The mission of DESDEO is to increase awareness of the benefits of interactive
16
+ multiobjective optimization methods, make interactive methods openly available,
17
+ and to function as _the_ central hub for implementations of various interactive
18
+ methods. Apart from existing methods, DESDEO offers various tools to facilitate
19
+ the development of new methods and their application as well. Another important
20
+ goal of DESDEO is to answer the needs of decision makers and practitioners when
21
+ it comes to modeling and solving real-life multiobjective optimization problems.
22
+
23
+ In the bigger picture, DESDEO will be composed of three major components:
24
+
25
+ 1. The __core-logic__, which contains the algorithmic implementation of
26
+ interactive methods, various tools related to multiobjective optimization, and
27
+ means to model a variety of multiobjective optimization problems. The core-logic
28
+ can be considered stable enough for use in research and applications.
29
+ 2. The __web-API__ (WIP), which implements a web-based application programming
30
+ interface (API) to allow the use of the various functionalities found in
31
+ DESDEO's core-logic through a web connection. The web-API implements also a
32
+ database, which is a vital component for managing and enabling
33
+ decision-support using the framework. __The
34
+ web-API is currently under heavy development, and is subject to changes.__
35
+ 3. The __web-GUI__ (WIP), which implements a web-based interface for utilizing
36
+ the interactive methods and tools for modeling and solving multiobjective
37
+ optimization problems. __The web-GUI relies heavily on the web-API, and is also being actively developed currently, and therefore subject to sudden changes.__
38
+
39
+ For developing and experimenting with interactive multiobjective optimization
40
+ methods on a "grass root" level, the __core-logic__ provides the necessary
41
+ tools. For deploying interactive methods, the __web-API__ and the __web_GUI__
42
+ play a central role.
43
+
44
+ DESDEO is an open-source project and everybody is welcome to contribute!
45
+
46
+ ## Core-logic: key features
47
+
48
+ DESDEO's core-logic offers various features that can facilitate the application and
49
+ development of new interactive multiobjective optimization methods. Some
50
+ of the key features include, but are not limited to,
51
+
52
+ - A powerful, pydantic-based, schema for modeling multiobjective optimization
53
+ problem of various kinds. Including, analytically defined problems, data-based
54
+ problems, surrogate-based problems, and simulation-based problems.
55
+ Both continuous and (mixed-)integer problems are supported as well.
56
+ - Support to interface to many popular and powerful optimization software for
57
+ solving multiobjective optimization problems. Including Gurobi, various solvers
58
+ from the COIN-OR project, and nevergrad, for instance.
59
+ - A wide assortment of modular software components for implementing existing
60
+ and new interactive multiobjective optimization methods. For example, many
61
+ scalarization functions and evolutionary operators for multiobjective
62
+ optimization are available.
63
+ - An extensive documentation suitable for both newcomers to DESDEO and
64
+ interactive multiobjective optimization in general, and seasoned veterans.
65
+
66
+ ## Web-API: key features
67
+
68
+ DESDEO's web-API is currently under active development. Once it stabilized, its
69
+ key features will be listed here. In the meantime, the interested user can
70
+ follow (and contribute!) the development progress of the web-API in [this
71
+ issue](https://github.com/industrial-optimization-group/DESDEO/issues/245).
72
+
73
+ ## Web-GUI: key features
74
+
75
+ DESDEO's web-GUI is currently in a planning stage. Once its active development
76
+ starts, an issue will be created for documenting its development, as is
77
+ currently the case with the web-API.
78
+
79
+ ## Installation instructions
80
+
81
+ For installing DESDEO, please see the documentation (TODO) for instructions.
82
+
83
+ ## Documentation
84
+
85
+ Care has been taken to make sure DESDEO is well documented, making it accessible
86
+ to both newcomers and seasoned users alike. [The documentation of DESDEO is
87
+ available online.](https://desdeo.readthedocs.io/en/desdeo2/)
88
+
89
+ ## Contributing
90
+
91
+ As DESDEO is an open source-project, anybody is welcome to contribute.
92
+ An extensive tutorial to get started contributing to DESDEO
93
+ [is available in the documentation](https://desdeo.readthedocs.io/en/desdeo2/tutorials/contributing/).
94
+ Be sure to check it out!
95
+
96
+ For additional support for contributing to DESDEO,
97
+ be sure to check out the DESDEO channels
98
+ in the MCDM Community's Discord server. You may join the server
99
+ [through this invite](https://discord.gg/TgSnUmzv5M).
100
+
101
+ ## License
102
+
103
+ DESDEO is licensed under the MIT license. For more information,
104
+ check the `LICENSE` file.
105
+
106
+ ## Citing DESDEO
107
+
108
+ To cite DESDEO, please include the following reference:
109
+
110
+ [Misitano, G., Saini, B. S., Afsar, B., Shavazipour, B., & Miettinen, K. (2021). DESDEO: The modular and open source framework for interactive multiobjective optimization. IEEE Access, 9, 148277-148295.](https://doi.org/10.1109/ACCESS.2021.3123825)
111
+
112
+ ```
113
+ @article{misitano2021desdeo,
114
+ title={DESDEO: The modular and open source framework for interactive multiobjective optimization},
115
+ author={Misitano, Giovanni and Saini, Bhupinder Singh and Afsar, Bekir and Shavazipour, Babooshka and Miettinen, Kaisa},
116
+ journal={IEEE Access},
117
+ volume={9},
118
+ pages={148277--148295},
119
+ year={2021},
120
+ publisher={IEEE}
121
+ }
122
+ ```
123
+
124
+ __Note__: A new article describing the latest iteration of the framework,
125
+ also known as _DESDEO 2.0_ is currently being prepared. The content of
126
+ this repository's master branch is considered to be _DESDEO 2.0_.
127
+
128
+ ## Funding
129
+
130
+ Currently, DESDEO's development is partly funded by two projects granted by the
131
+ [Research Council of Finland](https://www.aka.fi/en/). The most recent ones
132
+ include:
133
+
134
+ - DESIDES (project 355346)
135
+ - UTOPIA (project 352784)
136
+ - DAEMON (project 322221)
137
+
@@ -0,0 +1,9 @@
1
+ """Configuration stuff of the DESDEO framework."""
2
+
3
+ from desdeo.core import _check_executables
4
+
5
+ # List of required executables
6
+ required_executables = ["bonmin", "cbc", "ipopt"]
7
+
8
+ # Check for executables when the library is imported
9
+ _check_executables(required_executables)
@@ -0,0 +1,73 @@
1
+ # DESDEO web API
2
+ Experimental. The instructions below assume that the current working directory
3
+ is `desdeo/api` and that the DESDEO framework has been installed successfully
4
+ with the extra dependencies in the `api` group.
5
+
6
+ ## API configuration
7
+
8
+ The API configuration is handled by the settings found in `config.toml`. This
9
+ file should be used for reading existing configuration parameters and adding
10
+ new ones. Except for deployment (TODO).
11
+
12
+ ## Initializing the database
13
+
14
+ To initialize the database, run the script `db_init.py` with the following command:
15
+
16
+ ```shell
17
+ python db_init.py
18
+ ```
19
+
20
+ This will create an initial databse, which allows testing for, e.g., testing
21
+ the databse. However, the tests themselves (see below), do not depend on this
22
+ database, and handle the database for running the tests on their own.
23
+
24
+ Importantly, this will create an analyst user, which can be used to test out
25
+ the end-points using the FastAPI generated documentation (see below). The
26
+ default name of the analyst user will be 'analyst' with the password 'analyst'.
27
+
28
+ This is mainly for testing purposes, which will create and manage a local
29
+ dblite-databse.
30
+
31
+ ## Running the API
32
+
33
+ To run the API, invoke `uvicorn` as followsi:
34
+
35
+ ```shell
36
+ uvicorn --app-dir=./ app:app --reload
37
+ ```
38
+ See the outputs of the command to figure out where the API is running. This is
39
+ likely something along the lines `http:127.0.0.1:8000`, but may vary.
40
+
41
+ ## Exploring the API
42
+
43
+ Once the API is running, its endpoints can be interactively explored by accessing
44
+ `<api_url>/docs`. For example, `http:127.0.0:8000/docs`. The `analyst` user created by
45
+ invoking `init_db.py` can be used to authorize and access the protected endpoints.
46
+
47
+ ## Running (unit) tests
48
+
49
+ Pytest can be used to run tests relate to the API with the following command:
50
+
51
+ ```shell
52
+ pytest
53
+ ```
54
+ Again, it is assumed for the current working directory to be `desdeo/api`.
55
+ Otherwise a lot of tests will be executed.
56
+
57
+ ## How the API works
58
+
59
+ The API consists of two important concepts: __models__ and __routers__. At the
60
+ core of the API, is a database.
61
+
62
+ Models utilize SQLite to define databse models. In other words, it describes
63
+ stuff we want to store in the databse. These models are very similar to
64
+ pydantic models, and are almost interchangeable. One major difference is that
65
+ the models are relational. This means that models often relate to each other.
66
+ E.g., an `ArchiveEntryDB` is the child of the model `User`.
67
+
68
+ Routers define HTTP endpoints to access and database and the models within.
69
+ These endpoints often modify the contents of the database, e.g., by solving a
70
+ problem with an interactive method, and then saving the solutions back to the
71
+ database. Endpoints often make use of code found in the core-logic (the
72
+ algorithms containing part of DESDEO), and are, in fact, a way to utilize this
73
+ code through the web (which is the whole point of this API!).
@@ -0,0 +1,15 @@
1
+ """Exports for desdeo.api."""
2
+
3
+ __all__ = [
4
+ "AuthDebugConfig",
5
+ "DatabaseDebugConfig",
6
+ "ServerDebugConfig",
7
+ "SettingsConfig",
8
+ ]
9
+
10
+ from .config import (
11
+ AuthDebugConfig,
12
+ DatabaseDebugConfig,
13
+ ServerDebugConfig,
14
+ SettingsConfig,
15
+ )
@@ -0,0 +1,40 @@
1
+ """The main FastAPI application for the DESDEO API."""
2
+
3
+ from fastapi import FastAPI
4
+ from fastapi.middleware.cors import CORSMiddleware
5
+
6
+ from desdeo.api.config import AuthDebugConfig, SettingsConfig
7
+ from desdeo.api.routers import (
8
+ problem,
9
+ reference_point_method,
10
+ session,
11
+ user_authentication,
12
+ )
13
+
14
+ if SettingsConfig.debug:
15
+ # debug and development stuff
16
+
17
+ app = FastAPI(
18
+ title="DESDEO (fast)API",
19
+ version="0.1.0",
20
+ description="A rest API for the DESDEO framework.",
21
+ )
22
+
23
+ app.include_router(user_authentication.router)
24
+ app.include_router(problem.router)
25
+ app.include_router(session.router)
26
+ app.include_router(reference_point_method.router)
27
+
28
+ origins = AuthDebugConfig.cors_origins
29
+
30
+ app.add_middleware(
31
+ CORSMiddleware,
32
+ allow_origins=origins,
33
+ allow_credentials=True,
34
+ allow_methods=["*"],
35
+ allow_headers=["*"],
36
+ )
37
+
38
+ else:
39
+ # deployment stuff
40
+ pass
@@ -0,0 +1,69 @@
1
+ """Defines dataclasses to store configurations loaded from 'config.toml'."""
2
+
3
+ import tomllib
4
+ from pathlib import Path
5
+ from typing import ClassVar
6
+
7
+ from pydantic import BaseModel
8
+
9
+ # Load the config data once
10
+ config_path = Path(__file__).resolve().parent / "config.toml"
11
+ with config_path.open("rb") as fp:
12
+ config_data = tomllib.load(fp)
13
+
14
+
15
+ class SettingsConfig(BaseModel):
16
+ """General settings."""
17
+
18
+ debug: ClassVar[bool] = config_data["settings"]["debug"]
19
+
20
+
21
+ class ServerDebugConfig(BaseModel):
22
+ """Server setup settings (development)."""
23
+
24
+ test_user_analyst_name: ClassVar[str] = config_data["server-debug"]["test_user_analyst_name"]
25
+ test_user_analyst_password: ClassVar[str] = config_data["server-debug"]["test_user_analyst_password"]
26
+ test_user_dm1_name: ClassVar[str] = config_data["server-debug"]["test_user_dm1_name"]
27
+ test_user_dm1_password: ClassVar[str] = config_data["server-debug"]["test_user_dm1_password"]
28
+ test_user_dm2_name: ClassVar[str] = config_data["server-debug"]["test_user_dm2_name"]
29
+ test_user_dm2_password: ClassVar[str] = config_data["server-debug"]["test_user_dm2_password"]
30
+
31
+
32
+ class AuthDebugConfig(BaseModel):
33
+ """Authentication settings (development)."""
34
+
35
+ authjwt_secret_key: ClassVar[str] = config_data["auth-debug"]["authjwt_secret_key"]
36
+ authjwt_algorithm: ClassVar[str] = config_data["auth-debug"]["authjwt_algorithm"]
37
+ authjwt_access_token_expires: ClassVar[int] = config_data["auth-debug"]["authjwt_access_token_expires"]
38
+ authjwt_refresh_token_expires: ClassVar[int] = config_data["auth-debug"]["authjwt_refresh_token_expires"]
39
+ cors_origins: ClassVar[list[str]] = config_data["auth-debug"]["cors_origins"]
40
+
41
+
42
+ class DatabaseDebugConfig(BaseModel):
43
+ """Database setting (development)."""
44
+
45
+ db_host: ClassVar[str] = config_data["database-debug"]["db_host"]
46
+ db_port: ClassVar[str] = config_data["database-debug"]["db_port"]
47
+ db_database: ClassVar[str] = config_data["database-debug"]["db_database"]
48
+ db_username: ClassVar[str] = config_data["database-debug"]["db_username"]
49
+ db_password: ClassVar[str] = config_data["database-debug"]["db_password"]
50
+ db_pool_size: ClassVar[int] = config_data["database-debug"]["db_pool_size"]
51
+ db_max_overflow: ClassVar[int] = config_data["database-debug"]["db_max_overflow"]
52
+ db_pool: ClassVar[bool] = config_data["database-debug"]["db_pool"]
53
+
54
+
55
+ # class DatabaseDeployConfig(BaseModel):
56
+ # # db_host: str = config_data["database-deploy"]["db_host"]
57
+ # db_port: str = config_data["database-deploy"]["db_port"]
58
+ # db_database: str = config_data["database-deploy"]["db_database"]
59
+ # db_username: str = config_data["database-deploy"]["db_username"]
60
+ # db_password: str = config_data["database-deploy"]["db_password"]
61
+ # db_pool_size: int = config_data["database-deploy"]["db_pool_size"]
62
+ # db_max_overflow: int = config_data["database-deploy"]["db_max_overflow"]
63
+ # db_pool: bool = config_data["database-deploy"]["db_pool"]
64
+
65
+ # class AuthDeployConfig(BaseModel):
66
+ # authjwt_algorithm: str = config_data["auth-deploy"]["authjwt_algorithm"]
67
+ # authjwt_access_token_expires: int = config_data["auth-deploy"]["authjwt_access_token_expires"]
68
+ # authjwt_refresh_token_expires: int = config_data["auth-deploy"]["authjwt_refresh_token_expires"]
69
+ # Note: authjwt_secret_key should be retrieved securely in production
@@ -0,0 +1,53 @@
1
+ [settings]
2
+ debug = true
3
+
4
+ # development configs
5
+ [server-debug]
6
+ test_user_analyst_name = "analyst"
7
+ test_user_analyst_password = "analyst"
8
+ test_user_dm1_name = "dm1"
9
+ test_user_dm1_password = "dm1"
10
+ test_user_dm2_name = "dm2"
11
+ test_user_dm2_password = "dm2"
12
+
13
+ # Auth configuration
14
+ [auth-debug]
15
+ authjwt_secret_key = "36b96a23d24cebdeadce6d98fa53356111e6f3e85b8144d7273dcba230b9eb18"
16
+ authjwt_algorithm = "HS256"
17
+ authjwt_access_token_expires = 15 # in minutes
18
+ authjwt_refresh_token_expires = 30 # in minutes
19
+ cors_origins = [
20
+ "http://localhost",
21
+ "http://localhost:8080",
22
+ "http://localhost:5173",
23
+ ]
24
+
25
+ [auth-deploy]
26
+ # TODO
27
+ # secret key should be read from env DO NOT EXPOSE!!!!
28
+ authjwt_algorithm = "HS256"
29
+ authjwt_access_token_expires = 15 # in minutes
30
+ authjwt_refresh_token_expires = 30 # in minutes
31
+
32
+ # SQLite setup (enabled for local development)
33
+ [database-debug]
34
+ db_host = ""
35
+ db_port = ""
36
+ db_database = "sqlite:///./test.db"
37
+ db_username = ""
38
+ db_password = ""
39
+ db_pool_size = 1
40
+ db_max_overflow = 0
41
+ db_pool = false
42
+
43
+ # Database configuration (deployment)
44
+ [database-deploy]
45
+ # READ FROM ENV!!!
46
+ # db_host = "localhost"
47
+ # db_port = "5432"
48
+ # db_database = "test"
49
+ # db_username = "test"
50
+ # db_password = "testpw"
51
+ # db_pool_size = 20
52
+ # db_max_overflow = 20
53
+ # db_pool = true
@@ -0,0 +1,25 @@
1
+ """Database configuration file for the API."""
2
+
3
+ from sqlmodel import Session, create_engine
4
+
5
+ from desdeo.api.config import DatabaseDebugConfig, SettingsConfig
6
+
7
+ if SettingsConfig.debug:
8
+ # debug and development stuff
9
+
10
+ # SQLite setup
11
+ engine = create_engine(DatabaseDebugConfig.db_database, connect_args={"check_same_thread": False})
12
+
13
+ else:
14
+ # deployment stuff
15
+
16
+ # Postgresql setup
17
+ # check from config.toml
18
+ # SQLALCHEMY_DATABASE_URL = f"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}"
19
+ pass
20
+
21
+
22
+ def get_session():
23
+ """Yield the current database session."""
24
+ with Session(engine) as session:
25
+ yield session