From c30ed9fcaa43b9a691b39d7d0d4107f2a5d47e26 Mon Sep 17 00:00:00 2001 From: Neil Shephard Date: Tue, 7 May 2024 11:09:06 +0100 Subject: [PATCH] chore: topofileformats > AFMReader for module and update imports + Forgot the `topofileformats` directory that holds package needs renaming to `AFMReader`. + Updates all imports to work with new package name. --- {topofileformats => AFMReader}/__init__.py | 0 {topofileformats => AFMReader}/asd.py | 4 ++-- {topofileformats => AFMReader}/ibw.py | 4 ++-- {topofileformats => AFMReader}/io.py | 0 {topofileformats => AFMReader}/jpk.py | 4 ++-- {topofileformats => AFMReader}/logging.py | 0 {topofileformats => AFMReader}/spm.py | 4 ++-- pyproject.toml | 3 ++- 8 files changed, 10 insertions(+), 9 deletions(-) rename {topofileformats => AFMReader}/__init__.py (100%) rename {topofileformats => AFMReader}/asd.py (99%) rename {topofileformats => AFMReader}/ibw.py (96%) rename {topofileformats => AFMReader}/io.py (100%) rename {topofileformats => AFMReader}/jpk.py (97%) rename {topofileformats => AFMReader}/logging.py (100%) rename {topofileformats => AFMReader}/spm.py (97%) diff --git a/topofileformats/__init__.py b/AFMReader/__init__.py similarity index 100% rename from topofileformats/__init__.py rename to AFMReader/__init__.py diff --git a/topofileformats/asd.py b/AFMReader/asd.py similarity index 99% rename from topofileformats/asd.py rename to AFMReader/asd.py index 7e496b5..f36094f 100644 --- a/topofileformats/asd.py +++ b/AFMReader/asd.py @@ -12,8 +12,8 @@ from matplotlib import animation -from topofileformats.logging import logger -from topofileformats.io import ( +from AFMReader.logging import logger +from AFMReader.io import ( read_int32, read_int16, read_float, diff --git a/topofileformats/ibw.py b/AFMReader/ibw.py similarity index 96% rename from topofileformats/ibw.py rename to AFMReader/ibw.py index 07cbffc..8a884f2 100644 --- a/topofileformats/ibw.py +++ b/AFMReader/ibw.py @@ -6,7 +6,7 @@ import numpy as np from igor2 import binarywave -from topofileformats.logging import logger +from AFMReader.logging import logger logger.enable(__package__) @@ -66,7 +66,7 @@ def load_ibw(file_path: Path | str, channel: str) -> tuple[np.ndarray, float]: Load the image and pixel to nanometre scaling factor - 'HeightTracee' is the default channel name (the extra 'e' is not a typo!). - >>> from topofileformats.ibw import load_ibw + >>> from AFMReader.ibw import load_ibw >>> image, pixel_to_nanometre_scaling_factor = load_ibw(file_path="./my_ibw_file.ibw", channel="HeightTracee") """ logger.info(f"Loading image from : {file_path}") diff --git a/topofileformats/io.py b/AFMReader/io.py similarity index 100% rename from topofileformats/io.py rename to AFMReader/io.py diff --git a/topofileformats/jpk.py b/AFMReader/jpk.py similarity index 97% rename from topofileformats/jpk.py rename to AFMReader/jpk.py index 382c832..3776081 100644 --- a/topofileformats/jpk.py +++ b/AFMReader/jpk.py @@ -6,7 +6,7 @@ import numpy as np import tifffile -from topofileformats.logging import logger +from AFMReader.logging import logger logger.enable(__package__) @@ -63,7 +63,7 @@ def load_jpk(file_path: Path | str, channel: str) -> tuple[np.ndarray, float]: -------- Load height trace channel from the .jpk file. 'height_trace' is the default channel name. - >>> from topofileformats.jpk import load_jpk + >>> from AFMReader.jpk import load_jpk >>> image, pixel_to_nanometre_scaling_factor = load_jpk(file_path="./my_jpk_file.jpk", channel="height_trace") """ logger.info(f"Loading image from : {file_path}") diff --git a/topofileformats/logging.py b/AFMReader/logging.py similarity index 100% rename from topofileformats/logging.py rename to AFMReader/logging.py diff --git a/topofileformats/spm.py b/AFMReader/spm.py similarity index 97% rename from topofileformats/spm.py rename to AFMReader/spm.py index 603d64a..e5d554c 100644 --- a/topofileformats/spm.py +++ b/AFMReader/spm.py @@ -6,7 +6,7 @@ import pySPM import numpy as np -from topofileformats.logging import logger +from AFMReader.logging import logger logger.enable(__package__) @@ -72,7 +72,7 @@ def load_spm(file_path: Path | str, channel: str) -> tuple: Load the image and pixel to nanometre scaling factor, available channels are 'Height', 'ZSensor' and 'Height Sensor'. - >>> from topofileformats.spm import load_spm + >>> from AFMReader.spm import load_spm >>> image, pixel_to_nm = load_spm(file_path="path/to/file.spm", channel="Height") ``` """ diff --git a/pyproject.toml b/pyproject.toml index 42049e4..d3d8755 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,8 @@ dev = [ "pytest", "pytest-cov", "pylint", - "ruff" + "ruff", + "setuptools_scm[toml]", ] [project.urls]