Skip to content

Commit 08a3c46

Browse files
authored
Merge pull request #6 from radionets-project/update_pyproject
Use dependency groups instead of optional deps for dev
2 parents 8ebc9d6 + 9c90c2f commit 08a3c46

File tree

5 files changed

+68
-36
lines changed

5 files changed

+68
-36
lines changed

.pre-commit-config.yaml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
repos:
2-
- repo: https://github.com/pycqa/isort
3-
rev: 5.12.0
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: "v5.0.0"
44
hooks:
5-
- id: isort
6-
args: ["--profile", "black", "--filter-files"]
7-
- repo: https://github.com/psf/black
8-
rev: 22.6.0
5+
- id: check-added-large-files
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-symlinks
9+
- id: check-yaml
10+
- id: debug-statements
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
- id: name-tests-test
14+
args: ["--pytest-test-first"]
15+
- id: requirements-txt-fixer
16+
- id: trailing-whitespace
17+
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: "v0.12.1"
920
hooks:
10-
- id: black-jupyter
11-
- repo: https://github.com/PyCQA/flake8
12-
rev: 4.0.1
21+
- id: ruff-format
22+
- id: ruff-check
23+
args: ["--fix", "--show-fixes"]
24+
- repo: https://github.com/codespell-project/codespell
25+
rev: v2.4.1
1326
hooks:
14-
- id: flake8
15-
args: [--max-line-length=88, "--extend-ignore=E203,E741"]
27+
- id: codespell

pyproject.toml

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
[build-system]
2-
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "pyvisgrid"
77
dynamic = ["version"]
88
description = " Grid and visualize observations of radio interferometers."
9-
readme = "README.md"
10-
authors = [{ name = "Kevin Schmitz, Tom Groß, Anno Knierim" }]
9+
readme = "README.rst"
10+
authors = [
11+
{ name = "Kevin Schmitz", email = "kevin2.schmitz@tu-dortmund.de" },
12+
{ name = "Tom Groß", email = "tom.gross@tu-dortmund.de" },
13+
{ name = "Anno Knierim", email = "anno.knierim@tu-dortmund.de" },
14+
]
1115
maintainers = [
1216
{ name = "Kevin Schmitz", email = "kevin2.schmitz@tu-dortmund.de" },
1317
{ name = "Tom Groß", email = "tom.gross@tu-dortmund.de" },
@@ -32,30 +36,46 @@ dependencies = [
3236
"astropy<=6.1.0",
3337
"click",
3438
"h5py",
35-
"ipython",
36-
"jupyter",
37-
"matplotlib",
3839
"numpy",
3940
"pandas",
41+
"matplotlib",
4042
"scipy",
4143
"toml",
4244
"torch",
4345
"tqdm",
4446
"casatools",
45-
"pyvisgen@git+https://github.com/radionets-project/pyvisgen#egg=main",
47+
"pyvisgen@git+https://github.com/radionets-project/pyvisgen.git@main",
4648
]
4749

48-
[project.optional-dependencies]
49-
50-
tests = ["h5py", "pytest >= 7.0", "pytest-cov", "tomli"]
51-
52-
dev = ["pre-commit"]
50+
[dependency-groups]
51+
tests = [
52+
"h5py",
53+
"pytest >= 7.0",
54+
"pytest-cov",
55+
"tomli",
56+
]
57+
dev = [
58+
"pre-commit",
59+
"ipython",
60+
"jupyter",
61+
{include-group = "tests"},
62+
]
5363

5464
[project.urls]
5565
repository = "https://github.com/radionets-project/pyvisgrid"
5666

57-
[tool.setuptools_scm]
58-
write_to = "pyvisgrid/_version.py"
67+
[tool.hatch.version]
68+
source = "vcs"
69+
70+
[tool.hatch.build.hooks.vcs]
71+
version-file = "pyvisgrid/_version.py"
72+
73+
74+
[tool.hatch.build.targets.wheel]
75+
packages = ["."]
5976

60-
[tool.setuptools.packages.find]
61-
where = ["."]
77+
# as long as we still directly install
78+
# pyvisgen from git we need to set this
79+
# to true
80+
[tool.hatch.metadata]
81+
allow-direct-references = true

pyvisgrid/core/gridder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def from_pyvisgen(
238238
----------
239239
240240
obs : pyvisgen.simulation.Observation
241-
The obeservation which is returned by the
241+
The observation which is returned by the
242242
``pyvisgen.simulation.vis_loop`` function.
243243
244244
vis_data : pyvisgen.simulation.Visibilities
@@ -519,7 +519,7 @@ def plot_ungridded_uv(self, **kwargs):
519519
Default is ``None``, meaning the plot won't be saved.
520520
521521
save_args : dict, optional
522-
The additional arugments passed to the ``fig.savefig`` call.
522+
The additional arguments passed to the ``fig.savefig`` call.
523523
Default is ``{"bbox_inches":"tight"}``.
524524
525525
fig : matplotlib.figure.Figure | None, optional
@@ -640,7 +640,7 @@ def plot_mask(self, stokes_component: str = "I", **kwargs):
640640
Default is ``None``, meaning the plot won't be saved.
641641
642642
save_args : dict, optional
643-
The additional arugments passed to the ``fig.savefig`` call.
643+
The additional arguments passed to the ``fig.savefig`` call.
644644
Default is ``{"bbox_inches":"tight"}``.
645645
646646
fig : matplotlib.figure.Figure | None, optional
@@ -752,7 +752,7 @@ def plot_dirty_image(self, stokes_component: str = "I", **kwargs):
752752
Default is ``None``, meaning the plot won't be saved.
753753
754754
save_args : dict, optional
755-
The additional arugments passed to the ``fig.savefig`` call.
755+
The additional arguments passed to the ``fig.savefig`` call.
756756
Default is ``{"bbox_inches":"tight"}``.
757757
758758
fig : matplotlib.figure.Figure | None, optional

pyvisgrid/core/stokes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def compute_single_stokes_component(
9393
stokes_comp_2 : int
9494
Index of second stokes visibility.
9595
sign : str
96-
Wether to add or substract ``stokes_comp_1`` and ``stokes_comp_2``.
96+
Whether to add or subtract ``stokes_comp_1`` and ``stokes_comp_2``.
9797
Valid values are ``'+'`` or ``'-'``.
9898
9999
Returns

pyvisgrid/plotting/plotting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def plot_ungridded_uv(
168168
Default is ``None``, meaning the plot won't be saved.
169169
170170
save_args : dict, optional
171-
The additional arugments passed to the ``fig.savefig`` call.
171+
The additional arguments passed to the ``fig.savefig`` call.
172172
Default is ``{"bbox_inches":"tight"}``.
173173
174174
fig : matplotlib.figure.Figure | None, optional
@@ -322,7 +322,7 @@ def plot_mask(
322322
Default is ``None``, meaning the plot won't be saved.
323323
324324
save_args : dict, optional
325-
The additional arugments passed to the ``fig.savefig`` call.
325+
The additional arguments passed to the ``fig.savefig`` call.
326326
Default is ``{"bbox_inches":"tight"}``.
327327
328328
fig : matplotlib.figure.Figure | None, optional
@@ -531,7 +531,7 @@ def plot_dirty_image(
531531
Default is ``None``, meaning the plot won't be saved.
532532
533533
save_args : dict, optional
534-
The additional arugments passed to the ``fig.savefig`` call.
534+
The additional arguments passed to the ``fig.savefig`` call.
535535
Default is ``{"bbox_inches":"tight"}``.
536536
537537
fig : matplotlib.figure.Figure | None, optional

0 commit comments

Comments
 (0)