Skip to content

Commit

Permalink
Codacy Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamd committed Mar 31, 2018
1 parent 6508aab commit 0456b00
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 7 additions & 5 deletions examples/runner_sample.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Usage:
# with multiprocessing:
# python runner_sample.py
# with mpi(need mpi4py pacakge):
# mpiexec -n 5 python runner_sample.py
"""
Usage:
with multiprocessing:
python runner_sample.py
with mpi(need mpi4py pacakge):
mpiexec -n 5 python runner_sample.py
"""

from maggma.stores import MemoryStore
from maggma.builder import Builder
Expand Down
4 changes: 2 additions & 2 deletions maggma/advanced_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ def update(self, docs, update_lu=True, key=None):

self.store.update(docs, update_lu=update_lu, key=key)

def ensure_index(self, key, unique=False):
def ensure_index(self, key, unique=False, **kwargs):
if key in self.aliases:
key = self.aliases
return self.store.ensure_index(key, unique)
return self.store.ensure_index(key, unique, **kwargs)

def close(self):
self.store.close()
Expand Down
4 changes: 3 additions & 1 deletion maggma/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import abc
import logging
import time
from collections import defaultdict, deque
from threading import Thread, Condition, BoundedSemaphore
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
Expand Down Expand Up @@ -225,6 +224,9 @@ def update_targets(self):


class MultiprocProcessor(BaseProcessor):
"""
Processor to run builders using python multiprocessing
"""
def __init__(self, builders, num_workers=None):
# multiprocessing only if mpi is not used, no mixing
self.num_workers = num_workers
Expand Down

0 comments on commit 0456b00

Please sign in to comment.