Description
Tell us about it
Saving an arviz inferenceData
object to a file, I was looking at the docstring (on the website) for guidance. Here are some questions I think would be good to answer in that docstring:
-
The docstring says
Save dataset as a netcdf file.
WARNING: Only idempotent in case data is InferenceData
I don't understand what "idempotent" means in this context. This function should not change theInferenceData
argument, so what does it mean for it to be idempotent (or not, for that matter)? If this means that writing the same data object that is not anInferenceData
twice gives different results, the docstring should just say so.
For that matter, it seems pretty complicated to understand what will happen if thedata
argument is not anInferenceData
object, but is "any object accepted by convert_to_inference_data". Wouldn't it be simpler to have the user translate the object to save themselves, instead of trying to guess what they want? -
Supporting
coords
anddims
arguments just made me worried. Does this mean that the function won't save thecoords
anddims
that are already in theInferenceData
? Or is this just for the case when the argument is not anInferenceData
(or is, for some reason, anInferenceData
object that doesn't havecoords
anddims
)? Maybe clarify by saying "defaults to thecoords
(respectively,dims
) already in theInferenceData
, if any." -
The description of the
group
argument is hard to understand:groupstr (optional)
In case data is not InferenceData, this is the group it will be saved toDoes this mean that this function will try to splice additional information into a previously-existing netcdf file? Or is this just if, for example, we pass a PyMC3 prior predictive trace as the data argument? Again, maybe it would make things simpler for both users and maintainers/developers if things were simplified by requiring an
InferenceData
object as data (and requiring the callers to do the translation themselves).