Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main into develop after v0.8.6 patch release #642

Merged
merged 15 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace some use of os.path with pathlib.Path
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
  • Loading branch information
hakonanes committed May 28, 2023
commit 5a65cb18564cc965b8878e0ec4ac60962e956d49
7 changes: 3 additions & 4 deletions kikuchipy/data/edax_binary/create_dummy_edax_binary_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
in the documentation.
"""

import os
from pathlib import Path

import numpy as np
Expand All @@ -35,11 +34,11 @@
n_patterns = ny * nx
step_size = s.axes_manager["x"].scale

dir_data = Path(os.path.dirname(__file__))
DIR_DATA = Path(__file__).parent

# UP1, version 1
# --------------
with open(dir_data / "edax_binary.up1", mode="w") as file1:
with open(DIR_DATA / "edax_binary.up1", mode="w") as file1:
# File header: 16 bytes
# 4 bytes with the file version
np.array([1], "uint32").tofile(file1)
Expand All @@ -57,7 +56,7 @@
# x x x x #
# x x x #
# ------- #
with open(dir_data / "edax_binary.up2", mode="w") as file2:
with open(DIR_DATA / "edax_binary.up2", mode="w") as file2:
# File header: 42 bytes
# 4 bytes with the file version
np.array([3], "uint32").tofile(file2)
Expand Down
9 changes: 4 additions & 5 deletions kikuchipy/io/plugins/tests/test_edax_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with kikuchipy. If not, see <http://www.gnu.org/licenses/>.

import os
from pathlib import Path

import dask.array as da
import numpy as np
Expand All @@ -24,10 +24,9 @@
import kikuchipy as kp


DIR_PATH = os.path.dirname(__file__)
EDAX_PATH = os.path.join(DIR_PATH, "../../../data/edax_binary")
FILE_UP1 = os.path.join(EDAX_PATH, "edax_binary.up1")
FILE_UP2 = os.path.join(EDAX_PATH, "edax_binary.up2")
EDAX_PATH = Path(__file__).parent / "../../../data/edax_binary"
FILE_UP1 = EDAX_PATH / "edax_binary.up1"
FILE_UP2 = EDAX_PATH / "edax_binary.up2"


class TestEDAXBinaryReader:
Expand Down