Skip to content

Commit dbc4b99

Browse files
committed
refactor: move pickle import to main function and add conditional subsampling
1 parent a291326 commit dbc4b99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nanoplot/NanoPlot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def main():
3232
from nanoplot.filteroptions import filter_and_transform_data
3333
from nanoplotter.plot import Plot
3434
utils.make_output_dir(args.outdir)
35+
import pickle
3536
utils.init_logs(args)
3637
# args.format = nanoplotter.check_valid_format(args.format)
3738
if args.pickle:
38-
import pickle
3939
datadf = pickle.load(open(args.pickle, "rb"))
4040
elif args.feather:
4141
from nanoget import combine_dfs
@@ -157,7 +157,7 @@ def make_plots(datadf, settings):
157157
plotdict_legacy = {}
158158
plots = []
159159

160-
subdf = utils.subsample_datasets(datadf)
160+
subdf = utils.subsample_datasets(datadf) if "start_time" in datadf else None
161161
if settings["N50"]:
162162
n50 = nanomath.get_N50(np.sort(datadf["lengths"]))
163163
else:

0 commit comments

Comments
 (0)