Skip to content

Commit

Permalink
removed deap as a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Immudzen committed Aug 17, 2021
1 parent 5fac6fb commit e6b4957
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 21 deletions.
1 change: 0 additions & 1 deletion CADETMatch.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<Compile Include="CADETMatch\abstract\__init__.py" />
<Compile Include="CADETMatch\cache.py" />
<Compile Include="CADETMatch\calc_coeff.py" />
<Compile Include="CADETMatch\code_test.py" />
<Compile Include="CADETMatch\de.py" />
<Compile Include="CADETMatch\de_snooker.py" />
<Compile Include="CADETMatch\evo.py" />
Expand Down
1 change: 0 additions & 1 deletion CADETMatch/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import jstyleson
import numpy
from cadet import Cadet
from deap import tools
from sklearn import preprocessing

import CADETMatch.plugins as plugins
Expand Down
3 changes: 1 addition & 2 deletions CADETMatch/evo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import numpy
from cadet import Cadet
from deap import creator, tools

import CADETMatch.cache as cache
import CADETMatch.progress as progress
Expand Down Expand Up @@ -151,4 +150,4 @@ def runExperimentBase(
def run(cache):
"run the parameter estimation"
searchMethod = cache.settings.get("searchMethod", "UNSGA3")
return cache.search[searchMethod].run(cache, tools, creator)
return cache.search[searchMethod].run(cache)
1 change: 0 additions & 1 deletion CADETMatch/fitness.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy
from deap import base


class Fitness2(base.Fitness):
Expand Down
6 changes: 2 additions & 4 deletions CADETMatch/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import numpy
import functools
from cadet import H5, Cadet
from deap import base, creator, tools

import CADETMatch.evo as evo
import CADETMatch.gradFD as gradFD
Expand All @@ -26,7 +25,6 @@ def main(map_function):
path = sys.argv[1]
setup(cache, path, map_function)
gradFD.setupTemplates(cache)
# grad.setupTemplates(cache)
hof = evo.run(cache)

multiprocessing.get_logger().info("altScoress %s", cache.altScores)
Expand Down Expand Up @@ -133,7 +131,6 @@ def print_version():
("corner", "2.2.1"),
("emcee", "3.0.2"),
("SALib", "1.3.11"),
("deap", "1.3.1"),
("psutil", "5.8.0"),
("numpy", "1.21.1"),
("openpyxl", "3.0.7"),
Expand All @@ -145,7 +142,8 @@ def print_version():
("seaborn", "0.11.1"),
("scikit-learn", "0.24.2"),
("jstyleson", "0.2.0"),
('filelock', "3.0.12")
('filelock', "3.0.12"),
('pymoo', '0.4.2.2')
]

for module, version_tested in modules:
Expand Down
4 changes: 2 additions & 2 deletions CADETMatch/pareto.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import numpy
class ParetoFront:
"Modification of the pareto front in DEAP that takes cache as an argument to update to use for similar comparison"
"Pareto front designed to be compatible with DEAP"

def __init__(self, dimensions, similar=None, similar_fit=None, slice_object=slice(None)):
if similar is None:
Expand Down Expand Up @@ -135,7 +135,7 @@ def getBestScores(self):
return numpy.min(data, 0)

class DummyFront(ParetoFront):
"Modification of the pareto front in DEAP that takes cache as an argument to update to use for similar comparison"
"Pareto front designed to be compatible with DEAP"

def __init__(self, dimensions=None, similar=None):
"This is here for API compatibility, don't do anything"
Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/search/altScore.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
name = "AltScore"


def run(cache, tools, creator):
def run(cache):
"run the parameter estimation"
path = Path(cache.settings["resultsDirBase"], cache.settings["csv"])
with path.open("a", newline="") as csvfile:
Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/search/gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name = "Gradient"


def run(cache, tools, creator):
def run(cache):
"run the parameter estimation"
random.seed()

Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/search/graphSpace.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"This is not actually an optimization method. It is used to sample a space and generate graphs to see what the space looks like."


def run(cache, tools, creator):
def run(cache):
"run the parameter estimation"
random.seed()

Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/search/mcmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ def write_interval(
write_interval.last_time = time.time()


def run(cache, tools, creator):
def run(cache):
"run the parameter estimation"
random.seed()
checkpointFile = Path(
Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/search/multistart.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
name = "Multistart"


def run(cache, tools, creator):
def run(cache):
"run the parameter estimation"
random.seed()

Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/search/nsga3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
name = "NSGA3"


def run(cache, tools, creator):
def run(cache):
"run the parameter estimation"
return CADETMatch.pymoo_config.run(cache, 'nsga3')
2 changes: 1 addition & 1 deletion CADETMatch/search/scoretest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name = "ScoreTest"


def run(cache, tools, creator):
def run(cache):
"run the parameter estimation"
path = Path(cache.settings["resultsDirBase"], cache.settings["csv"])
with path.open("a", newline="") as csvfile:
Expand Down
2 changes: 1 addition & 1 deletion CADETMatch/search/unsga3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name = "UNSGA3"


def run(cache, tools, creator):
def run(cache):
"run the parameter estimation"
return CADETMatch.pymoo_config.run(cache, 'unsga3')

Expand Down
1 change: 0 additions & 1 deletion CADETMatch/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import scipy.signal
from addict import Dict
from cadet import H5, Cadet
from deap import tools

import CADETMatch.calc_coeff as calc_coeff
import CADETMatch.sub as sub
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'emcee>=3.0.2',
'SAlib',
'corner>=2.1.0',
'deap>=1.3.1',
'pymoo>=0.4.2.2',
'psutil>=5.7.0',
'openpyxl>=3.0.3',
'numpy>=1.18.5',
Expand Down

0 comments on commit e6b4957

Please sign in to comment.