Skip to content

Commit d63c8dd

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6b608a3 commit d63c8dd

13 files changed

Lines changed: 0 additions & 34 deletions

File tree

nata/containers/ParticleDataset_old.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def __init__(
9595
particles: Union[int, np.ndarray] = _extract_from_data,
9696
dtype: np.dtype = _extract_from_data,
9797
) -> None:
98-
9998
if not isinstance(data, np.ndarray):
10099
data = np.asanyarray(data)
101100

nata/plots/elements.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ def scale_from_str(name: str):
8484

8585

8686
def mpl_norm_from_scale(scale: Scale, colorrange: Sequence[Numbers]):
87-
8887
if not scale or isinstance(scale, LinearScale):
8988
return mpl.colors.Normalize(vmin=colorrange[0], vmax=colorrange[1])
9089

nata/plots/figure.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def __init__(
3232
size: Optional[Sequence[Numbers]] = None,
3333
theme: Theme = Theme(name="light"),
3434
):
35-
3635
self.theme = theme
3736

3837
with mpl.rc_context(rc=self.theme.rc):
@@ -81,7 +80,6 @@ def scatter(
8180
size=None,
8281
alpha=None,
8382
):
84-
8583
has_colors = (
8684
color is not None
8785
and isinstance(color, (Sequence, np.ndarray))
@@ -135,7 +133,6 @@ def image(
135133
colormap=None,
136134
colorbar=None,
137135
):
138-
139136
with mpl.rc_context(rc=self.theme.rc):
140137
img = self.backend_ax.imshow(
141138
np.transpose(color),

nata/plots/kinds.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
@dataclass
1515
class PlotKind:
1616
def to_dict(self):
17-
1817
kind_dict = {}
1918
for field in fields(self):
2019
kind_dict[field.name] = getattr(self, field.name)

nata/plugins/plot/collection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def plot_collection(
2222
interactive: bool = True,
2323
n: int = 0,
2424
) -> Figure:
25-
2625
# check if collection is not empty
2726
if not collection.store:
2827
raise ValueError("Collection is empty.")

nata/plugins/plot/dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def plot_dataset(
4545
interact = False
4646

4747
if interact:
48-
4948
if start not in range(len(data)):
5049
raise ValueError("invalid start index")
5150

nata/plugins/plot/grid.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def plot_data_array(
5656
theme: Optional[Union[Theme, str]] = None,
5757
kind: Optional[PlotKind] = None,
5858
):
59-
6059
if kind and not is_valid_plot_kind(data, kind):
6160
raise ValueError(f"invalid plot kind for {type(data)} `{data.name}`")
6261

@@ -109,7 +108,6 @@ def plot_data_array(
109108
)
110109

111110
elif data.ndim == 2:
112-
113111
if not kind.colorbar:
114112
kind.colorbar = Colorbar(
115113
label=f"{data.label}" + (f" [{data.unit}]" if data.unit else "")

nata/plugins/plot/particle.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def plot_particle_array(
4444
theme: Optional[Union[Theme, str]] = None,
4545
kind: Optional[PlotKind] = None,
4646
):
47-
4847
if kind and not is_valid_plot_kind(data, kind):
4948
raise ValueError(f"invalid plot kind for {type(data)} `{data.name}`")
5049

@@ -84,7 +83,6 @@ def plot_particle_array(
8483
)
8584

8685
if isinstance(kind, Scatter):
87-
8886
# check that color is either:
8987
# - an array with the right size
9088
# - an array with size 3/4 representing an RGB/RGBA value

nata/utils/zdf.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ def __read_float64(self):
128128
return np.fromfile(self.__file, dtype="<f8", count=1)[0]
129129

130130
def __read_string(self):
131-
132131
length = self.__read_uint32()
133132

134133
if length > 0:
@@ -207,7 +206,6 @@ def __read_float64_arr(self, nx):
207206
return data
208207

209208
def __read_arr(self, dtype, nx):
210-
211209
if dtype == 5:
212210
data = self.__read_int32_arr(nx)
213211
elif dtype == 3:
@@ -235,7 +233,6 @@ def __read_arr(self, dtype, nx):
235233
# -----------------------------------------------------------------------------
236234

237235
def read_record(self, skip=False):
238-
239236
rec = ZDF_Record()
240237
rec.pos = self.__file.tell()
241238

@@ -396,7 +393,6 @@ def read_part_info(self, rec=False):
396393
# -----------------------------------------------------------------------------
397394

398395
def read_track_info(self, rec=False):
399-
400396
if rec is False:
401397
rec = self.read_record()
402398

@@ -448,7 +444,6 @@ def read_track_info(self, rec=False):
448444
# --------------------------------------------------------------------------
449445

450446
def read_dataset(self, rec=False):
451-
452447
if rec is False:
453448
rec = self.read_record()
454449

@@ -494,7 +489,6 @@ def read_dataset(self, rec=False):
494489
# --------------------------------------------------------------------------
495490

496491
def read_cdset(self, rec=False, pos=0):
497-
498492
if rec is False:
499493
rec = self.read_record()
500494

@@ -547,7 +541,6 @@ def read_cdset(self, rec=False, pos=0):
547541

548542
name = ""
549543
while name != end_name:
550-
551544
# Read next record
552545
rec = self.read_record()
553546

@@ -580,7 +573,6 @@ def read_cdset(self, rec=False, pos=0):
580573
] = chunk
581574

582575
else:
583-
584576
self.__record_skip(rec)
585577

586578
# If requested, position file pointer at the end of the cdset_start
@@ -671,7 +663,6 @@ def read_element(self, rec=False, name=False, type_id=False):
671663
# -----------------------------------------------------------------------------
672664

673665
def read_part_data(self, quants):
674-
675666
# Read all quantities
676667
data = dict()
677668

@@ -706,7 +697,6 @@ def read_part_data(self, quants):
706697
# -----------------------------------------------------------------------------
707698

708699
def read_track_data(self, trackInfo):
709-
710700
rec = self.read_record()
711701
if rec.name != "itermap":
712702
print(

tests/plugins/fft_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99

1010

1111
def test_array_fft_invalid_ndim():
12-
1312
with pytest.raises(ValueError, match="0 dimensional GridArrays"):
1413
GridArray.from_array(1).fft()
1514

1615

1716
def test_array_fft_invalid_axis():
18-
1917
for invalid_axis in [2, -3]:
2018
with pytest.raises(ValueError, match="invalid axis index"):
2119
GridArray.from_array(
@@ -107,6 +105,5 @@ def test_dataset_fft_selection():
107105

108106

109107
def test_dataset_fft_invalid_ndim():
110-
111108
with pytest.raises(ValueError, match="0 dimensional GridDatasets"):
112109
GridDataset.from_array(np.arange(5)).fft()

0 commit comments

Comments
 (0)