-
Notifications
You must be signed in to change notification settings - Fork 43
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
Invariant sizes #85
Invariant sizes #85
Conversation
30ec255
to
1ddce11
Compare
Codecov Report
@@ Coverage Diff @@
## master #85 +/- ##
======================================
Coverage ? 84%
======================================
Files ? 12
Lines ? 650
Branches ? 0
======================================
Hits ? 546
Misses ? 104
Partials ? 0
Continue to review full report at Codecov.
|
Sorry I wont be able to review this for a couple days. |
Not sure if you've started looking at this yet, but do you have a preference on dealing with conflicts? E.g. should I rebase or merge? |
rebase when its easy but I dont mind really. maybe I should do this merge, but not much time currently so have a go. |
This could be done more cleanly. I'm thinking it should probably only do this if the dimension type is passed, not Dim()
This reverts commit c054e5f.
* Now can do `DimensionalArray(a, (X(), Y))` and similar * Made the code paths for different types clearer * Reduced redundant code * Errors for too many and too few dimensions should be similar now
269bcf0
to
ab96b1d
Compare
No worries, it was a pretty easy rebase. |
Oh, and my point about the test on the TransformedGrid. My understanding of It doesn't make sense to me that the value of the dimension would be the transformation. It seems more like a property of the dimension's grid. Right now the test fails since the value of the dimension doesn't have |
Previously this would throw an error due to an intermediate subset DimensionalArray being created with invalid dimensions.
Sure the transormation can be in a grid field. The choice was pretty arbitrary. |
Maybe eventually. Currently it's just to be able to index points using a transformed coordinate system, and to be able to actually represent gdal etc files than use a coordinate transform. It's also not at all my area of expertise, I don't actually use these grids. But we need to be able to represent them somehow and I wanted to be sure that could happen with the existing architecture - and it can. But it's not a complete implementation. |
Also realised I never answered these (too busy...):
The instance of
Because then you have to compute every transform for every dim combination, and its at minimum 2d, so that also means allocating a matrix.
Absolutely. I have a rework of it in progress.
I have no idea, but also not sure exactly what you mean |
Does anyone currently use the grids? I'm not sure I'm the person to redefine them, since I definitely don't use them. Would it be alright to leave the test disabled and open an issue for fixing this? About what the dim values for transformed grid are, I was thinking something like: DimArray
I think what I mean by this, is should
Oh, I ended up doing a bit of cleanup here while fixing a bug...
Basically, if you did
And I wasn't quite sure what this meant. |
No-one uses the TransformedGrid as far as I know, but I use the others every day in GeoData.jl - they are what lets it abstract the array access over different base data types, with different grid orders, projections and range/array indices etc. It's the basis of a lot of my other modelling packages and the use case I wrote DD for. I think the transform is from some coordinates to the actual index integers, so you would only use We need both
|
Oh, I definitely just meant TransformedGrid. So, do you mind if I leave the tests for
Yeah, the
Me too, that's what I've been going for. I've got another commit that makes Apart from deciding on the multidimensional reduction stuff, does this need any changes? |
I guess we can leave TransformedGrid tests out, it feels a bit dirty but at least we'll know if anyone else is using it... Maybe I'll merge this and you can make a new PR for the reduce methods, we should try to keep these focussed. Also are there actual tests for invariant size? |
Travis is just failing due to build errors for the plotting tests. The relevant tests are passing. |
Ok this is a Plots/FFMPEG_jll problem on windows builds. We might need to disable windows testing temporarily to get this passing. Actually we should put a conditional block around plot tests to avoid windows. if !Sys.iswindows()
include("plotrecipes.jl")
end |
Trying to enforce
length.(dims(da)) == size(da) == size(data(da))
following up from #83.This is pretty messy at the moment, but it kept bugging me throughout the day. There are a few cases that need thinking about.
X()
?TransformedGrids
are supposed to work. Why are the dims of an array on this grid the transformer, and not the original dimensions with the transform applied?formatdims
could be cleanercov
andcor
defined the way they are?