From 1f6bc60a86995a176e583ef59e9e115bd913719b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:54:18 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/interactive_plotting.ipynb | 1 - micromagneticdata/__init__.py | 1 + micromagneticdata/combined_drive.py | 1 - micromagneticdata/data.py | 2 +- micromagneticdata/drive.py | 2 +- micromagneticdata/mumax3drive.py | 3 +-- micromagneticdata/oommfdrive.py | 1 - tasks.py | 1 + 8 files changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/interactive_plotting.ipynb b/docs/interactive_plotting.ipynb index 233a0b6..8f8d58c 100644 --- a/docs/interactive_plotting.ipynb +++ b/docs/interactive_plotting.ipynb @@ -597,7 +597,6 @@ "source": [ "import os\n", "\n", - "import discretisedfield as df\n", "import discretisedfield.tools as dft\n", "import numpy as np\n", "\n", diff --git a/micromagneticdata/__init__.py b/micromagneticdata/__init__.py index 336e3c9..18fb1d2 100644 --- a/micromagneticdata/__init__.py +++ b/micromagneticdata/__init__.py @@ -1,4 +1,5 @@ """Analyse micromagnetic data.""" + import importlib.metadata import pytest diff --git a/micromagneticdata/combined_drive.py b/micromagneticdata/combined_drive.py index 086f14b..2398e8f 100644 --- a/micromagneticdata/combined_drive.py +++ b/micromagneticdata/combined_drive.py @@ -4,7 +4,6 @@ import ubermagutil as uu import micromagneticdata as md - from .abstract_drive import AbstractDrive diff --git a/micromagneticdata/data.py b/micromagneticdata/data.py index 86f867c..536b41e 100644 --- a/micromagneticdata/data.py +++ b/micromagneticdata/data.py @@ -51,7 +51,7 @@ def __init__(self, name, dirname="./"): if not os.path.exists(self.path): msg = f"Directory {self.path=} cannot be found." - raise IOError(msg) + raise OSError(msg) def __repr__(self): """Representation string. diff --git a/micromagneticdata/drive.py b/micromagneticdata/drive.py index dc74e7a..70e4479 100644 --- a/micromagneticdata/drive.py +++ b/micromagneticdata/drive.py @@ -98,7 +98,7 @@ def __init__(self, name, number, dirname="./", x=None, use_cache=False, **kwargs self.drive_path = pathlib.Path(f"{dirname}/{name}/drive-{number}") if not self.drive_path.exists(): msg = f"Directory {self.drive_path!r} does not exist." - raise IOError(msg) + raise OSError(msg) self.use_cache = use_cache self.name = name diff --git a/micromagneticdata/mumax3drive.py b/micromagneticdata/mumax3drive.py index 677574f..b512130 100644 --- a/micromagneticdata/mumax3drive.py +++ b/micromagneticdata/mumax3drive.py @@ -3,7 +3,6 @@ import ubermagutil as uu import micromagneticdata as md - from .abstract_drive import AbstractDrive @@ -67,7 +66,7 @@ def __init__(self, name, number, dirname="./", x=None, use_cache=False, **kwargs f"{dirname}/{name}/drive-{number}/{name}.out" ) # required to initialise self.x in super if not self._mumax_output_path.exists(): - raise IOError( + raise OSError( f"Output directory {self._mumax_output_path!r} does not exist." ) diff --git a/micromagneticdata/oommfdrive.py b/micromagneticdata/oommfdrive.py index 0381c5f..7f9376e 100644 --- a/micromagneticdata/oommfdrive.py +++ b/micromagneticdata/oommfdrive.py @@ -1,7 +1,6 @@ import ubermagutil as uu import micromagneticdata as md - from .abstract_drive import AbstractDrive diff --git a/tasks.py b/tasks.py index 8527c76..430af1e 100644 --- a/tasks.py +++ b/tasks.py @@ -1,4 +1,5 @@ """Tasks to release the package.""" + import os import shutil