-
Notifications
You must be signed in to change notification settings - Fork 11
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
Ensure consistent column ordering in DataSet.unstack_anomalous()
#99
Conversation
Codecov Report
@@ Coverage Diff @@
## main #99 +/- ##
=======================================
Coverage 98.97% 98.97%
=======================================
Files 41 41
Lines 1561 1561
=======================================
Hits 1545 1545
Misses 16 16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I checked this branch and it appears to fix the issues i was having with |
Related to this (and hopefully not compounding the issue) would it make sense for Definitely not critical, but would a) occasionally save some typing and b) be internally consistent with the way the defaults work (without breaking previous code), e.g. (This also seems like an easy enough change that I could try to tackle it myself, with blessing?) |
@dennisbrookner 's suggestion is more consistent with |
in the future, let's do this sort of discussion in a separate Issue rather than on a closed PR. I'm fine with adding something like this. Given that |
Noted re: locations of conversations, I'll make a new Issue and link to here. Glad this seems to make sense! |
DataSet.unstack_anomalous()
would sometimes produce new two-column anomalousDataSets
in which the newly created anomalous columns were in different orders. This would occur because internally the function used aset
to keep track of the new columns. Since the plus-Friedel columns were suffixed with(+)
and the minus-Friedel with(-)
, this could produce different orders to the columns in theset
.This bug made it so that round-trip operations of
DataSet.unstack_anomalous()
followed byDataSet.stack_anomalous()
sometimes produced aValueError
(#97 ), depending on the Python version being used.This PR updates
DataSet.unstack_anomalous()
to internally use adict
for keeping track of the relevant columns. As of Python 3.7+ this preserves the order of input keys.