-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Convert scalar data to 0-dimensional arrays #36
Conversation
Codecov Report
@@ Coverage Diff @@
## main #36 +/- ##
==========================================
+ Coverage 95.94% 96.00% +0.05%
==========================================
Files 9 9
Lines 296 300 +4
==========================================
+ Hits 284 288 +4
Misses 12 12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Currently keyword indexing (rafaqz/DimensionalData.jl#423) and the Tables interface (rafaqz/DimensionalData.jl#424) also fail for Alternatively, we could take xarray's approach of promoting to a single-element vector and introducing a dummy dimension. There's no real downside to this, and since it just works ™️, perhaps we should adopt that approach instead. |
This PR fixes an issue raised by @goedman in StanJulia/StanSample.jl#60 (comment) wherein if one passes an
observed_data
such as(J=8, y=[1, 2, 3])
tofrom_namedtuple
, one hits a StackOverflow since the method assumes all data in theNamedTuple
are arrays.This PR fixes this by wrapping all non-array data within a
NamedTuple
withfill
to make a 0-dimensional array. It also ensures that these arrays are correctly (de)serialized with netCDF.Currently tests fail due to rafaqz/DimensionalData.jl#421