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

Cross-section widget: Line data not loaded when drawing different cross-section for same timestep #77

Closed
JoerivanEngelen opened this issue Mar 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@JoerivanEngelen
Copy link
Contributor

...
    def requires_loading(self, datetime_range):
        group_index = self.variables_indexes[self.variable][self.layer_numbers[0]]
        if self.requires_static_index(
            datetime_range
        ):  # Just take the first one in such a case
            sample_index = (group_index, 0)
        else:
            index = self.layer.datasetIndexAtTime(datetime_range, group_index)
            sample_index = (index.group(), index.dataset())

        if sample_index == self.sample_index:
            return False
        else:
            return True
...

The check doesn't account if anything defined in self.x, which is what happens in the base class:

...
    def requires_loading(self, **kwargs):
        return self.x is None
...
@JoerivanEngelen JoerivanEngelen self-assigned this Mar 18, 2024
@JoerivanEngelen JoerivanEngelen added the bug Something isn't working label Mar 18, 2024
JoerivanEngelen added a commit that referenced this issue Mar 18, 2024
* First version of fix with code duplication

* Refactor to use Mixins

* fix docstring

* Refactor duplicate code away in SupportsTemporalMixin and fix bug in its requires_loading() method, which would return False if different cross-section was drawn but same timestep selected

* Update changelog

* Add comment
@JoerivanEngelen
Copy link
Contributor Author

Closed by #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

No branches or pull requests

1 participant