From 9d208a3b70be3437190913f6fde1793041c762af Mon Sep 17 00:00:00 2001 From: Gavin Burnell Date: Wed, 3 Jan 2024 14:04:58 +0000 Subject: [PATCH] emove FileFormats from repository and some minor cleanups --- README.rst | 4 +-- Stoner/FileFormats.py | 63 ------------------------------------ doc/UserGuide/cookbook.rst | 5 ++- doc/UserGuide/datafolder.rst | 3 +- doc/readme.rst | 4 +-- 5 files changed, 7 insertions(+), 72 deletions(-) delete mode 100755 Stoner/FileFormats.py diff --git a/README.rst b/README.rst index a897f31a2..a00d6c88c 100755 --- a/README.rst +++ b/README.rst @@ -1,8 +1,8 @@ .. image:: https://github.com/stonerlab/Stoner-PythonCode/actions/workflows/run-tests-action.yaml/badge.svg?branch=master :target: https://github.com/stonerlab/Stoner-PythonCode/actions/workflows/run-tests-action.yaml -.. image:: https://coveralls.io/repos/github/stonerlab/Stoner-PythonCode/badge.svg?branch=master - :target: https://coveralls.io/github/stonerlab/Stoner-PythonCode?branch=master +.. image:: https://app.codacy.com/project/badge/Coverage/a9069a1567114a22b25d63fd4c50b228 + :target: https://app.codacy.com/gh/stonerlab/Stoner-PythonCode/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage .. image:: https://app.codacy.com/project/badge/Grade/a9069a1567114a22b25d63fd4c50b228 :target: https://app.codacy.com/gh/stonerlab/Stoner-PythonCode/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade diff --git a/Stoner/FileFormats.py b/Stoner/FileFormats.py deleted file mode 100755 index 223c17a59..000000000 --- a/Stoner/FileFormats.py +++ /dev/null @@ -1,63 +0,0 @@ -"""Provides extra classes that can load data from various instruments into _SC_.DataFile type objects. - -You do not need to use these classes directly, they are made available to :py:class:`Stoner.Core.Data` which -will load each of them in turn when asked to load an unknown data file. - -Each class has a priority attribute that is used to determine the order in which -they are tried by :py:class:`Stoner.Core.Data` and friends where trying to load data. -High priority is run last (so is a bit of a misnomer!). - -Each class should implement a load() method and optionally a save() method. Classes should make every effort to -positively identify that the file is one that they understand and throw a -:py:exception:Stoner.Core._SC_.StonerLoadError` if not. -""" - -from warnings import warn - -__all__ = [ - "BNLFile", - "BigBlueFile", - "BirgeIVFile", - "CSVFile", - "EasyPlotFile", - "ESRF_DataFile", - "ESRF_ImageFile", - "FmokeFile", - "GenXFile", - "HyperSpyFile", - "KermitPNGFile", - "LSTemperatureFile", - "MDAASCIIFile", - "MokeFile", - "OVFFile", - "OpenGDAFile", - "PinkLibFile", - "QDFile", - "RasorFile", - "RigakuFile", - "SNSFile", - "SPCFile", - "TDMSFile", - "VSMFile", - "XRDFile", -] -# pylint: disable=unused-argument -from Stoner.formats.instruments import LSTemperatureFile, QDFile, RigakuFile, SPCFile, VSMFile, XRDFile -from Stoner.formats.facilities import ( - BNLFile, - MDAASCIIFile, - OpenGDAFile, - RasorFile, - SNSFile, - ESRF_DataFile, - ESRF_ImageFile, -) -from Stoner.formats.generic import CSVFile, KermitPNGFile, TDMSFile, HyperSpyFile -from Stoner.formats.rigs import BigBlueFile, BirgeIVFile, MokeFile, FmokeFile, EasyPlotFile, PinkLibFile -from Stoner.formats.simulations import GenXFile, OVFFile - -warn( - "*" * 80 - + "\nStoner.FileFormats is a deprecated module - use Stoner.formats and it's sub-modules now!\n" - + "*" * 80 -) diff --git a/doc/UserGuide/cookbook.rst b/doc/UserGuide/cookbook.rst index ddd97f25a..0ba90e3ed 100755 --- a/doc/UserGuide/cookbook.rst +++ b/doc/UserGuide/cookbook.rst @@ -202,9 +202,8 @@ modelling codes, such OOMMF or MuMax. When modelling a 3D system, it is often us be able to examine a cross-section of the simulation. The Stoner package provides tools to quickly examine the output data:: - from Stoner.FileFormats import OVFFile # reads OOMMF vector field files - import Stoner.plot - p=SP.PlotFile('my_simulation.ovf') + from Stoner import Data + p=Data('my_simulation.ovf') p.setas="xyzuvw" p=p.section(z=10.5) # Take a slice in the xy plane where z is 10.5 nm p.plot() # A 3D plot with cones diff --git a/doc/UserGuide/datafolder.rst b/doc/UserGuide/datafolder.rst index a6192cb23..fbcea6bf7 100755 --- a/doc/UserGuide/datafolder.rst +++ b/doc/UserGuide/datafolder.rst @@ -46,8 +46,7 @@ then a new instance *f* is created. The optional *pattern* keyword is used to on the files with a .dat extension. In this example, it is assumed that the files are readable by the :py:class:`Stoner.Core.Data` general class, if they are in some other format then the 'type' keyword can be used:: - from Stoner.FileFormats import XRDFile - f=DataFolder(type=XRDFile,pattern='*.dql') + f=DataFolder(type="XRDFile",pattern='*.dql') Strictly, the class pointed to be a the *type* keyword should be a sub class of :py:class:`Stoner.Core.metadataObject` and should have a constructor that undersatands the initial string parameter to be a filename to load the object from. The class diff --git a/doc/readme.rst b/doc/readme.rst index a897f31a2..a00d6c88c 100755 --- a/doc/readme.rst +++ b/doc/readme.rst @@ -1,8 +1,8 @@ .. image:: https://github.com/stonerlab/Stoner-PythonCode/actions/workflows/run-tests-action.yaml/badge.svg?branch=master :target: https://github.com/stonerlab/Stoner-PythonCode/actions/workflows/run-tests-action.yaml -.. image:: https://coveralls.io/repos/github/stonerlab/Stoner-PythonCode/badge.svg?branch=master - :target: https://coveralls.io/github/stonerlab/Stoner-PythonCode?branch=master +.. image:: https://app.codacy.com/project/badge/Coverage/a9069a1567114a22b25d63fd4c50b228 + :target: https://app.codacy.com/gh/stonerlab/Stoner-PythonCode/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage .. image:: https://app.codacy.com/project/badge/Grade/a9069a1567114a22b25d63fd4c50b228 :target: https://app.codacy.com/gh/stonerlab/Stoner-PythonCode/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade