-
-
Notifications
You must be signed in to change notification settings - Fork 351
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: raster import and TimeSeriesMap rendering issues #5416
base: main
Are you sure you want to change the base?
fix: raster import and TimeSeriesMap rendering issues #5416
Conversation
I tested it, but it doesn't help. I think this will need larger changes. |
@petrasovaa can you guide me , or give me some overview I will try my best to solve this. |
TimeSeriesMap and SeriesMap were written separately and then later we created a BaseSeriesMap because they have a lot in common. But that was not done entirely correctly, some of the TSM structures are different then the SM, which is somehow causing the bug. So I would look at the rendering commands when they are called. |
…3shukla/grass into codefixes" This reverts commit 7e42dbd, reversing changes made to 420720a.
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.
@petrasovaa test it ma'am .
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.
Please fix the formatting issue first. I am not convinced this will work, could you post here a quick screencast showing TimeSeriesMap and SeriesMap example with your changes? We have example notebooks in doc/examples/notebooks
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
@@ -28,7 +28,8 @@ | |||
from .utils import get_number_of_cores, save_gif | |||
|
|||
|
|||
|
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.
[ruff] reported by reviewdog 🐶
@@ -98,13 +99,30 @@ | |||
self._base_calls.append((grass_module, kwargs)) | |||
|
|||
return wrapper | |||
|
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.
[ruff] reported by reviewdog 🐶
self._layers_rendered = False # Force re-render | ||
|
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.
[ruff] reported by reviewdog 🐶
self._layers_rendered = False # Force re-render | |
self._layers_rendered = False # Force re-render |
def _apply_overlays(self, img): | ||
"""Apply overlay commands (d.vect, d.barscale) to map instance""" | ||
for grass_module, kwargs in self._base_calls: | ||
img.run(grass_module, **kwargs) |
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.
[ruff] reported by reviewdog 🐶
img.run(grass_module, **kwargs) | |
img.run(grass_module, **kwargs) |
img.d_legend(**self._legend) | ||
|
||
|
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.
[ruff] reported by reviewdog 🐶
img.d_legend(**self._legend) | |
img.d_legend(**self._legend) | |
|
||
# Create instance | ||
precip_map = TimeSeriesMap(use_region=True) | ||
|
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.
[ruff] reported by reviewdog 🐶
|
||
# Add raster series | ||
precip_map.add_raster_series("precip_sum_2018") | ||
|
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.
[ruff] reported by reviewdog 🐶
precip_map.d_vect(map="boundary_country", fill_color="none") | ||
precip_map.d_barscale() | ||
precip_map.d_legend(color="black", at=(10, 40, 2, 6)) | ||
|
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.
[ruff] reported by reviewdog 🐶
|
||
# Render frames (headless) | ||
precip_map.render() | ||
|
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.
[ruff] reported by reviewdog 🐶
# Verify layers | ||
assert precip_map._layers is not None, "No layers loaded" | ||
assert len(precip_map._layers) > 0, "Layers list is empty" | ||
|
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.
[ruff] reported by reviewdog 🐶
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.
[ruff] reported by reviewdog 🐶
grass/python/grass/jupyter/seriesmap.py
Line 17 in 4920b44
import shutil |
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.
[ruff] reported by reviewdog 🐶
import shutil |
Resolved raster import failure and corrected TimeSeriesMap rendering by handling dataset accessibility and granularity errors. Closes #5304 .