From 2ae8c6073fb95e92780630512ffedf049e17566c Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Thu, 14 Jan 2016 12:05:49 +0000 Subject: [PATCH 1/2] doc: Apply it's/its grammar pedantry --- doc/source/additional_topics.rst | 4 ++-- doc/source/device_setup.rst | 2 +- doc/source/writing_extensions.rst | 2 +- wlauto/core/configuration.py | 2 +- wlauto/core/device.py | 2 +- wlauto/core/execution.py | 2 +- wlauto/core/extension.py | 6 +++--- wlauto/core/resource.py | 2 +- wlauto/utils/trace_cmd.py | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/source/additional_topics.rst b/doc/source/additional_topics.rst index 520b3170..8a49a93a 100644 --- a/doc/source/additional_topics.rst +++ b/doc/source/additional_topics.rst @@ -6,10 +6,10 @@ Modules Modules are essentially plug-ins for Extensions. They provide a way of defining common and reusable functionality. An Extension can load zero or more modules -during it's creation. Loaded modules will then add their capabilities (see +during its creation. Loaded modules will then add their capabilities (see Capabilities_) to those of the Extension. When calling code tries to access an attribute of an Extension the Extension doesn't have, it will try to find the -attribute among it's loaded modules and will return that instead. +attribute among its loaded modules and will return that instead. .. note:: Modules are themselves extensions, and can therefore load their own modules. *Do not* abuse this. diff --git a/doc/source/device_setup.rst b/doc/source/device_setup.rst index 73c25c81..9c5b867b 100644 --- a/doc/source/device_setup.rst +++ b/doc/source/device_setup.rst @@ -64,7 +64,7 @@ you might want to change are outlined below. advanced WA functionality (like setting of core-related runtime parameters such as governors, frequencies, etc). ``core_names`` should be a list of core names matching the order in which they are exposed in sysfs. For - example, ARM TC2 SoC is a 2x3 big.LITTLE system; it's core_names would be + example, ARM TC2 SoC is a 2x3 big.LITTLE system; its core_names would be ``['a7', 'a7', 'a7', 'a15', 'a15']``, indicating that cpu0-cpu2 in cpufreq sysfs structure are A7's and cpu3 and cpu4 are A15's. diff --git a/doc/source/writing_extensions.rst b/doc/source/writing_extensions.rst index a43e93c0..15fa6713 100644 --- a/doc/source/writing_extensions.rst +++ b/doc/source/writing_extensions.rst @@ -11,7 +11,7 @@ interesting of these are can be benchmarks, high-level use cases, or pretty much anything else. :devices: These are interfaces to the physical devices (development boards or end-user devices, such as smartphones) that use cases run on. Typically each model of a - physical device would require it's own interface class (though some functionality + physical device would require its own interface class (though some functionality may be reused by subclassing from an existing base). :instruments: Instruments allow collecting additional data from workload execution (e.g. system traces). Instruments are not specific to a particular Workload. Instruments diff --git a/wlauto/core/configuration.py b/wlauto/core/configuration.py index 0a981938..5adbea0a 100644 --- a/wlauto/core/configuration.py +++ b/wlauto/core/configuration.py @@ -425,7 +425,7 @@ class RunConfiguration(object): is validated (to make sure there are no missing settings, etc). - Extensions are loaded through the run config object, which instantiates them with appropriate parameters based on the "raw" config collected earlier. When an - Extension is instantiated in such a way, it's config is "officially" added to run configuration + Extension is instantiated in such a way, its config is "officially" added to run configuration tracked by the run config object. Raw config is discarded at the end of the run, so that any config that wasn't loaded in this way is not recoded (as it was not actually used). - Extension parameters a validated individually (for type, value ranges, etc) as they are diff --git a/wlauto/core/device.py b/wlauto/core/device.py index 9e870b53..18ae643e 100644 --- a/wlauto/core/device.py +++ b/wlauto/core/device.py @@ -174,7 +174,7 @@ class Device(Extension): description=""" This is a list indicating the cluster affinity of the CPU cores, each element correponding to the cluster ID of the core coresponding - to it's index. E.g. ``[0, 0, 1]`` indicates that cpu0 and cpu1 are on + to its index. E.g. ``[0, 0, 1]`` indicates that cpu0 and cpu1 are on cluster 0, while cpu2 is on cluster 1. If this is not specified, this will be inferred from ``core_names`` if possible (assuming all cores with the same name are on the same cluster). diff --git a/wlauto/core/execution.py b/wlauto/core/execution.py index 0071054c..4424e126 100644 --- a/wlauto/core/execution.py +++ b/wlauto/core/execution.py @@ -72,7 +72,7 @@ REBOOT_DELAY = 3 class RunInfo(object): """ - Information about the current run, such as it's unique ID, run + Information about the current run, such as its unique ID, run time, etc. """ diff --git a/wlauto/core/extension.py b/wlauto/core/extension.py index 6370a103..3aed90dc 100644 --- a/wlauto/core/extension.py +++ b/wlauto/core/extension.py @@ -303,7 +303,7 @@ class Artifact(object): network filer archiver may choose to archive them). .. note: The kind parameter is intended to represent the logical function of a particular - artifact, not it's intended means of processing -- this is left entirely up to the + artifact, not its intended means of processing -- this is left entirely up to the result processors. """ @@ -406,7 +406,7 @@ class ExtensionMeta(type): def _propagate_attributes(mcs, bases, attrs): """ For attributes specified by to_propagate, their values will be a union of - that specified for cls and it's bases (cls values overriding those of bases + that specified for cls and its bases (cls values overriding those of bases in case of conflicts). """ @@ -665,7 +665,7 @@ class Module(Extension): In other words, a Module is roughly equivalent to a kernel module and its primary purpose is to implement WA "drivers" for various peripherals that may or may not be present in a particular setup. - .. note:: A mudule is itself an Extension and can therefore have it's own modules. + .. note:: A mudule is itself an Extension and can therefore have its own modules. """ diff --git a/wlauto/core/resource.py b/wlauto/core/resource.py index 758c6f50..ac2d31ca 100644 --- a/wlauto/core/resource.py +++ b/wlauto/core/resource.py @@ -82,7 +82,7 @@ class ResourceGetter(Extension): Base class for implementing resolvers. Defines resolver interface. Resolvers are responsible for discovering resources (such as particular kinds of files) they know about based on the parameters that are passed to them. Each resolver also has a dict of - attributes that describe it's operation, and may be used to determine which get invoked. + attributes that describe its operation, and may be used to determine which get invoked. There is no pre-defined set of attributes and resolvers may define their own. Class attributes: diff --git a/wlauto/utils/trace_cmd.py b/wlauto/utils/trace_cmd.py index 68110276..6c64c72d 100644 --- a/wlauto/utils/trace_cmd.py +++ b/wlauto/utils/trace_cmd.py @@ -173,13 +173,13 @@ def regex_body_parser(regex, flags=0): return regex_parser_func -# Maps event onto the corresponding parser for it's body text. A parser may be +# Maps event onto the corresponding parser for its body text. A parser may be # a callable with signature # # parser(event, bodytext) # # a re.RegexObject, or a string (in which case it will be compiled into a -# regex). In case of a string/regex, it's named groups will be used to populate +# regex). In case of a string/regex, its named groups will be used to populate # the event's attributes. EVENT_PARSER_MAP = { 'sched_switch': re.compile( From 65cc22a30565fc2cab0bd2abff6d3e16554aceb3 Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Mon, 18 Jan 2016 16:23:13 +0000 Subject: [PATCH 2/2] core/agenda.py: Add check for empty values in agenda This gives an error message when an agenda contains a key with no value, so creating agendas is a little more user-friendly. --- wlauto/core/agenda.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wlauto/core/agenda.py b/wlauto/core/agenda.py index ccb8bee7..7d67af33 100644 --- a/wlauto/core/agenda.py +++ b/wlauto/core/agenda.py @@ -173,6 +173,9 @@ class Agenda(object): message = '{} does not contain a valid agenda structure; top level must be a dict.' raise ConfigError(message.format(self.filepath)) for k, v in raw.iteritems(): + if v is None: + raise ConfigError('Empty "{}" entry in {}'.format(k, self.filepath)) + if k == 'config': if not isinstance(v, dict): raise ConfigError('Invalid agenda: "config" entry must be a dict')