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

grib1 unit 10 handling #171

Merged
merged 2 commits into from
Oct 31, 2012
Merged

grib1 unit 10 handling #171

merged 2 commits into from
Oct 31, 2012

Conversation

bblay
Copy link
Contributor

@bblay bblay commented Oct 24, 2012

replaces #168, now pulling to master

@pp-mo
Copy link
Member

pp-mo commented Oct 25, 2012

👍

But.. do you know if there may be various other similar issues, and are we due a review?

@bblay
Copy link
Contributor Author

bblay commented Oct 26, 2012

There are bound to be other similar issues. We've not attempted complete coverage, just what's needed by internal use cases. No review pending but feel free to raise an issue for it if you think it will be helpful.

@rhattersley
Copy link
Member

Ideally, a test would be nice.

@pp-mo
Copy link
Member

pp-mo commented Oct 29, 2012

As I already said 👍 !

But...
I'm currently working to add more tests, and some more time-unit cases.
Also tests more specifically targetted to this code (not using general iris load operations), as suggested by @rhattersley (private communication).
This will be a little while longer, so I'll submit it separately later.

So, don't wait up !

@bblay
Copy link
Contributor Author

bblay commented Oct 30, 2012

@pp-mo, are you recommending this is merged without said test because it's on it's way in a coming pr?
Sounds reasonable.

@pp-mo
Copy link
Member

pp-mo commented Oct 30, 2012

@pp-mo, are you recommending this is merged without said test
because it's on it's way in a coming pr?

Yes, absolutely. It's needed for a support enquiry, and the other work will take a while yet.

@rhattersley
Copy link
Member

Sounds like your future PR has got lots of new tests in? Can we not cherry pick just the one or two that are specific to this change?

@pp-mo
Copy link
Member

pp-mo commented Oct 30, 2012

It's not (just) the coverage, I'm still sorting out the revised testing method and (still) not yet ready to commit it.
The extra functional changes also involved some refactoring of the grib.py code, and I rather failed to keep the two things separate (doh!). So I think I'd now better disentangle the two again before submitting anything.

@bblay
Copy link
Contributor Author

bblay commented Oct 30, 2012

Go on

datetime.timedelta(int(time_diff)))
elif unit_of_time == 10: # 3 hours
verification_date = (reference_date_time +
datetime.timedelta(0, 0, 0, 0, 0, int(time_diff*3)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these timedelta constructor calls would be much better written using keywords, e.g.:

datetime.timedelta(hours=int(time_diff * 3))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll add this improvement in my upcoming change to support additional unit codes.
The changes will significantly tidy this code anyway, as I discovered the unit conversions can be unified in one place with considerable benefit.

@rhattersley
Copy link
Member

There are external time pressures for getting this extension onto master, so I'm going to merge as it currently stands.

rhattersley added a commit that referenced this pull request Oct 31, 2012
GRIB1 time-unit 10 handling
@rhattersley rhattersley merged commit fee1df9 into SciTools:master Oct 31, 2012
@rhattersley
Copy link
Member

@pp-mo If you could include the timedelta-using-keywords change mentioned above in your upcoming PR that would be lovely, thank you. :)

@pp-mo
Copy link
Member

pp-mo commented Oct 31, 2012

@pp-mo If you could include the timedelta-using-keywords change mentioned above in your upcoming PR
that would be lovely, thank you. :)

Ok, as noted above.

@pp-mo pp-mo mentioned this pull request Oct 31, 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