Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update pre-commit hooks #42

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ ci:

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "24.2.0"
rev: "24.8.0"
hooks:
- id: black-jupyter

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: "1.18.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.*]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v4.6.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -49,7 +49,7 @@ repos:
args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.2"
rev: "v0.6.2"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -65,7 +65,7 @@ repos:
# - pytest

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
rev: "v2.3.0"
hooks:
- id: codespell
additional_dependencies:
Expand All @@ -92,12 +92,12 @@ repos:
exclude: .pre-commit-config.yaml

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.19
hooks:
- id: validate-pyproject

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.0
rev: 0.29.2
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
17 changes: 8 additions & 9 deletions notebooks/IO tests.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
"metadata": {},
"outputs": [],
"source": [
"import astropy.table as apt\n",
"from __future__ import annotations\n",
"\n",
"import asdf\n",
"from astropy.coordinates import SkyCoord\n",
"import astropy.units as u"
"import astropy.table as apt\n",
"import astropy.units as u\n",
"from astropy.coordinates import SkyCoord"
]
},
{
Expand Down Expand Up @@ -242,14 +244,11 @@
"metadata": {},
"outputs": [],
"source": [
"import galstreams as gst\n",
"from matplotlib.path import Path as mpl_path\n",
"from astropy.table import Table\n",
"import asdf\n",
"import astropy.units as u\n",
"from astropy.coordinates import SkyCoord\n",
"from gala.coordinates import GreatCircleICRSFrame\n",
"import numpy as np"
"import galstreams as gst\n",
"import numpy as np\n",
"from astropy.coordinates import SkyCoord"
]
},
{
Expand Down
12 changes: 5 additions & 7 deletions notebooks/Stream-data-pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,19 @@
},
"outputs": [],
"source": [
"from __future__ import annotations\n",
"\n",
"import astropy.coordinates as coord\n",
"import astropy.table as at\n",
"import astropy.units as u\n",
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"\n",
"%matplotlib inline\n",
"import numpy as np\n",
"import scipy.interpolate as sci\n",
"\n",
"import gala.coordinates as gc\n",
"from pyia import GaiaData\n",
"import galstreams\n",
"import sys\n",
"\n",
"import galstreams\n",
"from pyia import GaiaData\n",
"\n",
"sys.path.append(\"../\")\n",
"import cats.photometry as phot\n",
"from cats.data import make_astro_photo_joined_data"
Expand Down
11 changes: 5 additions & 6 deletions notebooks/Stream-subset-Gaia-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,23 @@
}
],
"source": [
"from __future__ import annotations\n",
"\n",
"import pathlib\n",
"import warnings\n",
"\n",
"import astropy.coordinates as coord\n",
"import astropy.table as at\n",
"from astropy.io import fits\n",
"import astropy.units as u\n",
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from astropy.io import fits\n",
"\n",
"%matplotlib inline\n",
"from tqdm import tqdm\n",
"from scipy.interpolate import InterpolatedUnivariateSpline\n",
"\n",
"import galstreams\n",
"from astroquery.gaia import Gaia\n",
"from pyia import GaiaData\n",
"from astroquery.gaia import Gaia"
"from scipy.interpolate import InterpolatedUnivariateSpline"
]
},
{
Expand Down
36 changes: 15 additions & 21 deletions notebooks/Testing_Isochrones.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
"metadata": {},
"outputs": [],
"source": [
"from __future__ import annotations\n",
"\n",
"try:\n",
" from urllib.error import URLError\n",
" from urllib.parse import urlencode\n",
" from urllib.request import urlopen\n",
" from urllib.error import URLError\n",
"except ImportError:\n",
" from urllib import urlencode\n",
" from urllib2 import urlopen, URLError"
"\n",
" from urllib2 import URLError, urlopen"
]
},
{
Expand All @@ -31,34 +34,28 @@
"metadata": {},
"outputs": [],
"source": [
"from urllib.parse import urlencode\n",
"from urllib.request import urlopen\n",
"from urllib.error import URLError\n",
"\n",
"import os\n",
"import sys\n",
"import glob\n",
"import copy\n",
"from collections import OrderedDict as odict\n",
"from urllib.error import URLError\n",
"from urllib.parse import urlencode\n",
"from urllib.request import urlopen\n",
"\n",
"# For downloading isochrones...\n",
"try:\n",
" from urllib.error import URLError\n",
" from urllib.parse import urlencode\n",
" from urllib.request import urlopen\n",
" from urllib.error import URLError\n",
"except ImportError:\n",
" from urllib import urlencode\n",
" from urllib2 import urlopen, URLError\n",
"\n",
"import subprocess\n",
" from urllib2 import urlopen\n",
"\n",
"import re\n",
"import subprocess\n",
"\n",
"import numpy as np\n",
"import scipy.spatial\n",
"\n",
"from ugali.utils.logger import logger\n",
"from ugali.isochrone.model import Isochrone\n",
"from ugali.isochrone.model import get_iso_dir"
"from ugali.utils.logger import logger"
]
},
{
Expand Down Expand Up @@ -317,7 +314,7 @@
"metadata": {},
"outputs": [],
"source": [
"out = \"{0}/tmp/{1}.dat\".format(server, fname[0])\n",
"out = f\"{server}/tmp/{fname[0]}.dat\"\n",
"\n",
"cmd = \"wget --progress dot:binary %s -O %s\" % (out, outfile)\n",
"logger.debug(cmd)\n",
Expand Down Expand Up @@ -475,9 +472,7 @@
"id": "179f7696",
"metadata": {},
"outputs": [],
"source": [
"import isochrones"
]
"source": []
},
{
"cell_type": "code",
Expand Down Expand Up @@ -1013,7 +1008,6 @@
"source": [
"import numpy as np\n",
"import scipy\n",
"from scipy.interpolate import interp1d\n",
"\n",
"age, feh, eep, dist = [10, -1.4, None, 10]\n",
"\n",
Expand Down
Loading