Skip to content

Commit

Permalink
linted ==, imports, filename input
Browse files Browse the repository at this point in the history
  • Loading branch information
DarnellGranberry committed Nov 12, 2024
1 parent 3417f45 commit f139fb1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion topaz/denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def denoise_tomogram(path:str, model:Denoise3D, outdir:str=None, suffix:str='',
## save the denoised tomogram
if outdir is None:
# write denoised tomogram to same location as input, but add the suffix
if suffix is '': # use default
if suffix == '': # use default
suffix = '.denoised'
no_ext,ext = os.path.splitext(path)
outpath = no_ext + suffix + ext
Expand Down
3 changes: 3 additions & 0 deletions topaz/denoising/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import sys
import torch
from torch import nn

# this seems unnecessary
def set_device(model, device, log=sys.stderr):
Expand Down
6 changes: 3 additions & 3 deletions topaz/utils/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ def split_particle_file(input_file, format, suffix, threshold, output_dir):
except UnknownFormatError as e:
print('Error: unrecognized input coordinates file extension ('+e.ext+')', file=sys.stderr)
sys.exit(1)
_,ext = os.path.splitext(path)
_,ext = os.path.splitext(input_file)

if format == 'star':
with open(path, 'r') as f:
with open(input_file, 'r') as f:
table = star.parse(f)
# apply score threshold
if star.SCORE_COLUMN_NAME in table.columns:
Expand All @@ -320,7 +320,7 @@ def split_particle_file(input_file, format, suffix, threshold, output_dir):
with open(path, 'w') as f:
star.write(group, f)
else: # format is coordinate table
table = pd.read_csv(path, sep='\t')
table = pd.read_csv(input_file, sep='\t')
if 'score' in table.columns:
table = table.loc[table['score'] >= threshold]
# write per micrograph files
Expand Down

0 comments on commit f139fb1

Please sign in to comment.