deprecating save_ensemble_data and read_ensemble_data #448
Replies: 1 comment
-
I realize I forgot a second detail in the revised API. The We didn't discuss this detail of the algorithm, but my revised Opinions on this change? |
Beta Was this translation helpful? Give feedback.
-
As we have been discussing I am in the processing of a major revision of the Database class. One of the things I did that we discussed in our weekly meetings is move to deprecate the series of functions called
save_ensemble_data
,save_ensemble_data_group
,read_ensemble_data
, andread_ensemble_group
. The new design wraps the same functionality into to simpler functions called justsave_data
andread_data
. The next revision will still support calls to the methods with the "ensemble" name, but they will do little more than call the newsave_data
orread_data
method that supports ensembles directly. Note the new functionality includes the "group" concept automatically where we support fast reads of data stored as "binary" by reading all the data from the ensemble stored in a single file. It actually goes further and accepts mixed input for any ensemble as formatted or binary data and will take all binary data inputs and try to read them efficiently automatically. The point is to emphasize this new api is much simpler and adds significant functionality for ensembles.The above was mostly background for the record. The design above was finalized outside this public forum in our weekly meetings. The issue I want to raise here is a minor collision in the revised API that is breaking current tests. The old signature for
save_ensemble_data
is this:The signature for
save_data
changed slightly from v1 and is the following:The issue I want to focus on here is the mismatch in concept between ensembles and atomic data that the old API supported through the argument called
exclude_objects
. That argument was required to be a list of integer ensemble index values that were not to be saved. e.g. if we setexclude_objects=[3, 5]
then on writingmspass_object.member[3]
andmspass_object.member[5]
would be silently skipped in writing.I do not remember what we were thinking when we implemented
exclude_objects
, but it seems both unnecessary an undesirable. If someone wanted to exclude some data it would be much clearer in the code to do so explicitly with a kill or by popping the member off the container. I urge move toward the a future where we drop this from the API. I am going to have the wrappers that handle the backward compatibility issue an additional warning if the workflow attempts to use theexclude_objects
list. It is trivial to implement so the revision will handle that feature, but I think we should move to completely remove that functionality in a future release that is to be determined. Alternatively, I could just remove it now and revise the tests that are breaking. What do you think we should do?Beta Was this translation helpful? Give feedback.
All reactions