Skip to content

Commit

Permalink
flake fixes
Browse files Browse the repository at this point in the history
Former-commit-id: e59bf62
  • Loading branch information
bsavitzky committed Nov 15, 2023
1 parent 272a3f5 commit 18a947c
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion test/gettestdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import argparse
from os.path import join, exists
from os.path import exists
from os import makedirs

from py4DSTEM import _TESTPATH as testpath
Expand Down
4 changes: 2 additions & 2 deletions test/test_braggvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setup_class(cls):
# tests

def test_BraggVectors_import(self):
from py4DSTEM.braggvectors import BraggVectors
from py4DSTEM.braggvectors import BraggVectors # noqa: F401

pass

Expand All @@ -67,7 +67,7 @@ def test_disk_detection_selected_positions(self):
68,
)

disks_selected = self.datacube.find_Bragg_disks(
disks_selected = self.datacube.find_Bragg_disks( # noqa: F841
data=(rxs, rys),
template=self.probe.kernel,
**self.detect_params,
Expand Down
1 change: 0 additions & 1 deletion test/test_crystal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import numpy as np

# from py4DSTEM.classes import (
# Crystal
Expand Down
6 changes: 3 additions & 3 deletions test/test_native_io/test_calibration_io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py4DSTEM
import numpy as np
from os.path import join
#import py4DSTEM
#import numpy as np
#from os.path import join

# set filepath
# path = join(py4DSTEM._TESTPATH, "filename")
Expand Down
3 changes: 2 additions & 1 deletion test/test_native_io/test_realslice_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@


def test_read_realslice():
realslice = py4DSTEM.read(filepath, datapath="4DSTEM/Fit Data")
realslice = py4DSTEM.read(filepath, datapath="4DSTEM/Fit Data") # noqa: F841

5 changes: 1 addition & 4 deletions test/test_native_io/test_single_object_io.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import numpy as np
from os.path import join, exists
from os import remove
from os.path import join
from numpy import array_equal

import py4DSTEM
from py4DSTEM import save, read
import emdfile as emd

from py4DSTEM import (
Calibration,
DiffractionSlice,
RealSlice,
QPoints,
Expand Down
4 changes: 2 additions & 2 deletions test/test_native_io/test_v0_14.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _make_v14_test_file():
alpha, qx0, qy0 = py4DSTEM.process.probe.get_probe_size(probe.probe)

# prepare the probe kernel
kern = probe.get_kernel(mode="sigmoid", origin=(qx0, qy0), radii=(alpha, 2 * alpha))
kern = probe.get_kernel(mode="sigmoid", origin=(qx0, qy0), radii=(alpha, 2 * alpha)) # noqa: F841

# Set disk detection parameters
detect_params = {
Expand All @@ -54,7 +54,7 @@ def _make_v14_test_file():
}

# compute
braggpeaks = datacube.find_Bragg_disks(
braggpeaks = datacube.find_Bragg_disks( # noqa: F841
template=probe.kernel,
**detect_params,
)
Expand Down
1 change: 0 additions & 1 deletion test/test_probe.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import py4DSTEM
from py4DSTEM import Probe
import numpy as np
from os.path import join

# set filepath
path = py4DSTEM._TESTPATH + "/small_datacube.dm4"
Expand Down
1 change: 0 additions & 1 deletion test/test_strain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import py4DSTEM
from py4DSTEM import StrainMap
from os.path import join
from numpy import zeros


# set filepath
Expand Down
2 changes: 1 addition & 1 deletion test/test_workflow/test_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_show(self):
# virtual diffraction and imaging

def test_virt_diffraction(self):
dp_mean = self.datacube.get_dp_mean()
dp_mean = self.datacube.get_dp_mean() # noqa: F841
self.datacube.get_dp_max()

def test_virt_imaging_bf(self):
Expand Down
4 changes: 2 additions & 2 deletions test/test_workflow/test_disk_detection_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def test_disk_detection_selected_positions(self):
68,
)

disks_selected = self.datacube.find_Bragg_disks(
disks_selected = self.datacube.find_Bragg_disks( # noqa: F841
data=(rxs, rys),
template=self.probe.kernel,
**self.detect_params,
)

def test_disk_detection(self):
braggpeaks = self.datacube.find_Bragg_disks(
braggpeaks = self.datacube.find_Bragg_disks( # noqa: F841
template=self.probe.kernel,
**self.detect_params,
)
2 changes: 1 addition & 1 deletion test/test_workflow/test_disk_detection_with_calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def setup_class(cls):
# tests

def test_disk_detection(self):
braggpeaks = self.datacube.find_Bragg_disks(
braggpeaks = self.datacube.find_Bragg_disks( # noqa: F841
template=self.probe.kernel,
**self.detect_params,
)
Expand Down

0 comments on commit 18a947c

Please sign in to comment.