Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/log/tuple datum value #601

Merged
merged 62 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3276e28
• System
jdcpni Nov 30, 2017
6908d7f
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Nov 30, 2017
461e18f
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 4, 2017
bd5f9a0
• Log
jdcpni Dec 5, 2017
04ffdac
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 5, 2017
2d6409b
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 5, 2017
7b7e277
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 7, 2017
cda732e
-
jdcpni Dec 7, 2017
9d204af
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 10, 2017
a6449c1
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 10, 2017
5603fa6
-
jdcpni Dec 10, 2017
21332d7
-
jdcpni Dec 10, 2017
335ab58
-
jdcpni Dec 10, 2017
51c0aed
-
jdcpni Dec 10, 2017
ab5144b
-
jdcpni Dec 10, 2017
6d58251
-
jdcpni Dec 10, 2017
5516f6d
-
jdcpni Dec 10, 2017
1dec9aa
-
jdcpni Dec 10, 2017
3e4766d
-
jdcpni Dec 10, 2017
e1ffdec
-
jdcpni Dec 10, 2017
0eec811
-
jdcpni Dec 10, 2017
17b487c
-
jdcpni Dec 10, 2017
3f438f5
Merge branch 'feat/Log/clean_up' into devel
jdcpni Dec 10, 2017
0561216
-
jdcpni Dec 10, 2017
c76a3a8
• Log
jdcpni Dec 10, 2017
43f9a0d
• Log
jdcpni Dec 10, 2017
17eaa3a
-
jdcpni Dec 11, 2017
f495751
-
jdcpni Dec 11, 2017
bb4fecd
-
jdcpni Dec 11, 2017
9579899
-
jdcpni Dec 11, 2017
aa679dd
-
jdcpni Dec 11, 2017
d7024ae
-
jdcpni Dec 11, 2017
73a8013
-
jdcpni Dec 11, 2017
6416865
• Log
jdcpni Dec 11, 2017
e200f88
• Log
jdcpni Dec 11, 2017
e5a3881
• Log
jdcpni Dec 11, 2017
5065c1d
• Log
jdcpni Dec 11, 2017
36c0988
• Log
jdcpni Dec 11, 2017
fe14d1e
• Log
jdcpni Dec 11, 2017
3a29540
• Log
jdcpni Dec 11, 2017
de216a8
Merge branch 'feat/Log/add_entry' into devel
jdcpni Dec 11, 2017
4dacd4d
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 11, 2017
5f043a0
-
jdcpni Dec 12, 2017
2d6b0a2
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 12, 2017
d2e5167
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 12, 2017
7baddea
• Component
jdcpni Dec 12, 2017
5e959fb
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 13, 2017
979a9ea
• Log
jdcpni Dec 13, 2017
5a5d15d
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 13, 2017
47cd066
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 13, 2017
51caf56
• ComponentPreferenceSet
jdcpni Dec 14, 2017
8f6babf
• ComponentPreferenceSet
jdcpni Dec 14, 2017
615eb95
• Log
jdcpni Dec 14, 2017
450a013
-
jdcpni Dec 14, 2017
e74d21f
• State
jdcpni Dec 14, 2017
2f00c87
• State
jdcpni Dec 14, 2017
f77125b
-
jdcpni Dec 14, 2017
80c5eb0
-
jdcpni Dec 14, 2017
edd8031
-
jdcpni Dec 14, 2017
c89d49e
Merge branch 'devel' of https://github.com/PrincetonUniversity/PsyNeu…
jdcpni Dec 14, 2017
6114973
• Log
jdcpni Dec 14, 2017
f889ed2
Merge branch 'devel' into fix/log/tuple_datum_value
jdcpni Dec 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .idea/runConfigurations/Nieuwenhuis_documented.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 42 additions & 42 deletions psyneulink/components/states/modulatorysignals/controlsignal.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,48 +957,48 @@ def update(self, params=None, time_scale=TimeScale.TRIAL, context=None):
cost_change_string = "+" + str(cost_change)
print("Cost: {0} [{1}])".format(self.cost, cost_change_string))

#region Record control_signal values in owner Mechanism's log
# Notes:
# * Log control_signals for ALL states of a given Mechanism in the Mechanism's log
# * Log control_signals for EACH state in a separate entry of the Mechanism's log

# Get receiver Mechanism and state
controller = self.owner

# Get logPref for Mechanism
log_pref = controller.prefs.logPref

