Deltares / imod-qgis

🗺️🧭 QGIS plugin for iMOD
GNU General Public License v2.0
7 stars 1 forks source link

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

Closed JoerivanEngelen closed 5 months ago

JoerivanEngelen commented 5 months ago
...
    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 commented 5 months ago

Closed by https://github.com/Deltares/imod-qgis/pull/76