Skip to content

Commit

Permalink
[Fix] Fix the punctuation display problem and the path separator prob…
Browse files Browse the repository at this point in the history
…lem on Windows (#166)

* Fix punctuations

* Fix the error of path separator on Windows
  • Loading branch information
RangeKing committed Oct 21, 2022
1 parent 66ba337 commit 55557c8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion mim/click/customcommand.py
Expand Up @@ -107,7 +107,7 @@ def format_help(self, ctx: Context, formatter: HelpFormatter) -> None:
files.extend([osp.join(item[0], x) for x in item[2]])

files = [x for x in files if x.endswith('.py')]
files = [x.split(tool_root + '/')[1] for x in files]
files = [x.split(tool_root + os.sep)[1] for x in files]

if len(files):
click.echo('=' * 80)
Expand Down
4 changes: 2 additions & 2 deletions mim/commands/gridsearch.py
Expand Up @@ -68,7 +68,7 @@
'-j', '--max-jobs', type=int, help='Max parallel number', default=1)
@click.option(
'--srun-args', type=str, help='Other srun arguments that might be used')
@click.option('-y', '--yes', is_flag=True, help='Dont ask for confirmation.')
@click.option('-y', '--yes', is_flag=True, help='Don\'t ask for confirmation.')
@click.option(
'--search-args', type=str, help='Arguments for hyper parameters search')
@click.argument('other_args', nargs=-1, type=click.UNPROCESSED)
Expand Down Expand Up @@ -186,7 +186,7 @@ def gridsearch(
used, all arguments should be in a string. Defaults to None.
search_args (str, optional): Arguments for hyper parameters search, all
arguments should be in a string. Defaults to None.
yes (bool): Dont ask for confirmation. Default: True.
yes (bool): Don\'t ask for confirmation. Default: True.
other_args (tuple, optional): Other arguments, will be passed to the
codebase's training script. Defaults to ().
"""
Expand Down
4 changes: 2 additions & 2 deletions mim/commands/run.py
Expand Up @@ -26,7 +26,7 @@
cls=CustomCommand)
@click.argument('package', type=str, callback=param2lowercase)
@click.argument('command', type=str)
@click.option('-y', '--yes', is_flag=True, help='Dont ask for confirmation.')
@click.option('-y', '--yes', is_flag=True, help='Don\'t ask for confirmation.')
@click.argument('other_args', nargs=-1, type=click.UNPROCESSED)
def cli(package: str, command: str, yes: bool, other_args: tuple = ()) -> None:
"""Run arbitrary command of a codebase.
Expand Down Expand Up @@ -81,7 +81,7 @@ def run(
Args:
package (str): The codebase name.
command (str): The command name.
yes (bool): Dont ask for confirmation. Default: True.
yes (bool): Don\'t ask for confirmation. Default: True.
other_args (tuple, optional): Other arguments, will be passed to the
codebase's script. Defaults to ().
"""
Expand Down
4 changes: 2 additions & 2 deletions mim/commands/test.py
Expand Up @@ -64,7 +64,7 @@
help='The partition to use (only applicable to launcher == "slurm")')
@click.option(
'--srun-args', type=str, help='Other srun arguments that might be used')
@click.option('-y', '--yes', is_flag=True, help='Dont ask for confirmation.')
@click.option('-y', '--yes', is_flag=True, help='Don\'t ask for confirmation.')
@click.argument('other_args', nargs=-1, type=click.UNPROCESSED)
def cli(package: str,
config: str,
Expand Down Expand Up @@ -160,7 +160,7 @@ def test(
between 20000 and 30000.
srun_args (str, optional): Other srun arguments that might be
used, all arguments should be in a string. Defaults to None.
yes (bool): Dont ask for confirmation. Default: True.
yes (bool): Don\'t ask for confirmation. Default: True.
other_args (tuple, optional): Other arguments, will be passed to the
codebase's training script. Defaults to ().
"""
Expand Down
4 changes: 2 additions & 2 deletions mim/commands/train.py
Expand Up @@ -59,7 +59,7 @@
help='The partition to use (only applicable to launcher == "slurm")')
@click.option(
'--srun-args', type=str, help='Other srun arguments that might be used')
@click.option('-y', '--yes', is_flag=True, help='Dont ask for confirmation.')
@click.option('-y', '--yes', is_flag=True, help='Don\'t ask for confirmation.')
@click.argument('other_args', nargs=-1, type=click.UNPROCESSED)
def cli(package: str,
config: str,
Expand Down Expand Up @@ -147,7 +147,7 @@ def train(
between 20000 and 30000.
srun_args (str, optional): Other srun arguments that might be
used, all arguments should be in a string. Defaults to None.
yes (bool): Dont ask for confirmation. Default: True.
yes (bool): Don\'t ask for confirmation. Default: True.
other_args (tuple, optional): Other arguments, will be passed to the
codebase's training script. Defaults to ().
"""
Expand Down
4 changes: 2 additions & 2 deletions mim/commands/uninstall.py
Expand Up @@ -23,7 +23,7 @@
'--yes',
'confirm_yes',
is_flag=True,
help='Dont ask for confirmation of uninstall deletions.')
help='Don\'t ask for confirmation of uninstall deletions.')
@click.option(
'-r',
'--requirement',
Expand Down Expand Up @@ -61,7 +61,7 @@ def uninstall(uninstall_args: Union[str, List],
Args:
uninstall_args (str or list): A package name or a list of package names
to uninstalled. You can also put some `pip uninstal` options here.
confirm_yes (bool): Dont ask for confirmation of uninstall deletions.
confirm_yes (bool): Don\'t ask for confirmation of uninstall deletions.
Default: True.
requirements (tuple): A tuple of requirements files to uninstalled.
Expand Down

0 comments on commit 55557c8

Please sign in to comment.