-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fix evaluation example visualisation plots #91
Conversation
When
A solution could be to use # Iterate over prediction horizon time steps
for t_i, _ in enumerate(zip(pred_slice, target_slice), start=1):
# Create one figure per variable at this time step
var_figs = [
vis.plot_prediction(
datastore=self._datastore,
title=f"{var_name} ({var_unit}), "
f"t={t_i} ({self._datastore.step_length * t_i} h)",
vrange=var_vrange,
da_prediction=da_prediction.isel(
state_feature=var_i,
time=t_i - 1
).squeeze(),
da_target=da_target.isel(
state_feature=var_i,
time=t_i - 1
).squeeze(),
)
for var_i, (var_name, var_unit, var_vrange) in enumerate(
zip(
self._datastore.get_vars_names("state"),
self._datastore.get_vars_units("state"),
var_vranges,
)
)
] |
Thanks for supplying me with a fix! Addressed in leifdenby@52c4528 |
I am re-running two tests, which failed because there were no online runners for some reason. |
It looks like this might be an issue with |
Yes, there is an issue with TracebackAdding packages to default dependencies: dataclass-wizard==0.32.0 0:00:07 🔒 Lock successful. Changes are written to pyproject.toml. Synchronizing working set with resolved packages: 0 to add, 1 to update, 0 to remove I suggest we skip |
This is all good and ready for merge now right, @khintz ? |
Nearly, I need @leifdenby to push an entry to the changelog :) Other than that, all looks good now. |
Done! Is this detailed enough for the changelog? I don't think adding too much detail in the changelog is a good idea, but I could list the bugs I fixed. |
Great! I'm happy. |
Describe your changes
Fix bugs in recently introduced datastore functionality #66 (error in calculation in
BaseDatastore.get_xy_extent()
and overlooked in-place modification of config dict inMDPDatastore.coords_projection
), and also fix issue inARModel.plot_examples
by using newly introduced (#66)WeatherDataset.create_dataarray_from_tensor()
to createxr.DataArray
from prediction tensor and calling plot methods directly onxr.DataArray
rather than using bare numpy arrays withmatplotlib
.Without the latter fix @khintz noticed that the example plots are incorrect (the field is transposed, and the interior rather than the boundary is alpha blended):
Steps to reproduce (eval CLI run is not currently part of testing suite):
After the fixes in this PR the eval plot is as follows (not same sample as above, but exemplary):
NB: This PR introduces the creation of a
WeatherDataset
instance on every tensor toxr.DataArray
creation inARModel
. This isn't ideal, but since we will soon be refactoring the whole plotting functionality inneural-lam
I thought this would be a step in that direction (since to me at least plotting fromxr.DataArray
objects rather than bare numpy arrays with matplotlib is a lot less error-prone).No change of dependencies for these fixes.
Issue Link
No related link, issue was brought up on slack
Type of change
Checklist before requesting a review
pull
with--rebase
option if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee