Skip to content

Commit

Permalink
improve help in tidy_restarts.py and set default k=1
Browse files Browse the repository at this point in the history
  • Loading branch information
aekiss committed Jun 18, 2020
1 parent dc3d11a commit 79493a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tidy_restarts.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
Tidy up restart directories - see argparse desciption below.
Tidy up restart directories - see argparse description below.
This is best used with restart_freq: 1 in config.yaml.
Expand All @@ -14,7 +14,7 @@
import sys
from glob import glob

def tidy(yearskip=1, keeplast=6):
def tidy(yearskip=1, keeplast=1):
yearskip = abs(yearskip)
keeplast = max(1, abs(keeplast)) # always keep the last restart
restarts = glob('archive/restart???')
Expand Down Expand Up @@ -61,10 +61,10 @@ def tidy(yearskip=1, keeplast=6):
This is best used with restart_freq: 1 in config.yaml.')
parser.add_argument('-y', '--year-skip', type=int,
metavar='n', default=1,
help="keep one restart every n years")
help="keep one restart every n years (default=1)")
parser.add_argument('-k', '--keep-last', type=int,
metavar='n', default=6,
help="keep last n restarts")
metavar='m', default=1,
help="keep last m >= 1 restarts (default=1)")
args = parser.parse_args()
yearskip = vars(args)['year_skip']
keeplast = vars(args)['keep_last']
Expand Down

0 comments on commit 79493a9

Please sign in to comment.