From 526aeab1f3334b83137e0b1db8ef1c25d374f187 Mon Sep 17 00:00:00 2001 From: Alistair Pirrie Date: Thu, 19 Dec 2024 14:57:40 +0000 Subject: [PATCH 1/5] #2831 Reorder arguments to parser for consistency --- src/psyclone/generator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/psyclone/generator.py b/src/psyclone/generator.py index ee16b38ead..ddb461520d 100644 --- a/src/psyclone/generator.py +++ b/src/psyclone/generator.py @@ -426,11 +426,11 @@ def main(arguments): # Common options parser.add_argument('filename', help='input source code') parser.add_argument( - '--version', '-v', action='version', + '-v', '--version', action='version', version=f'PSyclone version: {__VERSION__}', help='display version information') - parser.add_argument("--config", "-c", help="config file with " - "PSyclone specific options") + parser.add_argument('-c', '--config', help='config file with ' + 'PSyclone specific options') parser.add_argument('-s', '--script', help='filename of a PSyclone' ' optimisation recipe') parser.add_argument( @@ -444,7 +444,7 @@ def main(arguments): 'output Fortran. Use \'output\' to apply line-length limit to output ' 'Fortran only.') parser.add_argument( - '--profile', '-p', action="append", choices=Profiler.SUPPORTED_OPTIONS, + '-p', '--profile', action="append", choices=Profiler.SUPPORTED_OPTIONS, help="add profiling hooks for 'kernels', 'invokes' or 'routines'") parser.add_argument( '--backend', dest='backend', From cbda9f751b7f2fca0f88bd8843a40a8781b75fe9 Mon Sep 17 00:00:00 2001 From: Alistair Pirrie Date: Tue, 7 Jan 2025 11:39:53 +0000 Subject: [PATCH 2/5] #2831: Updated header and reformatted line to comply with PEP8 --- src/psyclone/generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/psyclone/generator.py b/src/psyclone/generator.py index e945d64ab0..b54268dd34 100644 --- a/src/psyclone/generator.py +++ b/src/psyclone/generator.py @@ -1,7 +1,7 @@ # ----------------------------------------------------------------------------- # BSD 3-Clause License # -# Copyright (c) 2017-2024, Science and Technology Facilities Council. +# Copyright (c) 2017-2025, Science and Technology Facilities Council. # All rights reserved. # # Redistribution and use in source and binary forms, with or without From b5d117060496c2aa90dbeb134cbbdf031171ae3b Mon Sep 17 00:00:00 2001 From: Alistair Pirrie Date: Tue, 7 Jan 2025 11:44:57 +0000 Subject: [PATCH 3/5] #2831: Updated author names and adjusted text for PEP8 compliance --- src/psyclone/generator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/psyclone/generator.py b/src/psyclone/generator.py index b54268dd34..bfa9f1d948 100644 --- a/src/psyclone/generator.py +++ b/src/psyclone/generator.py @@ -32,7 +32,7 @@ # POSSIBILITY OF SUCH DAMAGE. # ----------------------------------------------------------------------------- # Authors: R. W. Ford, A. R. Porter and N. Nobre, STFC Daresbury Lab -# Modified A. J. Voysey, Met Office +# Modified A. J. Voysey and A. R. Pirrie, Met Office # Modified J. Henrichs, Bureau of Meteorology ''' @@ -439,10 +439,10 @@ def main(arguments): parser.add_argument( '-l', '--limit', dest='limit', default='off', choices=['off', 'all', 'output'], - help='limit the Fortran line length to 132 characters (default ' - '\'%(default)s\'). Use \'all\' to apply limit to both input and ' - 'output Fortran. Use \'output\' to apply line-length limit to output ' - 'Fortran only.') + help="limit the Fortran line length to 132 characters (default " + "'%(default)s'). Use 'all' to apply limit to both input and " + "output Fortran. Use 'output' to apply line-length limit to output " + "Fortran only.") parser.add_argument( '-p', '--profile', action="append", choices=Profiler.SUPPORTED_OPTIONS, help="add profiling hooks for 'kernels', 'invokes' or 'routines'") From 1e06054651b1825af069613c981c94878fba296e Mon Sep 17 00:00:00 2001 From: Alistair Pirrie Date: Tue, 7 Jan 2025 16:05:15 +0000 Subject: [PATCH 4/5] #2831: Correct author ordering --- src/psyclone/generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/psyclone/generator.py b/src/psyclone/generator.py index bfa9f1d948..f4e3583fc8 100644 --- a/src/psyclone/generator.py +++ b/src/psyclone/generator.py @@ -32,8 +32,9 @@ # POSSIBILITY OF SUCH DAMAGE. # ----------------------------------------------------------------------------- # Authors: R. W. Ford, A. R. Porter and N. Nobre, STFC Daresbury Lab -# Modified A. J. Voysey and A. R. Pirrie, Met Office +# Modified A. J. Voysey, Met Office # Modified J. Henrichs, Bureau of Meteorology +# Modified A. R. Pirrie, Met Office ''' This module provides the PSyclone 'main' routine which is intended From 1355d6642e8a346c3c5711ef8eb028038e3d09ad Mon Sep 17 00:00:00 2001 From: Aidan Chalk <3043914+LonelyCat124@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:54:30 +0000 Subject: [PATCH 5/5] #2831 update changelog --- changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/changelog b/changelog index 844f8bed61..33db29bebe 100644 --- a/changelog +++ b/changelog @@ -21,6 +21,9 @@ 7) PR #2840 for #2839. Raise error in FortranReader if ignore_directives is True but ignore_comments is True. + 8) PR #2832 for #2831. Reorders the arguments to the parser to meet best + practices. + release 3.0.0 6th of December 2024 1) PR #2477 for #2463. Add support for Fortran Namelist statements.