-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Add ability to sort SolutionArray objects #688
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
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 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:
sort
method for 1D SolutionArray objectsstates
notNone
Intended usage:
Some observations:
SolutionArray
objects is not clearly definedSolutionArray._extra_lists
andSolutionArray._extra_arrays
dictionaries is not clearSolutionArray._extra_lists
is apparently only used inSolutionArray.__call__
(docstring is missing ... it works as copying constructor that extracts species,but usage is not clear)