From 499eb8c8e4c19f720b4d2d97fc14467020032e68 Mon Sep 17 00:00:00 2001 From: jdcpni Date: Wed, 13 Dec 2017 17:24:04 -0500 Subject: [PATCH] Fix/log/set log conditions bug (#596) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * • System - show_graph(): fixed bug producing empty image for graphs with just one Mechanism added auto-recurrent projections * • Log - added numpy_array output method * - * - * - * - * - * - * - * - * - * - * - * - * - * • Log - fixed bugs preventing logging during INITIALIZATION * • Log - fixed bugs preventing logging during INITIALIZATION * - * - * - * - * - * • Log - logged_item, print_entries: corrected to use 'value' rather than owner's name in reports * • Log - logged_item, print_entries: corrected to use 'value' rather than owner's name in reports • Tests test_log: added test_log_initialization * • Log - _alias_owner_name: added to used 'value' rather than owner's name in reports - nparray: bug fix to handle None values • Tests test_log: added test_log_initialization * • Log - log_value: added • Tests - test_multilayer: added test of log_value * • Log   - log_value: implemented   - logged_item, print_entries:  corrected to use 'value' rather than owner's name in reports • Tests   - test_multilayer: added test of log_value * • Log   - log_value: implemented   - logged_item, print_entries:  corrected to use 'value' rather than owner's name in reports • Tests   - test_multilayer: added test of log_value * - * • Component - moved value property to Component (from Mechanism, Projection and State) (left an override on ControlSignal that needs it for the getter) * • Log - docstring: added hint about using call_before_trial and call_after_trial to log values * • Log - fixed failure to call _alias_owner_name in set_log_condtion --- .idea/runConfigurations/scratch_1.xml | 21 +++++++++++++++++++++ psyneulink/globals/log.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .idea/runConfigurations/scratch_1.xml diff --git a/.idea/runConfigurations/scratch_1.xml b/.idea/runConfigurations/scratch_1.xml new file mode 100644 index 00000000000..aacc9cfbe83 --- /dev/null +++ b/.idea/runConfigurations/scratch_1.xml @@ -0,0 +1,21 @@ + + + + \ No newline at end of file diff --git a/psyneulink/globals/log.py b/psyneulink/globals/log.py index 0984cbd4949..de5def4853f 100644 --- a/psyneulink/globals/log.py +++ b/psyneulink/globals/log.py @@ -705,7 +705,7 @@ def assign_log_level(item, level): raise LogError("\'{0}\' is not a loggable item for {1} (try using \'{1}.log.add_entries()\')". format(item, self.owner.name)) try: - component = next(c for c in self.loggable_components if c.name == item) + component = next(c for c in self.loggable_components if self._alias_owner_name(c.name) == item) component.logPref=PreferenceEntry(level, PreferenceLevel.INSTANCE) except AttributeError: raise LogError("PROGRAM ERROR: Unable to set LogCondition for {} of {}".format(item, self.owner.name))