-
Notifications
You must be signed in to change notification settings - Fork 12
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
yaml serialization error #9
Comments
This was caused by a new sample-attribute I added called "sheet_attributes", which was a list of all the columns that were originally included in the annotation sheet. I use this to spit out the output in summarize, so I don't include all the new attributes constructed by looper. @afrendeiro can you think of a more robust way to handle yaml serialization than a hard-coded list of attributes to skip? |
I'd be happy to have a generalizable way to serialize to yaml without hardcoding anything. However this is only done now to prevent infinite recursion since objects are tied to each other (e.g. a Project object is an attribute of a Sample and a Sample object is inside a list which is an attribute of a Project), so I don't think skiping specific attributes is the cause for this. In that specfic case, it seems that it is a problem of determining the type of attribute (it thinks is a numpy data type). How's that list being added to the object? Through the annotation sheet or later after object creation? What are the elements of that list, only strings? With a list as an element of a series, you still seem able to retrieve it correctly:
Obviously, skiping that element fixes it for now but we still don't understand why it is failing, I guess I'd need to see that concrete case in particular. |
It's at init, link right here: https://github.com/epigen/looper/blob/1e08758760b8a12e4240ac736df5132a8871d122/looper/models.py#L535 |
Okay, that's not very good. What is being assigned to Pandas DataFrame columns and index (or just Series indexes) are objects of their own which have very useful methods and attributes. If you want them to be a list, you have to say so explicitly. The correct would be to use series = pd.Series(range(3))
series.keys() # gives object
>>> RangeIndex(start=0, stop=3, step=1)
series.index.tolist() # gives list
>>> [0, 1, 2] Calling columns or indexes with a method ( By the way, you might want to use those values to filter the sample attributes to be retrived in a function similar to |
@cdietzgit and I have found this error for some annotation sheets:
The text was updated successfully, but these errors were encountered: