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
Return ragged arrays in Environment Matching Code #1064
Conversation
In addition to the changes here, I think the restriction that the disjoint set data structure ( |
Hmm yeah I think that sounds right. The only reason that was needed was to properly size the output arrays and to control iteration bounds, but with a ragged array you can iterate properly over each subarray (environment) so it should be safe to stop tracking that. Let me know if you run into any issues with removing it, but I think it should be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not overly familiar with the environment matching code, but the changes look good.
Co-authored-by: Brandon Butler <butlerbr@umich.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small suggestions.
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
Description
This PR makes the
point_environments
property of theEnvironmentCluster
andEnvironmentMotifMatch
, as well as thecluster_environments
property ofEnvironmentCluster
, return a list if numpy arrays of different sizes.Motivation and Context
This is a more intuitive way to return the data to the user, and the padded zero vectors in the previous implementation were confusing.
Resolves: #981
How Has This Been Tested?
Tests have been added to ensure raggedness of the properties which have had their behavior changed.
Types of changes
Checklist: