-
Notifications
You must be signed in to change notification settings - Fork 286
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
Sample data usage #34
Conversation
# Attempt to build a DimCoord and add it to the cube. If this fails e.g it's | ||
# non-numeric, then build an AuxCoord. | ||
try: | ||
dim_coords_and_dims.append(_CoordAndDims(iris.coords.DimCoord(template.points, |
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.
Needed to do this for the non-numeric dimension coord creation attempt when loading the NAME data. @bjlittle should have visibility of this.
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.
Surprised you end up with a template in self._dim_templates
that can't be used to make a DimCoord. I'd suggest this should be caught earlier and be put into self._aux_templates
.
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.
It's a good point raised by @esc24.
It would be cleaner to migrate this decision point earlier to ProtoCube._define_space()
.
During the first-pass through the names of the space for a non-combination dimension, you could simply add a case at line 1078 to check the dtype of the associated coordinate metadata to determine whether it is string i.e. the deal-breaker condition for creating the DimCoord
. If so, add the template to the aux_templates
instead of the dim_templates
. As per the following dimension coordinate case, ensure to update dim_by_name, self._nd_names, self._shape and self._cache_by_name
.
In doing so, when ProtoCube._build_coordinates()
is finally called, it will create the appropriate coordinate within the try-except block for auxiliary coordinates by default.
I've read over the diffs and have made a couple of comments on the things I need to do. Other than those, I would like to get this code reviewed and in for 0.9. |
|
||
# Extract a height vs longitude cross-section. N.B. This could easily changed to | ||
# Extract a single height vs longitude cross-section. N.B. This could easily changed to |
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.
Comment change:
- "... N.B. This could easily
be
changed to ..."
Ok. Think this is good to go. |
This PR embodies the changes necessary to reduce the data size of the sample data. It has drawn heavily from the work done by @bblay in #19.
Currently, the sample data can be found in my repository at https://github.com/pelson/iris-data . The license of the data is still not fully clear, but my primary aim at this stage has been to focus on the data size. A version of the built documentation, built using this branch, can be found at http://pelson.github.com/iris/ .
I have added a new configuration variable to allow users to specify the location of the sample data directory, but have not yet fully tidied up the old mechanisms (partly because that would affect the way the tests run, and I didn't want to muddy the waters).