-
Notifications
You must be signed in to change notification settings - Fork 39
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
cmip6_fix_fgoals_f3_l_Amon_time_bnds #831
Conversation
I would tackle the codacy issues. Though there is not much I can do, any ideas. |
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.
couple minor changes and a question, cheers 🍺
for cube in cubes: | ||
if cube.attributes['table_id'] == 'Amon': | ||
time = cube.coord('time') | ||
if cube.attributes['table_id'] == 'Amon' and \ |
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.
you are checking for this already two lines up
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.
Thanks!
cftime.DatetimeNoLeap(c.year + 1, 1, 1) for c in times | ||
] | ||
time.bounds = time.units.date2num( | ||
np.stack([starts, ends], -1)) |
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.
is the fault discoverable immediately by looking at the first and second [b1, b2]
bounds? Or could be somewhere deeper in the bounds array? I also think it's prob best if you just say time.bounds = None; time.guess_bounds()
- bit more general?
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.
From what I have seen it's concerning all time bounds. I added a check over the whole period though.
Concerning boundary guessing, I don't consider it the way forward, as it simple finds bounds in the middle between the two points, which is not correct in the case of monthly data. Leading to e.g. DimCoord([1850-01-16 12:00:00, 1850-02-15 00:00:00, 1850-03-16 12:00:00 ...] , bounds=[[1850-01-01 18:00:00, 1850-01-31 06:00:00], [1850-01-31 06:00:00, 1850-03-01 18:00:00], [1850-03-01 18:00:00, 1850-03-31 18:00:00], ...]
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.
OK - am not a big fan of guessing bounds myself but it may be easier if the result is the same as the coded by hand one, which is not the case here 👍
Co-authored-by: Valeriu Predoi <valeriu.predoi@gmail.com>
@valeriupredoi same here I assume ;) |
Tasks
Closes #821