# Get context
if not context:
context = controller.name + " " + self.name + kwAssign
else:
context = context + SEPARATOR_BAR + self.name + kwAssign

# If context is consistent with log_pref:
if (log_pref is LogCondition.ALL_ASSIGNMENTS or
(log_pref is LogCondition.EXECUTION and EXECUTING in context) or
(log_pref is LogCondition.VALUE_ASSIGNMENT and (EXECUTING in context))):
# record info in log

# FIX: ENCODE ALL OF THIS AS 1D ARRAYS IN 2D PROJECTION VALUE, AND PASS TO .value FOR LOGGING
controller.log.entries[self.name + " " +
kpIntensity] = LogEntry('time_placeholder', context, float(self.intensity))
if not self.ignoreIntensityFunction:
controller.log.entries[self.name + " " + kpAllocation] = LogEntry('time_placeholder',
context,
float(self.allocation))
controller.log.entries[self.name + " " + kpIntensityCost] = LogEntry('time_placeholder',
context,
float(self.intensity_cost))
controller.log.entries[self.name + " " + kpAdjustmentCost] = LogEntry('time_placeholder',
context,
float(self.adjustment_cost))
controller.log.entries[self.name + " " + kpDurationCost] = LogEntry('time_placeholder',
context,
float(self.duration_cost))
controller.log.entries[self.name + " " + kpCost] = LogEntry('time_placeholder',
context,
float(self.cost))
# #region Record control_signal values in owner Mechanism's log
# # Notes:
# # * Log control_signals for ALL states of a given Mechanism in the Mechanism's log
# # * Log control_signals for EACH state in a separate entry of the Mechanism's log
#
# # Get receiver Mechanism and state
# controller = self.owner
#
# # Get logPref for Mechanism
# log_pref = controller.prefs.logPref
#
# # Get context
# if not context:
# context = controller.name + " " + self.name + kwAssign
# else:
# context = context + SEPARATOR_BAR + self.name + kwAssign
#
# # If context is consistent with log_pref:
# if (log_pref is LogCondition.ALL_ASSIGNMENTS or
# (log_pref is LogCondition.EXECUTION and EXECUTING in context) or
# (log_pref is LogCondition.VALUE_ASSIGNMENT and (EXECUTING in context))):
# # record info in log
#
# # FIX: ENCODE ALL OF THIS AS 1D ARRAYS IN 2D PROJECTION VALUE, AND PASS TO .value FOR LOGGING
# controller.log.entries[self.name + " " +
# kpIntensity] = LogEntry('time_placeholder', context, float(self.intensity))
# if not self.ignoreIntensityFunction:
# controller.log.entries[self.name + " " + kpAllocation] = LogEntry('time_placeholder',
# context,
# float(self.allocation))
# controller.log.entries[self.name + " " + kpIntensityCost] = LogEntry('time_placeholder',
# context,
# float(self.intensity_cost))
# controller.log.entries[self.name + " " + kpAdjustmentCost] = LogEntry('time_placeholder',
# context,
# float(self.adjustment_cost))
# controller.log.entries[self.name + " " + kpDurationCost] = LogEntry('time_placeholder',
# context,
# float(self.duration_cost))
# controller.log.entries[self.name + " " + kpCost] = LogEntry('time_placeholder',
# context,
# float(self.cost))
#endregion

def _parse_state_specific_specs(self, owner, state_dict, state_specific_spec):
Expand Down
24 changes: 18 additions & 6 deletions psyneulink/globals/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,15 +1237,27 @@ def nparray(self,
time_col = iter(time_values)
for datum in self.logged_entries[entry]:
if time_values:
# for time in next(time_col,None):
# if time is None:
# break
# if datum.item != time:
# row.append(None)
# MODIFIED 12/14/17 OLD:
while datum.time != next(time_col,None):
row.append(None)
value = None if datum.value is None else datum.value.tolist()
value = None if datum.value is None else np.array(datum.value).tolist()
row.append(value)
# # MODIFIED 12/14/17 NEW:
# for i in range(len(time_values)):
# time = next(time_col,None)
# if time is None:
# break
# if datum.time != time:
# row.append(None)
# continue
# value = None if datum.value is None else datum.value.tolist()
# row.append(value)
# break
# else:
# value = None if datum.value is None else datum.value.tolist()
# row.append(value)
# MODIFIED 12/14/17 END

if header:
entry_header = "{}{}{}{}".format(owner_name_str, lb, self._alias_owner_name(entry), rb)
row = [entry_header] + row
Expand Down