Skip to content

Commit

Permalink
Merge pull request #8 from MeraX/patch-1
Browse files Browse the repository at this point in the history
Compare strings using the `==` operator.
  • Loading branch information
capaulson committed May 17, 2016
2 parents 9117e89 + bb5aaa2 commit 718efca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyKriging/krige.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def train(self, optimizer='pso'):
rand.seed(int(time()))

# If the optimizer option is PSO, run the PSO algorithm
if optimizer is 'pso':
if optimizer == 'pso':
ea = inspyred.swarm.PSO(Random())
ea.terminator = self.no_improvement_termination
ea.topology = inspyred.swarm.topologies.ring_topology
Expand All @@ -383,7 +383,7 @@ def train(self, optimizer='pso'):
final_pop.sort(reverse=True)

# If not using a PSO search, run the GA
elif optimizer is 'ga':
elif optimizer == 'ga':
ea = inspyred.ec.GA(Random())
ea.terminator = self.no_improvement_termination
final_pop = ea.evolve(generator=self.generate_population,
Expand Down Expand Up @@ -720,4 +720,4 @@ def adjrsquares(self, rsquared, obs):
def chisquared(self, actual, observed):
actual = np.array(actual)
observed = np.array(observed)
return np.sum( np.abs( np.power( (observed-actual) ,2)/actual ) )
return np.sum( np.abs( np.power( (observed-actual) ,2)/actual ) )

0 comments on commit 718efca

Please sign in to comment.