Skip to content

Commit

Permalink
fixed some PEP8 things
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelelim committed Nov 9, 2023
1 parent aa5ca3b commit 4f16526
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
11 changes: 7 additions & 4 deletions hexrd/nf_config/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def comp_thresh(self):
elif np.logical_and(temp <= 1.0, temp > 0.0):
return temp
else:
raise RuntimeError('comp_thresh must be None or a number between 0 and 1')
raise RuntimeError(
'comp_thresh must be None or a number between 0 and 1')

@property
def chi2_thresh(self):
Expand All @@ -47,14 +48,16 @@ def chi2_thresh(self):
elif np.logical_and(temp <= 1.0, temp > 0.0):
return temp
else:
raise RuntimeError('chi2_thresh must be None or a number between 0 and 1')
raise RuntimeError(
'chi2_thresh must be None or a number between 0 and 1')

@property
def misorientation(self):
key = self._cfg.get('experiment:misorientation:use_misorientation', False)
key = self._cfg.get(
'experiment:misorientation:use_misorientation', False)
if key is True:
parms = dict(misorientation_bnd=self.get('experiment:misorientation:bnd', 0.0),
misorientation_spacing=self.get('experiment:misorientation:spacing', 0.25))
misorientation_spacing=self.get('experiment:misorientation:spacing', 0.25))
return parms
else:
return
1 change: 1 addition & 0 deletions hexrd/nf_config/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'gaussian': dict(sigma=2.0, size=3.0),
'dilations_only': dict(num_erosions=2, num_dilations=3)}


class ImagesConfig(Config):

@property
Expand Down
8 changes: 4 additions & 4 deletions hexrd/nf_config/multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def num_cpus(self):
logger.warning(
'Requested %s processes, %d available',
multiproc, ncpus
)
)
res = ncpus
else:
res = multiproc if multiproc else 1
Expand All @@ -37,7 +37,7 @@ def num_cpus(self):
logger.warning(
'Cannot use less than 1 process, requested %d of %d',
temp, ncpus
)
)
res = 1
else:
res = temp
Expand All @@ -46,7 +46,7 @@ def num_cpus(self):
logger.warning(
"Invalid value %s for multiprocessing",
multiproc
)
)
res = temp
return res

Expand All @@ -60,7 +60,7 @@ def num_cpus(self, val):
raise RuntimeError(
'"num_cpus": must be 1:%d, got %s'
% (mp.cpu_count(), val)
)
)

@property
def check(self):
Expand Down
10 changes: 5 additions & 5 deletions hexrd/nf_config/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ class ReconstructionConfig(Config):
def tomography(self):
key = self._cfg.get('NF_reconstruction:tomography:use_mask', False)
if key is True:
parms = dict(use_mask = True,
mask_data_file='NF_reconstruction:tomography:mask_data_file',
mask_vert_offset='NF_reconstruction:tomography:mask_vert_offset',
project_single_layer = 'NF_reconstruction:tomography:project_single_layer')
parms = dict(use_mask=True,
mask_data_file='NF_reconstruction:tomography:mask_data_file',
mask_vert_offset='NF_reconstruction:tomography:mask_vert_offset',
project_single_layer='NF_reconstruction:tomography:project_single_layer')
return parms
else:
return
Expand All @@ -30,7 +30,7 @@ def voxel_spacing(self):

@property
def v_bnds(self):
return self._cfg.get('NF_reconstruction:v_bnds',[0.0,0.0])
return self._cfg.get('NF_reconstruction:v_bnds', [0.0, 0.0])

@property
def beam_stop_y_cen(self):
Expand Down

0 comments on commit 4f16526

Please sign in to comment.