Skip to content

Commit

Permalink
Merge pull request #7542 from sunpy/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
nabobalis committed Apr 2, 2024
2 parents 2bc40c0 + 25c3805 commit 0886efa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: "\\.asdf$"
repos:
# This should be before any formatting hooks like isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.2.1"
rev: "v0.3.5"
hooks:
- id: ruff
args: ["--fix"]
Expand Down
3 changes: 1 addition & 2 deletions sunpy/coordinates/sun.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,7 @@ def print_params(t='now'):
print(f'True (long, lat) = ({true_longitude(t).to_string()}, {true_latitude(t).to_string()})')
print(f'Apparent (long, lat) = ({apparent_longitude(t).to_string()}, {apparent_latitude(t).to_string()})')
print(f'True (RA, Dec) = ({true_rightascension(t).to_string()}, {true_declination(t).to_string()})')
print('Apparent (RA, Dec) = ({}, {})'.format(apparent_rightascension(t).to_string(),
apparent_declination(t).to_string()))
print(f'Apparent (RA, Dec) = ({apparent_rightascension(t).to_string()}, {apparent_declination(t).to_string()})')
print(f'Heliographic long. and lat of disk center = ({L0(t).to_string()}, {B0(t).to_string()})')
print(f'Position angle of north pole = {P(t)}')
print(f'Carrington rotation number = {carrington_rotation_number(t)}')
Expand Down
6 changes: 1 addition & 5 deletions sunpy/net/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ def __init__(self, pattern, regex=False, **kwargs):
else:
now = datetime.now()
milliseconds_ = int(now.microsecond / 1000.)
self.now = now.strftime('{start}{milli:03d}{end}'.format(
start=self.pattern[0:milliseconds.start()],
milli=milliseconds_,
end=self.pattern[milliseconds.end():]
))
self.now = now.strftime(f'{self.pattern[0:milliseconds.start()]}{milliseconds_:03d}{self.pattern[milliseconds.end():]}')

def matches(self, filepath, date):
return date.strftime(self.pattern) == filepath
Expand Down
7 changes: 3 additions & 4 deletions sunpy/util/datatype_factory_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@ def register(self, WidgetType, validation_function=None, is_default=False):
found = True
break
else:
raise ValidationFunctionError("{}.{} must be a classmethod."
.format(WidgetType.__name__, vfunc_str))
raise ValidationFunctionError(f"{WidgetType.__name__}.{vfunc_str} must be a classmethod.")
if not found:
raise ValidationFunctionError("No proper validation function for class {} "
"found.".format(WidgetType.__name__))
raise ValidationFunctionError(f"No proper validation function for class {WidgetType.__name__} "
"found.")

def unregister(self, WidgetType):
"""
Expand Down

0 comments on commit 0886efa

Please sign in to comment.