Skip to content

Commit

Permalink
fixes issue with collection plots (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocruz authored Apr 30, 2020
1 parent 8588592 commit ab3b318
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
3 changes: 3 additions & 0 deletions nata/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
14 changes: 1 addition & 13 deletions nata/plugins/plot/collection.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit ab3b318

Please sign in to comment.