From 154ad1af7da97ccbb95e30f93b26b78f5df82999 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Tue, 31 Dec 2019 13:53:30 -0500 Subject: [PATCH] Add script entrypoint that uses AutoProcessor --- tracetools_analysis/setup.py | 1 + .../tracetools_analysis/scripts/auto.py | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tracetools_analysis/tracetools_analysis/scripts/auto.py diff --git a/tracetools_analysis/setup.py b/tracetools_analysis/setup.py index 840a341..390b7c1 100644 --- a/tracetools_analysis/setup.py +++ b/tracetools_analysis/setup.py @@ -43,6 +43,7 @@ setup( 'console_scripts': [ f'convert = {package_name}.convert:main', f'process = {package_name}.process:main', + f'auto = {package_name}.scripts.auto:main', f'cb_durations = {package_name}.scripts.cb_durations:main', f'memory_usage = {package_name}.scripts.memory_usage:main', ], diff --git a/tracetools_analysis/tracetools_analysis/scripts/auto.py b/tracetools_analysis/tracetools_analysis/scripts/auto.py new file mode 100644 index 0000000..797c465 --- /dev/null +++ b/tracetools_analysis/tracetools_analysis/scripts/auto.py @@ -0,0 +1,25 @@ +# Copyright 2019 Apex.AI, Inc. +# +# 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 tracetools_analysis.loading import load_file +from tracetools_analysis.processor import AutoProcessor + +from . import get_input_path + + +def main(): + input_path = get_input_path() + + events = load_file(input_path) + processor = AutoProcessor(events)