diff --git a/ImageD11/grain.py b/ImageD11/grain.py index 3ea6b52c..9d1592d2 100644 --- a/ImageD11/grain.py +++ b/ImageD11/grain.py @@ -59,6 +59,7 @@ def __init__(self,ubi,translation=None, **kwds): def set_ubi(self, ubi): """ Update the orientation and clear cached values """ self.ubi = np.array(ubi,float) + assert np.linalg.det(self.ubi) >= 0, 'Left handed axis system!' self.clear_cache() def clear_cache(self): diff --git a/scripts/refine_em.py b/scripts/refine_em.py index 4b977fd9..1bc3404a 100644 --- a/scripts/refine_em.py +++ b/scripts/refine_em.py @@ -39,8 +39,12 @@ def setup(): if __name__=="__main__": cmds = setup() -# sys.exit() - p = multiprocessing.Pool( multiprocessing.cpu_count() ) + + if 'SLURM_CPUS_PER_TASK' in os.environ: + njobs = int(os.environ['SLURM_CPUS_PER_TASK']) + else: + njobs = multiprocessing.cpu_count() + p = multiprocessing.Pool( njobs ) p.map( os.system, cmds ) sys.exit() for c in cmds: diff --git a/setup.cfg b/setup.cfg index 3939c905..685039fc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [tool:pytest] -norecursedirs = ImageD11/depreciated +norecursedirs = ImageD11/depreciated .ipynb_checkpoints