Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 23, 2024
1 parent 9aaeb9b commit f5bf8f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions oommfc/drivers/mindriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ class MinDriver(Driver):

def _checkargs(self, **kwargs):
pass # no kwargs should be checked

def check_system(self, system):
"""Checks the system has energy in it"""
if len(system.energy)==0:
if len(system.energy) == 0:
raise AttributeError("System's energy is not defined")

@property
def _x(self):
return "iteration"
7 changes: 4 additions & 3 deletions oommfc/drivers/timedriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ def _checkargs(self, **kwargs):
if n <= 0:
msg = f"Cannot drive with {n=}."
raise ValueError(msg)

def check_system(self, system):
"""Checks the system has dynamics in it"""
if len(system.dynamics)==0:
if len(system.dynamics) == 0:
raise AttributeError("System's dynamics is not defined")
if len(system.energy)==0:
if len(system.energy) == 0:
raise AttributeError("System's energy is not defined")

@property
def _x(self):
return "t"

0 comments on commit f5bf8f7

Please sign in to comment.