Add ability to sort SolutionArray objects#688
Conversation
e9a4629 to
e443232
Compare
|
Does it make sense to add a kwarg to reverse the sort? Or does the |
|
|
2728a6f to
d5aec44
Compare
d5aec44 to
62b550d
Compare
speth
left a comment
There was a problem hiding this comment.
I realize this wasn't well documented, but the duplication of data between _extra_arrays and _extra_lists was meant as an optimization for accessing the "extra" variables. Data is initially stored in the list form so that appending to the SolutionArray is efficient. However, we want to return an array when those variables are accessed, and at the time I initially wrote this, I wanted to avoid the inefficiency of repeatedly converting the list to an array in the case where the data hadn't changed.
However, with the expansion of the features of the SolutionArray class, I think maintaining the duplicate data isn't worth the effort, so keeping just the list-based storage makes sense. It might be worth renaming it just _extra in that case, since there is no need to distinguish between that and the now-removed array version.
62b550d to
85c2eba
Compare
That's how I interpreted this, and thought that
Done. |
Codecov Report
@@ Coverage Diff @@
## master #688 +/- ##
=======================================
Coverage 70.85% 70.85%
=======================================
Files 374 374
Lines 43668 43668
=======================================
Hits 30939 30939
Misses 12729 12729
Continue to review full report at Codecov.
|
Please fill in the issue number this pull request is fixing:
Fixes #625
Changes proposed in this pull request:
sortmethod for 1D SolutionArray objectsstatesnotNoneIntended usage:
Some observations:
SolutionArrayobjects is not clearly definedSolutionArray._extra_listsandSolutionArray._extra_arraysdictionaries is not clearSolutionArray._extra_listsis apparently only used inSolutionArray.__call__(docstring is missing ... it works as copying constructor that extracts species,but usage is not clear)