From 678bf538affd9f48e5cd01a1564a9cce607f3e26 Mon Sep 17 00:00:00 2001 From: jwnorm Date: Wed, 13 Jul 2022 09:53:06 -0400 Subject: [PATCH 01/10] added gui feature --- src/hillmaker/__init__.py | 1 + src/hillmaker/gui.py | 202 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 src/hillmaker/gui.py diff --git a/src/hillmaker/__init__.py b/src/hillmaker/__init__.py index 4b4c682..c489184 100755 --- a/src/hillmaker/__init__.py +++ b/src/hillmaker/__init__.py @@ -1 +1,2 @@ from hillmaker.hills import make_hills +from hillmaker.gui import hill_gui diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py new file mode 100644 index 0000000..59bff4a --- /dev/null +++ b/src/hillmaker/gui.py @@ -0,0 +1,202 @@ +# Copyright 2022 Mark Isken, Jacob Norman +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from datetime import datetime as dt +import os +import json +from gooey import Gooey, GooeyParser +import pandas as pd +from hillmaker import make_hills + + +@Gooey(program_name='Hillmaker Occupancy Analysis', + default_size=(610, 610), + required_cols=2, + optional_cols=2, + tabbed_groups=True, + use_events='VALIDATE_FORM' + ) +def get_user_input(): + """ + Adds GUI to hillmaker function make_hills. + + Use GooeyParser to get user-defined inputs for use with the + hillmaker function make_hills. Saves the arguments in a + default json file so that the most recent selections are the + preselected values for subsequent runs. + + Returns + ---------- + args : GooeyParser + Used to retrieve user inputs. + """ + + stored_args = {} + # get the script name without the extension and use it to build up + # the json filename + script_name = os.path.splitext(os.path.basename(__file__))[0] + args_file = "{}-args.json".format(script_name) + + # read in the prior arguments as a dictionary + if os.path.isfile(args_file): + with open(args_file) as data_file: + stored_args = json.load(data_file) + + test = "user_input.lower().endswith('.csv')" + message = 'Must be .csv file' + + parser = GooeyParser(description='Computes occupancy statistics based on a list of start and stop times.') + parser.add_argument('stops_fn', + metavar='Timestamps Filename', + action='store', + default=stored_args.get('stops_fn'), + help='Select file containing start and stop times', + widget='FileChooser', + gooey_options={ + 'validator': { + 'test': test, + 'message': message + } + }) + + parser.add_argument('scenario', + metavar='Scenario', + action='store', + default=stored_args.get('scenario'), + help='Specify a scenario name for output files', + gooey_options={ + 'validator': { + 'test': 'len(user_input) > 0 ', + 'message': 'Must be a valid year in integer form' + } + }) + + parser.add_argument('in_fld_name', + metavar='In Time Field Name', + action='store', + default=stored_args.get('in_fld_name'), + help='Set the time in field name', + gooey_options={ + 'validator': { + 'test': 'len(user_input) > 0 ', + 'message': 'Must be a valid year in integer form' + } + }) + + parser.add_argument('out_fld_name', + metavar='Out Time Field Name', + action='store', + default=stored_args.get('out_fld_name'), + help='Set the time out field name', + gooey_options={ + 'validator': { + 'test': 'len(user_input) > 0 ', + 'message': 'Must be a valid year in integer form' + } + }) + + parser.add_argument('start_ts', + metavar='Start Date', + action='store', + default=stored_args.get('start_ts'), + help='Set the time out field name', + widget='DateChooser', + gooey_options={ + 'validator': { + 'test': 'int(user_input.replace("-", "")) <= ' + str(int(dt.now().strftime('%Y%m%d'))), + 'message': 'Must be a valid date up to and including today' + } + }) + + parser.add_argument('end_ts', + metavar='End Date', + action='store', + default=stored_args.get('end_ts'), + help='Set the time out field name', + widget='DateChooser', + gooey_options={ + 'validator': { + 'test': 'int(user_input.replace("-", "")) <= ' + str(int(dt.now().strftime('%Y%m%d'))), + 'message': 'Must be a valid date up to and including today' + } + }) + + parser.add_argument('-cat_fld_name', '-o', + metavar='Category', + action='store', + #default=stored_args.get('cat_fld_name'), + help='Select a category to separate analysis by' + ) + + parser.add_argument('-bin_size', + metavar='Bin Size', + action='store', + widget='Slider', + default=60, + help='The size of the time bins in minutes', + type=int, + gooey_options={'min': 0, 'max': 60} + ) + + parser.add_argument('-verbose', + metavar='Verbosity', + action='store', + widget='Slider', + default=0, + help='The higher the integer, the more verbose the output', + type=int, + gooey_options={'min': 0, 'max': 5} + ) + + parser.add_argument('-output_dir', + metavar='Output Directory', + action='store', + widget='DirChooser', + default=stored_args.get('output_dir'), + help='Select output directory to save files', + ) + + args = parser.parse_args() + # store the values of the args to be defaults on next run + with open(args_file, 'w') as data_file: + # using vars(args) returns the data as a dictionary + json.dump({i: vars(args)[i] for i in vars(args) if i != 'db_pwd'}, data_file) + return args + + +def hill_gui(): + """ + Full program for computing occupancy based on in and out timestamps. + + Extends the functionality of hillmaker to include a graphic user + interface with get_user_input to the function make_hills. Allows + business users to easily run occupancy statistics and outputs files + + Returns + ------- + hm_dict : dictionary + Dictionary of hillmaker dataframes. + """ + # launch gui and get user input + inputs = get_user_input() + + # read in csv file and convert in and out cols to datetime + stops_df = pd.read_csv(inputs.stops_fn, parse_dates=[inputs.in_fld_name, inputs.out_fld_name]) + + # run occupancy analysis + hm_dict = make_hills(inputs.scenario, stops_df, inputs.in_fld_name, + inputs.out_fld_name, inputs.start_ts, inputs.end_ts, cat_field=inputs.cat_fld_name, + bin_size_minutes=inputs.bin_size, export_path=inputs.output_dir, verbose=inputs.verbose) + + return hm_dict From 3dc1bc779ce225bee887602c6158dc0850f56e81 Mon Sep 17 00:00:00 2001 From: jwnorm Date: Wed, 13 Jul 2022 11:18:21 -0400 Subject: [PATCH 02/10] replaced str.format() with new f-strings --- src/hillmaker/gui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py index 59bff4a..f9afa81 100644 --- a/src/hillmaker/gui.py +++ b/src/hillmaker/gui.py @@ -46,7 +46,7 @@ def get_user_input(): # get the script name without the extension and use it to build up # the json filename script_name = os.path.splitext(os.path.basename(__file__))[0] - args_file = "{}-args.json".format(script_name) + args_file = 'f{script_name}-args.json' # read in the prior arguments as a dictionary if os.path.isfile(args_file): @@ -55,6 +55,7 @@ def get_user_input(): test = "user_input.lower().endswith('.csv')" message = 'Must be .csv file' + today = str(int(dt.now().strftime('%Y%m%d'))) parser = GooeyParser(description='Computes occupancy statistics based on a list of start and stop times.') parser.add_argument('stops_fn', @@ -114,7 +115,7 @@ def get_user_input(): widget='DateChooser', gooey_options={ 'validator': { - 'test': 'int(user_input.replace("-", "")) <= ' + str(int(dt.now().strftime('%Y%m%d'))), + 'test': 'int(user_input.replace("-", "")) <= ' + today, 'message': 'Must be a valid date up to and including today' } }) @@ -127,7 +128,7 @@ def get_user_input(): widget='DateChooser', gooey_options={ 'validator': { - 'test': 'int(user_input.replace("-", "")) <= ' + str(int(dt.now().strftime('%Y%m%d'))), + 'test': 'int(user_input.replace("-", "")) <= ' + today, 'message': 'Must be a valid date up to and including today' } }) From 9b987842b3723fea53f98ad42ca449c0f842f125 Mon Sep 17 00:00:00 2001 From: jwnorm Date: Wed, 13 Jul 2022 12:01:46 -0400 Subject: [PATCH 03/10] fixed f-string --- src/hillmaker/gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py index f9afa81..57d7851 100644 --- a/src/hillmaker/gui.py +++ b/src/hillmaker/gui.py @@ -46,7 +46,7 @@ def get_user_input(): # get the script name without the extension and use it to build up # the json filename script_name = os.path.splitext(os.path.basename(__file__))[0] - args_file = 'f{script_name}-args.json' + args_file = f'{script_name}-args.json' # read in the prior arguments as a dictionary if os.path.isfile(args_file): From c0dd8eee73eec493fc627259b7fcd3ed98899058 Mon Sep 17 00:00:00 2001 From: jwnorm Date: Fri, 22 Jul 2022 11:42:34 -0400 Subject: [PATCH 04/10] adjusting so gui will run in command line with program name --- src/hillmaker/__init__.py | 1 - src/hillmaker/gui.py | 86 +++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 46 deletions(-) diff --git a/src/hillmaker/__init__.py b/src/hillmaker/__init__.py index c489184..4b4c682 100755 --- a/src/hillmaker/__init__.py +++ b/src/hillmaker/__init__.py @@ -1,2 +1 @@ from hillmaker.hills import make_hills -from hillmaker.gui import hill_gui diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py index 57d7851..d82e6fa 100644 --- a/src/hillmaker/gui.py +++ b/src/hillmaker/gui.py @@ -14,20 +14,21 @@ from datetime import datetime as dt import os +import sys import json from gooey import Gooey, GooeyParser import pandas as pd from hillmaker import make_hills -@Gooey(program_name='Hillmaker Occupancy Analysis', +@Gooey(program_name='hill_gui', default_size=(610, 610), required_cols=2, optional_cols=2, tabbed_groups=True, use_events='VALIDATE_FORM' ) -def get_user_input(): +def get_user_input(argv=None): """ Adds GUI to hillmaker function make_hills. @@ -58,18 +59,6 @@ def get_user_input(): today = str(int(dt.now().strftime('%Y%m%d'))) parser = GooeyParser(description='Computes occupancy statistics based on a list of start and stop times.') - parser.add_argument('stops_fn', - metavar='Timestamps Filename', - action='store', - default=stored_args.get('stops_fn'), - help='Select file containing start and stop times', - widget='FileChooser', - gooey_options={ - 'validator': { - 'test': test, - 'message': message - } - }) parser.add_argument('scenario', metavar='Scenario', @@ -83,7 +72,20 @@ def get_user_input(): } }) - parser.add_argument('in_fld_name', + parser.add_argument('stop_data_csv', + metavar='Timestamps Filename', + action='store', + default=stored_args.get('stops_fn'), + help='Select file containing start and stop times', + widget='FileChooser', + gooey_options={ + 'validator': { + 'test': test, + 'message': message + } + }) + + parser.add_argument('in_field', metavar='In Time Field Name', action='store', default=stored_args.get('in_fld_name'), @@ -95,7 +97,7 @@ def get_user_input(): } }) - parser.add_argument('out_fld_name', + parser.add_argument('out_field', metavar='Out Time Field Name', action='store', default=stored_args.get('out_fld_name'), @@ -107,7 +109,7 @@ def get_user_input(): } }) - parser.add_argument('start_ts', + parser.add_argument('start_analysis_dt', metavar='Start Date', action='store', default=stored_args.get('start_ts'), @@ -120,7 +122,7 @@ def get_user_input(): } }) - parser.add_argument('end_ts', + parser.add_argument('end_analysis_dt', metavar='End Date', action='store', default=stored_args.get('end_ts'), @@ -133,14 +135,14 @@ def get_user_input(): } }) - parser.add_argument('-cat_fld_name', '-o', + parser.add_argument('--cat_field', '-o', metavar='Category', action='store', #default=stored_args.get('cat_fld_name'), help='Select a category to separate analysis by' ) - parser.add_argument('-bin_size', + parser.add_argument('--bin_size_mins', metavar='Bin Size', action='store', widget='Slider', @@ -150,7 +152,15 @@ def get_user_input(): gooey_options={'min': 0, 'max': 60} ) - parser.add_argument('-verbose', + parser.add_argument('--output_path', + metavar='Output Directory', + action='store', + widget='DirChooser', + default=stored_args.get('output_dir'), + help='Select output directory to save files', + ) + + parser.add_argument('--verbose', metavar='Verbosity', action='store', widget='Slider', @@ -160,14 +170,6 @@ def get_user_input(): gooey_options={'min': 0, 'max': 5} ) - parser.add_argument('-output_dir', - metavar='Output Directory', - action='store', - widget='DirChooser', - default=stored_args.get('output_dir'), - help='Select output directory to save files', - ) - args = parser.parse_args() # store the values of the args to be defaults on next run with open(args_file, 'w') as data_file: @@ -176,28 +178,22 @@ def get_user_input(): return args -def hill_gui(): +def main(argv=None): """ - Full program for computing occupancy based on in and out timestamps. - - Extends the functionality of hillmaker to include a graphic user - interface with get_user_input to the function make_hills. Allows - business users to easily run occupancy statistics and outputs files - - Returns - ------- - hm_dict : dictionary - Dictionary of hillmaker dataframes. + :param argv: Input arguments + :return: No return value """ # launch gui and get user input inputs = get_user_input() # read in csv file and convert in and out cols to datetime - stops_df = pd.read_csv(inputs.stops_fn, parse_dates=[inputs.in_fld_name, inputs.out_fld_name]) + stops_df = pd.read_csv(inputs.stop_data_csv, parse_dates=[inputs.in_field, inputs.out_field]) # run occupancy analysis - hm_dict = make_hills(inputs.scenario, stops_df, inputs.in_fld_name, - inputs.out_fld_name, inputs.start_ts, inputs.end_ts, cat_field=inputs.cat_fld_name, - bin_size_minutes=inputs.bin_size, export_path=inputs.output_dir, verbose=inputs.verbose) + dfs = make_hills(inputs.scenario, stops_df, inputs.in_field, inputs.out_field, + inputs.start_analysis_dt, inputs.end_analysis_dt, cat_field=inputs.cat_field, + bin_size_minutes=inputs.bin_size_mins, export_path=inputs.output_path, verbose=inputs.verbose) + - return hm_dict +if __name__ == '__main__': + sys.exit(main()) From 5013741a745a4090d99f4eaa14ff13bd2ece009c Mon Sep 17 00:00:00 2001 From: jwnorm Date: Fri, 22 Jul 2022 12:05:57 -0400 Subject: [PATCH 05/10] added gui to console script --- setup.py | 2 +- src/hillmaker/gui.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a7880e0..4a5166a 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ 'Topic :: Scientific/Engineering :: Information Analysis', ], entry_points={ - 'console_scripts': ['hillmaker=hillmaker.hills:main'], + 'console_scripts': ['hillmaker=hillmaker.hills:main', 'hill_gui=hillmaker.gui:main'], }, project_urls={ 'Source': 'http://github.com/misken/hillmaker', diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py index d82e6fa..1c1911e 100644 --- a/src/hillmaker/gui.py +++ b/src/hillmaker/gui.py @@ -21,7 +21,7 @@ from hillmaker import make_hills -@Gooey(program_name='hill_gui', +@Gooey(program_name='Hillmaker Occupancy Analysis', default_size=(610, 610), required_cols=2, optional_cols=2, From 7cc836f9c43a5b833c5af8b8883c01c584bf0ff8 Mon Sep 17 00:00:00 2001 From: jwnorm Date: Fri, 22 Jul 2022 12:11:42 -0400 Subject: [PATCH 06/10] aligned make_hills functions --- src/hillmaker/gui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py index 1c1911e..0e2706d 100644 --- a/src/hillmaker/gui.py +++ b/src/hillmaker/gui.py @@ -135,7 +135,7 @@ def get_user_input(argv=None): } }) - parser.add_argument('--cat_field', '-o', + parser.add_argument('--cat_field', metavar='Category', action='store', #default=stored_args.get('cat_fld_name'), @@ -160,7 +160,7 @@ def get_user_input(argv=None): help='Select output directory to save files', ) - parser.add_argument('--verbose', + parser.add_argument('--verbosity', metavar='Verbosity', action='store', widget='Slider', @@ -192,7 +192,7 @@ def main(argv=None): # run occupancy analysis dfs = make_hills(inputs.scenario, stops_df, inputs.in_field, inputs.out_field, inputs.start_analysis_dt, inputs.end_analysis_dt, cat_field=inputs.cat_field, - bin_size_minutes=inputs.bin_size_mins, export_path=inputs.output_path, verbose=inputs.verbose) + bin_size_minutes=inputs.bin_size_mins, export_path=inputs.output_path, verbosity=inputs.verbosity) if __name__ == '__main__': From 3f601dc78dfcadb2b45ab612140c480b55836ad8 Mon Sep 17 00:00:00 2001 From: jwnorm Date: Fri, 22 Jul 2022 14:23:15 -0400 Subject: [PATCH 07/10] updated gui to integrate better with CLI --- setup.py | 3 ++- src/hillmaker/gui.py | 14 +++----------- src/hillmaker/hills.py | 12 ++++++------ 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index 4a5166a..ec2f459 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,8 @@ 'Topic :: Scientific/Engineering :: Information Analysis', ], entry_points={ - 'console_scripts': ['hillmaker=hillmaker.hills:main', 'hill_gui=hillmaker.gui:main'], + 'console_scripts': + ['hillmaker=hillmaker.hills:main', 'hill_gui=hillmaker.gui:main'], }, project_urls={ 'Source': 'http://github.com/misken/hillmaker', diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py index 0e2706d..3dc463c 100644 --- a/src/hillmaker/gui.py +++ b/src/hillmaker/gui.py @@ -17,11 +17,10 @@ import sys import json from gooey import Gooey, GooeyParser -import pandas as pd -from hillmaker import make_hills @Gooey(program_name='Hillmaker Occupancy Analysis', + target='hillmaker.exe', default_size=(610, 610), required_cols=2, optional_cols=2, @@ -101,6 +100,7 @@ def get_user_input(argv=None): metavar='Out Time Field Name', action='store', default=stored_args.get('out_fld_name'), + required=True, help='Set the time out field name', gooey_options={ 'validator': { @@ -135,7 +135,7 @@ def get_user_input(argv=None): } }) - parser.add_argument('--cat_field', + parser.add_argument('--cat_field', metavar='Category', action='store', #default=stored_args.get('cat_fld_name'), @@ -186,14 +186,6 @@ def main(argv=None): # launch gui and get user input inputs = get_user_input() - # read in csv file and convert in and out cols to datetime - stops_df = pd.read_csv(inputs.stop_data_csv, parse_dates=[inputs.in_field, inputs.out_field]) - - # run occupancy analysis - dfs = make_hills(inputs.scenario, stops_df, inputs.in_field, inputs.out_field, - inputs.start_analysis_dt, inputs.end_analysis_dt, cat_field=inputs.cat_field, - bin_size_minutes=inputs.bin_size_mins, export_path=inputs.output_path, verbosity=inputs.verbosity) - if __name__ == '__main__': sys.exit(main()) diff --git a/src/hillmaker/hills.py b/src/hillmaker/hills.py index a9cd330..9e281c0 100755 --- a/src/hillmaker/hills.py +++ b/src/hillmaker/hills.py @@ -391,32 +391,32 @@ def process_command_line(argv=None): # Add arguments required.add_argument( - '--scenario', type=str, + 'scenario', type=str, help="Used in output filenames" ) required.add_argument( - '--stop_data_csv', type=str, + 'stop_data_csv', type=str, help="Path to csv file containing the stop data to be processed" ) required.add_argument( - '--in_field', type=str, + 'in_field', type=str, help="Column name corresponding to the arrival times" ) required.add_argument( - '--out_field', type=str, + 'out_field', type=str, help="Column name corresponding to the departure times" ) required.add_argument( - '--start_analysis_dt', type=str, + 'start_analysis_dt', type=str, help="Starting datetime for the analysis (must be convertible to pandas Timestamp)" ) required.add_argument( - '--end_analysis_dt', type=str, + 'end_analysis_dt', type=str, help="Ending datetime for the analysis (must be convertible to pandas Timestamp)" ) From dade9fbe6164e1694e874fbba5bda68d24095e1a Mon Sep 17 00:00:00 2001 From: jwnorm Date: Fri, 22 Jul 2022 14:26:27 -0400 Subject: [PATCH 08/10] removed invalid keyword argument --- src/hillmaker/gui.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py index 3dc463c..ce17544 100644 --- a/src/hillmaker/gui.py +++ b/src/hillmaker/gui.py @@ -100,7 +100,6 @@ def get_user_input(argv=None): metavar='Out Time Field Name', action='store', default=stored_args.get('out_fld_name'), - required=True, help='Set the time out field name', gooey_options={ 'validator': { From 4de351bc3ef87a7bc5366c4fc67592182aca8e6a Mon Sep 17 00:00:00 2001 From: jwnorm Date: Fri, 22 Jul 2022 14:39:25 -0400 Subject: [PATCH 09/10] fixed issue with .exe file --- src/hillmaker/gui.py | 16 ++-------------- src/hillmaker/hills.py | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/hillmaker/gui.py b/src/hillmaker/gui.py index ce17544..24a4c05 100644 --- a/src/hillmaker/gui.py +++ b/src/hillmaker/gui.py @@ -1,16 +1,4 @@ # Copyright 2022 Mark Isken, Jacob Norman -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. from datetime import datetime as dt import os @@ -164,9 +152,9 @@ def get_user_input(argv=None): action='store', widget='Slider', default=0, - help='The higher the integer, the more verbose the output', + help='0=logging.WARNING, 1=logging.INFO, 2=logging.DEBUG', type=int, - gooey_options={'min': 0, 'max': 5} + gooey_options={'min': 0, 'max': 2} ) args = parser.parse_args() diff --git a/src/hillmaker/hills.py b/src/hillmaker/hills.py index 9e281c0..b73fba4 100755 --- a/src/hillmaker/hills.py +++ b/src/hillmaker/hills.py @@ -1,18 +1,6 @@ """Hillmaker""" -# Copyright 2015, 2022 Mark Isken, Jacob Norman -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Copyright 2022 Mark Isken, Jacob Norman import sys from pathlib import Path @@ -489,7 +477,7 @@ def process_command_line(argv=None): # Do the parsing and return the populated namespace with the input arg values # If argv == None, then ``parse_args`` will use ``sys.argv[1:]``. - args = parser.parse_args(argv) + args, unknown = parser.parse_known_args(argv) return args def update_args(args, toml_config): From 0ab6b1078d34042784e1ba7295ad383e0d7f6f48 Mon Sep 17 00:00:00 2001 From: jwnorm Date: Fri, 22 Jul 2022 14:46:34 -0400 Subject: [PATCH 10/10] changed license from Apache to MIT --- src/hillmaker/plotting.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/hillmaker/plotting.py b/src/hillmaker/plotting.py index 03f1f15..be3b049 100644 --- a/src/hillmaker/plotting.py +++ b/src/hillmaker/plotting.py @@ -1,16 +1,4 @@ # Copyright 2022 Mark Isken, Jacob Norman -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import pandas as pd import matplotlib.pyplot as plt