Skip to content

Commit

Permalink
Restrict OMADS to medium precision
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed-Bayoumy committed Apr 22, 2024
1 parent fad0889 commit 9ae8cbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/DMDO/SP.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# https://github.com/Ahmed-Bayoumy/DMDO #
# ------------------------------------------------------------------------------------#

import platform
from ._globals import *
from ._common import *
from ._protocols import *
Expand Down Expand Up @@ -439,6 +440,8 @@ def solve(self, v, w, file: str = None, iter: int = None):
"save_all_best": False,
"parallel_mode": False
}
isWin = platform.platform().split('-')[0] == 'Windows'
options["precision"] = "high" if isWin else "medium"
if self.conf is not None and "search" in self.conf and self.conf["search"] is not None:
search = self.conf["search"]
else:
Expand Down
2 changes: 1 addition & 1 deletion src/DMDO/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __truediv__(self, other):

def __update__(self, other):
if type(other)!=variableData and type(self.value) != type(other):
raise IOError(f'The variables data dunder equality method of {self.name} expects a variable data object as an input or variable values with the same type of {self.name}!')
warning(f'The variables data dunder equality method of {self.name} expects a variable data object as an input or variable values with the same type of {self.name}!')
if isinstance(other, variableData):
self = copy.deepcopy(other)
elif isinstance(other, list) or isinstance(other, np.ndarray):
Expand Down

0 comments on commit 9ae8cbe

Please sign in to comment.