Skip to content
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

Merged
merged 6 commits into from
Aug 14, 2012
Merged

Sample data usage #34

merged 6 commits into from
Aug 14, 2012

Conversation

pelson
Copy link
Member

@pelson pelson commented Aug 10, 2012

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).

@pelson pelson mentioned this pull request Aug 10, 2012
# 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,
Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

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.

@pelson
Copy link
Member Author

pelson commented Aug 10, 2012

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.

@ghost ghost assigned bjlittle Aug 13, 2012

# 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
Copy link
Member

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 ..."

@pelson
Copy link
Member Author

pelson commented Aug 14, 2012

Ok. Think this is good to go.

bjlittle added a commit that referenced this pull request Aug 14, 2012
@bjlittle bjlittle merged commit 0692d96 into SciTools:master Aug 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants