jcmoptimizer 3.0.2__tar.gz → 3.0.4__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 (23) hide show
  1. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/PKG-INFO +3 -3
  2. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/README.md +2 -2
  3. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/drivers/driver.py +20 -12
  4. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/drivers/third_party_drivers.py +4 -4
  5. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/requestor.py +9 -9
  6. jcmoptimizer-3.0.4/jcmoptimizer/version.py +1 -0
  7. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer.egg-info/PKG-INFO +3 -3
  8. jcmoptimizer-3.0.2/jcmoptimizer/version.py +0 -1
  9. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/LICENSE +0 -0
  10. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/__init__.py +0 -0
  11. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/benchmark.py +0 -0
  12. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/client.py +0 -0
  13. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/drivers/__init__.py +0 -0
  14. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/drivers/active_learning_drivers.py +0 -0
  15. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/objects.py +0 -0
  16. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/server.py +0 -0
  17. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer/study.py +0 -0
  18. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer.egg-info/SOURCES.txt +0 -0
  19. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer.egg-info/dependency_links.txt +0 -0
  20. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer.egg-info/requires.txt +0 -0
  21. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/jcmoptimizer.egg-info/top_level.txt +0 -0
  22. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/pyproject.toml +0 -0
  23. {jcmoptimizer-3.0.2 → jcmoptimizer-3.0.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jcmoptimizer
3
- Version: 3.0.2
3
+ Version: 3.0.4
4
4
  Summary: The JCMoptimizer interface for Python
5
5
  Author-email: Philipp Schneider <philipp.schneider@jcmwave.com>
6
6
  License-Expression: MIT
@@ -24,14 +24,14 @@ This package implements a python client for interacting with the JCMoptimizer se
24
24
 
25
25
  ### Cloud Service
26
26
  The easiest way to get started is to use the free tier of the JCMwave's cloud service for JCMoptimizer:
27
- * Install the `jcmoptimizer` package into your python environmentm, e.g. by runing `pip install jcmoptimizer`.
27
+ * Install the `jcmoptimizer` package into your python environment, e.g. by running `pip install jcmoptimizer`.
28
28
  * Signup to [optimizer.jcmwave.com](https://optimizer.jcmwave.com).
29
29
  * Create an [API access token](https://optimizer.jcmwave.com/cloud/tokens/list/)
30
30
 
31
31
  ### Run JCMoptimizer Locally
32
32
  For a self-hosted version, you need install JCMsuite and the JCMoptimizer extension for JCMsuite:
33
33
  * Browse to the [JCMsuite download](https://installation.jcmwave.com/fb13885794fc64c42531c9656f8f6f73.php) page to install JCMsuite and to retrieve a demo or commercial license.
34
- * Browse to the [JCMoptimizer download](https://optimizer.jcmwave.com/download) page to install JCMoptimzizer.
34
+ * Browse to the [JCMoptimizer download](https://optimizer.jcmwave.com/download) page to install JCMoptimizer.
35
35
 
36
36
  ### First Example
37
37
  A basic usage example of the python package is given in the tutorial on a [Bayesian Optimization](https://optimizer.jcmwave.com/documentation/python/latest/tutorials/vanilla_bayesian_optimization.html).
@@ -6,14 +6,14 @@ This package implements a python client for interacting with the JCMoptimizer se
6
6
 
7
7
  ### Cloud Service
8
8
  The easiest way to get started is to use the free tier of the JCMwave's cloud service for JCMoptimizer:
9
- * Install the `jcmoptimizer` package into your python environmentm, e.g. by runing `pip install jcmoptimizer`.
9
+ * Install the `jcmoptimizer` package into your python environment, e.g. by running `pip install jcmoptimizer`.
10
10
  * Signup to [optimizer.jcmwave.com](https://optimizer.jcmwave.com).
11
11
  * Create an [API access token](https://optimizer.jcmwave.com/cloud/tokens/list/)
12
12
 
13
13
  ### Run JCMoptimizer Locally
14
14
  For a self-hosted version, you need install JCMsuite and the JCMoptimizer extension for JCMsuite:
15
15
  * Browse to the [JCMsuite download](https://installation.jcmwave.com/fb13885794fc64c42531c9656f8f6f73.php) page to install JCMsuite and to retrieve a demo or commercial license.
16
- * Browse to the [JCMoptimizer download](https://optimizer.jcmwave.com/download) page to install JCMoptimzizer.
16
+ * Browse to the [JCMoptimizer download](https://optimizer.jcmwave.com/download) page to install JCMoptimizer.
17
17
 
18
18
  ### First Example
19
19
  A basic usage example of the python package is given in the tutorial on a [Bayesian Optimization](https://optimizer.jcmwave.com/documentation/python/latest/tutorials/vanilla_bayesian_optimization.html).
@@ -4,6 +4,7 @@ import time
4
4
 
5
5
  from ..requestor import OptimizerRequestor
6
6
 
7
+
7
8
  class Driver:
8
9
  """This class provides methods for retrieving and setting driver-specific
9
10
  information of the study. Depending on the chosen driver of
@@ -19,8 +20,10 @@ class Driver:
19
20
  The constructor should not be used directly since it does not create a
20
21
  driver on the server side. Instead, one should use :attr:`Study.driver`.
21
22
  """
22
-
23
- def __init__(self, study_id: str, project_id: str, requestor: OptimizerRequestor) -> None:
23
+
24
+ def __init__(
25
+ self, study_id: str, project_id: str, requestor: OptimizerRequestor
26
+ ) -> None:
24
27
  self._requestor = requestor
25
28
  self.study_id = study_id
26
29
  self.project_id = project_id
@@ -28,7 +31,7 @@ class Driver:
28
31
  @property
29
32
  def qualifier(self) -> str:
30
33
  return self.project_id + "." + self.study_id
31
-
34
+
32
35
  def _post(
33
36
  self,
34
37
  purpose: str,
@@ -38,7 +41,7 @@ class Driver:
38
41
  ) -> dict[str, Any]:
39
42
  return self._requestor.post(purpose, object, operation, self.qualifier, data)
40
43
 
41
- def _get(self, purpose:str, object: str, type: str) -> dict[str, Any]:
44
+ def _get(self, purpose: str, object: str, type: str) -> dict[str, Any]:
42
45
  return self._requestor.get(purpose, object, type, self.qualifier)
43
46
 
44
47
  def _run_task(self, purpose: str, task: str, data: dict[str, Any]) -> Any:
@@ -82,11 +85,11 @@ class Driver:
82
85
  Returns: A nested dictionary with description of submodules consisting
83
86
  of a name and a descriptive text. If the entry describes a module,
84
87
  it has an additional ``"members"`` entry with dictionaries describing
85
- submodules and parameters.
88
+ submodules and parameters.
86
89
  """
87
90
  answer = self._get("get description of the driver", "driver", "describe")
88
91
  return answer["description"]
89
-
92
+
90
93
  def get_state(self, path: Optional[str] = None) -> dict[str, Any]:
91
94
  """Get state of the driver. Example::
92
95
 
@@ -105,7 +108,7 @@ class Driver:
105
108
  "get driver state", "driver", "get_state", data={"path": path}
106
109
  )
107
110
  return answer["state"]
108
-
111
+
109
112
  def historic_parameter_values(self, path: str) -> list[Any]:
110
113
  """Get the values of an internal parameter for each iteration of the study. Example::
111
114
 
@@ -125,10 +128,11 @@ class Driver:
125
128
  data={"path": path},
126
129
  )
127
130
  return answer["values"]
128
-
131
+
132
+
129
133
  class Minimizer(Driver):
130
134
  """
131
- This class provides methods for retieving and setting information of the
135
+ This class provides methods for retrieving and setting information of the
132
136
  minimization driver of the study.
133
137
  """
134
138
 
@@ -139,7 +143,7 @@ class Minimizer(Driver):
139
143
 
140
144
  for key, value in driver.best_sample.items():
141
145
  print(f"{key} = {value}")
142
-
146
+
143
147
  """
144
148
  answer = self._post(
145
149
  "get best sample", "driver", "get_state", data={"path": "best_sample"}
@@ -155,13 +159,17 @@ class Minimizer(Driver):
155
159
 
156
160
  """
157
161
  answer = self._post(
158
- "get minimal objective value", "driver", "get_state", data={"path": "min_objective"}
162
+ "get minimal objective value",
163
+ "driver",
164
+ "get_state",
165
+ data={"path": "min_objective"},
159
166
  )
160
167
  return answer["state"]
161
168
 
169
+
162
170
  class LeastSquaresDriver(Minimizer):
163
171
  """
164
- This class provides methods for retieving information of the
172
+ This class provides methods for retrieving information of the
165
173
  result of the least squares minimization using ``scipy.optimize.least_squares``.
166
174
  """
167
175
 
@@ -3,7 +3,7 @@ from .driver import Minimizer, LeastSquaresDriver
3
3
 
4
4
  class DifferentialEvolution(Minimizer):
5
5
  """
6
- This class provides methods for retieving information of the
6
+ This class provides methods for retrieving information of the
7
7
  result of the differential evolution.
8
8
  """
9
9
 
@@ -12,7 +12,7 @@ class DifferentialEvolution(Minimizer):
12
12
 
13
13
  class CMAES(Minimizer):
14
14
  """
15
- This class provides methods for retieving information of the
15
+ This class provides methods for retrieving information of the
16
16
  result of the CMA-ES minimization.
17
17
  """
18
18
 
@@ -21,7 +21,7 @@ class CMAES(Minimizer):
21
21
 
22
22
  class ScipyMinimizer(Minimizer):
23
23
  """
24
- This class provides methods for retieving information of the
24
+ This class provides methods for retrieving information of the
25
25
  result of the minimization using ``scipy.optimize.minimize``.
26
26
  """
27
27
 
@@ -30,7 +30,7 @@ class ScipyMinimizer(Minimizer):
30
30
 
31
31
  class ScipyLeastSquares(LeastSquaresDriver):
32
32
  """
33
- This class provides methods for retieving information of the
33
+ This class provides methods for retrieving information of the
34
34
  result of the least squares minimization using ``scipy.optimize.least_squares``.
35
35
  """
36
36
 
@@ -53,6 +53,7 @@ def warn(message: str) -> None:
53
53
  WORK_DONE = threading.Event()
54
54
  WORK_DONE.set()
55
55
 
56
+
56
57
  def work_animation(work_done: threading.Event, msg: str) -> None:
57
58
  for c in itertools.cycle("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"):
58
59
  if work_done.is_set():
@@ -87,9 +88,11 @@ class ServerError(EnvironmentError):
87
88
  class NumParallelError(EnvironmentError):
88
89
  pass
89
90
 
91
+
90
92
  class ServerShutdownError(EnvironmentError):
91
93
  pass
92
94
 
95
+
93
96
  def _get_value(expr: str) -> Any:
94
97
  if expr == "true":
95
98
  return True
@@ -102,12 +105,13 @@ def _get_value(expr: str) -> Any:
102
105
  if expr.isdigit():
103
106
  return int(expr)
104
107
  if expr.count(":") == 2:
105
- h,m,s = expr.split(":")
106
- return timedelta(hours=int(h),minutes=int(m),seconds=int(s))
108
+ h, m, s = expr.split(":")
109
+ return timedelta(hours=int(h), minutes=int(m), seconds=int(s))
107
110
  try:
108
111
  return float(expr)
109
112
  except ValueError:
110
- raise SyntaxError
113
+ # default to string
114
+ return expr
111
115
 
112
116
 
113
117
  def parse_yaml(f: TextIO) -> dict[str, Any]:
@@ -158,7 +162,6 @@ def read_yml_config_files() -> dict[str, Any]:
158
162
 
159
163
 
160
164
  class Requestor:
161
-
162
165
  def __init__(self, endpoint: str, token: str) -> None:
163
166
  is_in_notebook = False
164
167
  try:
@@ -249,7 +252,7 @@ class Requestor:
249
252
  ) -> None:
250
253
  if status_code >= 500:
251
254
  raise ServerError(
252
- "An internal server error occured. Please, check your entries."
255
+ "An internal server error occurred. Please, check your entries."
253
256
  f"\nRequest: {data}"
254
257
  f"\nResponse: {status_code} {response_data}"
255
258
  )
@@ -264,7 +267,6 @@ class Requestor:
264
267
 
265
268
 
266
269
  class CloudRequestor(Requestor):
267
-
268
270
  def __init__(self, cloud_endpoint: str, token: str) -> None:
269
271
  super().__init__(endpoint=cloud_endpoint, token=token)
270
272
 
@@ -278,7 +280,6 @@ class CloudRequestor(Requestor):
278
280
 
279
281
 
280
282
  class OptimizerRequestor(Requestor):
281
-
282
283
  def __init__(
283
284
  self,
284
285
  host: str,
@@ -328,8 +329,7 @@ class OptimizerRequestor(Requestor):
328
329
  raise ServerShutdownError(
329
330
  f"Could not {purpose}. The server is shutting down."
330
331
  )
331
-
332
-
332
+
333
333
  def get(
334
334
  self,
335
335
  purpose: str,
@@ -0,0 +1 @@
1
+ __version__ = '3.0.4'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jcmoptimizer
3
- Version: 3.0.2
3
+ Version: 3.0.4
4
4
  Summary: The JCMoptimizer interface for Python
5
5
  Author-email: Philipp Schneider <philipp.schneider@jcmwave.com>
6
6
  License-Expression: MIT
@@ -24,14 +24,14 @@ This package implements a python client for interacting with the JCMoptimizer se
24
24
 
25
25
  ### Cloud Service
26
26
  The easiest way to get started is to use the free tier of the JCMwave's cloud service for JCMoptimizer:
27
- * Install the `jcmoptimizer` package into your python environmentm, e.g. by runing `pip install jcmoptimizer`.
27
+ * Install the `jcmoptimizer` package into your python environment, e.g. by running `pip install jcmoptimizer`.
28
28
  * Signup to [optimizer.jcmwave.com](https://optimizer.jcmwave.com).
29
29
  * Create an [API access token](https://optimizer.jcmwave.com/cloud/tokens/list/)
30
30
 
31
31
  ### Run JCMoptimizer Locally
32
32
  For a self-hosted version, you need install JCMsuite and the JCMoptimizer extension for JCMsuite:
33
33
  * Browse to the [JCMsuite download](https://installation.jcmwave.com/fb13885794fc64c42531c9656f8f6f73.php) page to install JCMsuite and to retrieve a demo or commercial license.
34
- * Browse to the [JCMoptimizer download](https://optimizer.jcmwave.com/download) page to install JCMoptimzizer.
34
+ * Browse to the [JCMoptimizer download](https://optimizer.jcmwave.com/download) page to install JCMoptimizer.
35
35
 
36
36
  ### First Example
37
37
  A basic usage example of the python package is given in the tutorial on a [Bayesian Optimization](https://optimizer.jcmwave.com/documentation/python/latest/tutorials/vanilla_bayesian_optimization.html).
@@ -1 +0,0 @@
1
- __version__ = '3.0.2'
File without changes
File without changes