From ab3b3181c22ef49c31966b8bada08931d71a814b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Cruz?= Date: Thu, 30 Apr 2020 12:51:40 +0100 Subject: [PATCH] fixes issue with collection plots (#78) --- nata/containers.py | 3 +++ nata/plugins/plot/collection.py | 14 +------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/nata/containers.py b/nata/containers.py index bf3dc59..dfb9d6a 100644 --- a/nata/containers.py +++ b/nata/containers.py @@ -1436,6 +1436,9 @@ def append(self, obj: Union[str, Path, "DatasetCollection"]) -> None: def __getitem__(self, key): return self.store[key] + def __setitem__(self, key, value): + self.store[key] = value + @classmethod def register_plugin(cls, plugin_name, plugin): setattr(cls, plugin_name, plugin) diff --git a/nata/plugins/plot/collection.py b/nata/plugins/plot/collection.py index 5d55bac..417f20b 100644 --- a/nata/plugins/plot/collection.py +++ b/nata/plugins/plot/collection.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- -from typing import Dict from typing import Optional import numpy as np from nata.containers import DatasetCollection -from nata.containers import ParticleDataset from nata.plots.axes import Axes from nata.plots.figure import Figure from nata.plots.helpers import filter_style @@ -21,7 +19,6 @@ def plot_collection( collection: DatasetCollection, order: Optional[list] = list(), styles: Optional[dict] = dict(), - quants: Optional[Dict[str, list]] = list(), interactive: bool = True, n: int = 0, ) -> Figure: @@ -49,17 +46,8 @@ def plot_collection( styles[dataset.name] if dataset.name in styles.keys() else None ) - if isinstance(dataset, ParticleDataset): - if dataset.name not in quants.keys(): - raise ValueError("quants not passed!") - i_quants = quants[dataset.name] - else: - i_quants = None - p_plan = PlotPlan( - dataset=dataset, - quants=i_quants, - style=filter_style(dataset.plot_type(), i_style), + dataset=dataset, style=filter_style(dataset.plot_type(), i_style), ) a_plan = AxesPlan(