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

log nparray() drops entries with duplicate time points. #2842

Closed
davidt0x opened this issue Nov 14, 2023 · 2 comments
Closed

log nparray() drops entries with duplicate time points. #2842

davidt0x opened this issue Nov 14, 2023 · 2 comments

Comments

@davidt0x
Copy link
Collaborator

Calls to nparray() on log don't report entries with duplicate time values. This is inconsistent with the report generated by print_entries().

Reproducible example from @jongkeesbj

import psyneulink as pnl

my_lca = pnl.LCAMechanism(
        size=2,
        function=pnl.Logistic(gain=1.0),
        termination_measure=pnl.TimeScale.TRIAL,
        termination_threshold=10,
    )

my_lca.set_log_conditions([pnl.RESULT])

comp = pnl.Composition(my_lca)

comp.run([1, 0])

my_lca.log.print_entries() # This shows results for all 10 time steps
my_lca.log.nparray() # This shows results only for the last time step?

This issue seems to be caused by nparray() using Log._assemble_entry_data which drops duplicate entries with the same time. I think the correct fix would be to add a further level of granularity to time that includes the execution number.

@jdcpni
Copy link
Collaborator

jdcpni commented Nov 15, 2023

Have implemented a record_all_executions option in log.nparray() and log.nparray_dictionary(). Setting this to True causes the values of all executions within a TIME_STEP to be reported as a list for that entry in the log. Note that this adds an extra list dimension to the values as compared to when the option is False.

@kmantel
Copy link
Collaborator

kmantel commented Dec 16, 2023

Fixed by #2844

@kmantel kmantel closed this as completed Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants