Skip to content

Commit

Permalink
OVerwrite master with current stable to restart dev 0.11 tree
Browse files Browse the repository at this point in the history
  • Loading branch information
gb119 committed Dec 24, 2023
1 parent 9cde41b commit 55d2eeb
Show file tree
Hide file tree
Showing 51 changed files with 220 additions and 873 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Expand Up @@ -51,7 +51,3 @@ Backup_of_*.cdr

#Profuling
prof

#LockFiles
*.dirlock
*.lock
9 changes: 5 additions & 4 deletions README.rst
Expand Up @@ -41,7 +41,8 @@ Getting this Code
:alt: Introduction and Installation Guide to Stoner Pythin Package
:width: 320

See the `requirements.txt` file for the current package requirements.
The *Stoner* package requires h5py>=2.7.0, lmfit>=0.9.7, matplotlib>=2.0,numpy>=1.13, Pillow>=4.0,
scikit-image>=0.13.0 & scipy>=1.0.0 and also optional depends on filemagic, npTDMS, imreg_dft and numba, fabio, hyperspy.

Ananconda Python (and probably other scientific Python distributions) include nearly all of the dependencies, and the remaining
dependencies are collected together in the **phygbu** repositry on anaconda cloud. The easiest way to install the Stoner package is,
Expand All @@ -50,10 +51,10 @@ therefore, to install the most recent Anaconda Python distribution.
Compatibility
--------------

Versions 0.10.x (stable branch) are compatible with Python 3.6-3.9. The current development branch is targetting v3.8-3.9
with 3.10 added when anaconda support is available in mainstream realease.
Versions 0.9.x (stable branch) are compatible with Python 2.7, 3.5, 3.6 and 3.7. The latest 0.9.6 version is also compatible with Python 3.8
The current stable verstion (0.10, stable branch) is compatible with Python 3.6-3.9

Conda packages are built on each github release via a github actions for 64bit Python on Windows, MacOS and Linux.
Conda packages are prepared for the stable branch and when the development branch enters beta testing. Pip wheels are prepared for selected stable releases only.

Installation
------------
Expand Down
7 changes: 6 additions & 1 deletion Stoner/Analysis.py
@@ -1,12 +1,17 @@
"""Stoner .Analysis provides a subclass of :class:`.Data` that has extra analysis routines builtin."""

__all__ = ["AnalysisMixin"]
__all__ = ["AnalysisMixin", "GetAffineTransform", "ApplyAffineTransform"]
from inspect import getfullargspec
import numpy as np
import numpy.ma as ma

from scipy.integrate import cumtrapz
from scipy.optimize import curve_fit

from .tools import isiterable, isTuple
from .compat import string_types
from .core.exceptions import assertion
from .analysis.utils import threshold as _threshold, ApplyAffineTransform, GetAffineTransform

# from matplotlib.pylab import * #Surely not?

Expand Down
4 changes: 1 addition & 3 deletions Stoner/Core.py
Expand Up @@ -30,7 +30,7 @@

from .compat import string_types, int_types, index_types, _pattern_type, path_types
from .tools import all_type, isiterable, isLikeList, get_option, make_Data
from .tools.file import get_file_name_type, auto_load_classes, get_file_type
from .tools.file import get_file_name_type, auto_load_classes

from .core.exceptions import StonerLoadError, StonerSetasError
from .core import _setas, regexpDict, typeHintedDict, metadataObject
Expand Down Expand Up @@ -1369,8 +1369,6 @@ def load(cls, *args, **kargs):
filename, filetype = get_file_name_type(filename, filetype, DataFile)
elif not auto_load and not filetype:
raise StonerLoadError("Cannot read data from non-path like filenames !")
else:
filetype = get_file_type(filetype, DataFile)
if auto_load: # We're going to try every subclass we canA
ret = auto_load_classes(filename, DataFile, debug=False, args=args, kargs=kargs)
if not isinstance(ret, DataFile): # autoload returned something that wasn't a data file!
Expand Down
4 changes: 2 additions & 2 deletions Stoner/HDF5.py
Expand Up @@ -3,7 +3,7 @@
Classes include
* HDF5File - A :py:class:`Stoner.Code.DataFile` subclass that can save and load data from hdf5 files
* HDF5Folder - A :py:class:`Stoner.folders.DataFolder` subclass that can save and load data from a single hdf5 file
* HDF5Folder - A :py:class:`Stoner.Folders.DataFolder` subclass that can save and load data from a single hdf5 file
It is only necessary to import this module for the subclasses of :py:class:`Stoner.Core.DataFile` to become available
to :py:class:`Stoner.Core.Data`.
Expand Down Expand Up @@ -375,7 +375,7 @@ class HDF5FolderMixin:

"""Provides a method to load and save data from a single HDF5 file with groups.
See :py:class:`Stoner.folders.DataFolder` for documentation on constructor.
See :py:class:`Stoner.Folders.DataFolder` for documentation on constructor.
Datalayout consistns of sub-groups that are either instances of HDF5Files (i.e. have a type attribute that
contains 'HDF5File') or are themsleves HDF5Folder instances (with a type attribute that reads 'HDF5Folder').
Expand Down
9 changes: 2 additions & 7 deletions Stoner/Image/core.py
Expand Up @@ -8,7 +8,7 @@
from io import BytesIO as StreamIO
from warnings import warn

from PIL import Image, PngImagePlugin
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from scipy import ndimage as ndi
Expand All @@ -26,6 +26,7 @@
segmentation,
transform,
)

from ..core.base import typeHintedDict, metadataObject
from ..core.exceptions import StonerLoadError, StonerUnrecognisedFormat
from ..Core import DataFile
Expand All @@ -37,18 +38,12 @@
get_filedialog,
int_types,
path_types,
str2bytes,
) # Some things to help with Python2 and Python3 compatibility
from .attrs import DrawProxy, MaskProxy
from .widgets import RegionSelect
from . import imagefuncs
from ..tools.classes import Options

if "READTHEDOCS" not in os.environ:
from skimage import viewer
else:
from ..tools import null as viewer

IMAGE_FILES = [("Tiff File", "*.tif;*.tiff"), ("PNG files", "*.png", "Numpy Files", "*.npy")]

dtype_range = {
Expand Down
4 changes: 2 additions & 2 deletions Stoner/Image/folders.py
Expand Up @@ -13,7 +13,7 @@
from PIL import Image

from .core import ImageArray
from ..folders import DiskBasedFolderMixin, baseFolder
from ..Folders import DiskBasedFolderMixin, baseFolder
from ..compat import string_types, int_types
from . import ImageFile

Expand Down Expand Up @@ -366,7 +366,7 @@ def montage(self, *args, **kargs):
else:
j += 1
fig = figure(fignum)
ax = fig.add_subplot(plt_y, plt_x, j)
ax = subplot(plt_y, plt_x, j)
plt_kargs["figure"] = fig
plt_kargs["ax"] = ax
if "title" in kargs:
Expand Down
2 changes: 1 addition & 1 deletion Stoner/Image/stack.py
Expand Up @@ -9,7 +9,7 @@
from ..core.exceptions import assertion

from ..Core import regexpDict, typeHintedDict
from ..folders import DiskBasedFolderMixin, baseFolder
from ..Folders import DiskBasedFolderMixin, baseFolder

from .core import ImageArray, ImageFile
from .folders import ImageFolder, ImageFolderMixin
Expand Down
4 changes: 2 additions & 2 deletions Stoner/Util.py
Expand Up @@ -171,8 +171,8 @@ def split_up_down(data, col=None, folder=None):
object containign the data to be sorted
col (index):
is something that :py:meth:`Stoner.Core.DataFile.find_col` can use
folder (:py:class:`Stoner.folders.DataFolder` or None):
if this is an instance of :py:class:`Stoner.folders.DataFolder` then add
folder (:py:class:`Stoner.Folders.DataFolder` or None):
if this is an instance of :py:class:`Stoner.Folders.DataFolder` then add
rising and falling files to groups of this DataFolder, otherwise create a new one
Returns:
Expand Down
8 changes: 4 additions & 4 deletions Stoner/Zip.py
Expand Up @@ -4,7 +4,7 @@
Classes Include
* ZippedFile - A :py:class:`Stoner.Code.DataFile` subclass that can save and load data from a zip files
* ZipFolder - A :py:class:`Stoner.folders.DataFolder` subclass that can save and load data from a single zip file
* ZipFolder - A :py:class:`Stoner.Folders.DataFolder` subclass that can save and load data from a single zip file
"""
__all__ = ["test_is_zip", "ZippedFile", "ZipFolderMixin", "ZipFolder"]
import zipfile as zf
Expand All @@ -14,7 +14,7 @@

from .compat import string_types, str2bytes, get_filedialog, _pattern_type, path_types
from .Core import DataFile, StonerLoadError
from .folders import DiskBasedFolderMixin
from .Folders import DiskBasedFolderMixin
from .folders.core import baseFolder
from .folders.utils import pathjoin
from .tools import copy_into, make_Data
Expand Down Expand Up @@ -231,7 +231,7 @@ class ZipFolderMixin:

"""Provides methods to load and save data from a single Zip file.
See :py:class:`Stoner.folders.DataFolder` for documentation on constructor.
See :py:class:`Stoner.Folders.DataFolder` for documentation on constructor.
Note:
As this mixin class provides both read and write storage, it cannot be mixed in with another class that
Expand Down Expand Up @@ -492,7 +492,7 @@ def _save(self, f, trail):
:py:meth:`Stoner.Zip.ZipFile.save`
This routine is used by a walk_groups call - hence the prototype matches that required for
:py:meth:`Stoner.folders.DataFolder.walk_groups`.
:py:meth:`Stoner.Folders.DataFolder.walk_groups`.
"""
if not isinstance(f, DataFile):
Expand Down
2 changes: 1 addition & 1 deletion Stoner/__init__.py
Expand Up @@ -27,7 +27,7 @@

from . import core, analysis, formats, plot, tools, Image
from .core.data import Data
from .folders import DataFolder
from .Folders import DataFolder
from .Image import ImageFile, ImageFolder, ImageStack

from .tools import set_option, get_option, Options as _Options
Expand Down

0 comments on commit 55d2eeb

Please sign in to comment.