-
Notifications
You must be signed in to change notification settings - Fork 64
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
Major improvements to loops, misc other fixes #789
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…on how many iterations loop will execute.
…nctions to DataSetList
…raj will build and pass tests. I want the rest of the stuff committed before the amber meeting.
…gin functions. Cleanup.
drroe
changed the title
Major improvements to loops, changes to vector data sets, misc other fixes
Major improvements to loops, misc other fixes
Jan 31, 2020
I'm giving up on the vector data set stuff for now. I'll revisit it in the future I guess. |
This pull request fixes 1 alert when merging 6c7b929 into b836078 - view on LGTM.com fixed alerts:
|
Appveyor failure is because |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a pretty big PR that provides major improvements to the utility of loops, as well as other changes under the hood:
for
loops have been fixed so that nested loops can make use of variables, including outer loop variables. For example, the following will now work:This will result in 3 distance commands calculating
d12
,d13
, andd23
.datasetblocks
is introduced that allows looping over subsets (blocks) of fixed size of a data set, or subsets of increasing size (cumulative).For example, given a data set containing distances named
EndToEndAll
, one can loop over subsets of the data set in blocks of size 10 via:The created subsets are regular data sets and each iteration can be referred to via the loop variable (
$DS
in this example). This will enable improved error analysis for users.for
loop variables are stored in the master data set list as "string" variables. This makes the code involving "control blocks" like for loops easier and will facilitate adding new block types in the future (likeif
). I was able to remove several classes and consolidate functionality because of this. For loop subtypes have their own classes now, which makes things easier to read.=
(e.g.set2 = set1
). If copy is not supported, the old behavior (renaming) is used.help Math
.Vector data sets have now been split into "with origins" and "without origins". This makes a lot of the code under the hood simpler. What this means for output is that vectors with no origins (e.g. center of mass vectors from theThis was reverted to make sure pytraj does not break.vector
command, etc) Will no longer have a "blank" origin (i.e. 0, 0, 0) printed. Internally this makes things like resizing and copying easier. This should probably be done for other data sets down the road (like covariance matrices etc).