Skip to content

Commit ab3b318

Browse files
authored
fixes issue with collection plots (#78)
1 parent 8588592 commit ab3b318

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

nata/containers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,9 @@ def append(self, obj: Union[str, Path, "DatasetCollection"]) -> None:
14361436
def __getitem__(self, key):
14371437
return self.store[key]
14381438

1439+
def __setitem__(self, key, value):
1440+
self.store[key] = value
1441+
14391442
@classmethod
14401443
def register_plugin(cls, plugin_name, plugin):
14411444
setattr(cls, plugin_name, plugin)

nata/plugins/plot/collection.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# -*- coding: utf-8 -*-
2-
from typing import Dict
32
from typing import Optional
43

54
import numpy as np
65

76
from nata.containers import DatasetCollection
8-
from nata.containers import ParticleDataset
97
from nata.plots.axes import Axes
108
from nata.plots.figure import Figure
119
from nata.plots.helpers import filter_style
@@ -21,7 +19,6 @@ def plot_collection(
2119
collection: DatasetCollection,
2220
order: Optional[list] = list(),
2321
styles: Optional[dict] = dict(),
24-
quants: Optional[Dict[str, list]] = list(),
2522
interactive: bool = True,
2623
n: int = 0,
2724
) -> Figure:
@@ -49,17 +46,8 @@ def plot_collection(
4946
styles[dataset.name] if dataset.name in styles.keys() else None
5047
)
5148

52-
if isinstance(dataset, ParticleDataset):
53-
if dataset.name not in quants.keys():
54-
raise ValueError("quants not passed!")
55-
i_quants = quants[dataset.name]
56-
else:
57-
i_quants = None
58-
5949
p_plan = PlotPlan(
60-
dataset=dataset,
61-
quants=i_quants,
62-
style=filter_style(dataset.plot_type(), i_style),
50+
dataset=dataset, style=filter_style(dataset.plot_type(), i_style),
6351
)
6452

6553
a_plan = AxesPlan(

0 commit comments

Comments
 (0)