Skip to content

Commit f9ed3d1

Browse files
authored
Merge pull request #67 from boutproject/merge-boututils
Merge `boututils` into `boutdata`
2 parents d9b8187 + 3d737da commit f9ed3d1

66 files changed

Lines changed: 6531 additions & 23 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/formatting.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Formatting (black & isort)
2+
on:
3+
push:
4+
branches: master
5+
paths:
6+
- '**.py'
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
jobs:
13+
format:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Setup Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: 3.x
21+
- name: Install black
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install black isort
25+
- name: Version
26+
run: |
27+
python --version
28+
black --version
29+
isort --version
30+
- name: Run black
31+
run: |
32+
black boututils
33+
- name: Run isort
34+
run: |
35+
isort boututils
36+
- uses: stefanzweifel/git-auto-commit-action@v4
37+
with:
38+
commit_message: "[skip ci] Apply black/isort changes"

.github/workflows/test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Test and lint
22

33
on:
44
# Run each time we push and pull requests
@@ -10,10 +10,8 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
# As we are running on different environments, we are splitting the jobs
14-
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobs
15-
local:
16-
runs-on: ${{ matrix.os }}
13+
test:
14+
runs-on: ubuntu-latest
1715
strategy:
1816
fail-fast: true
1917
matrix:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,5 @@ dmypy.json
127127
.idea/
128128
*.sw[po]
129129

130-
boutdata/_version.py
130+
src/boutdata/_version.py
131+
src/boututils/_version.py

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,15 @@
77
[![PEP8](https://img.shields.io/badge/code%20style-PEP8-brightgreen.svg)](https://www.python.org/dev/peps/pep-0008/)
88
[![License](https://img.shields.io/badge/license-LGPL--3.0-blue.svg)](https://github.com/boutproject/boutdata/blob/master/LICENSE)
99

10-
pip-package of what is found in `BOUT-dev/tools/pylib/boutdata`.
11-
Note that `BOUT-dev/tools/pylib/boutdata` will likely be replaced by this repo
12-
in `BOUT++ v4.3.0`.
13-
See [this issue](https://github.com/boutproject/BOUT-dev/issues/1347),
14-
[this pull request](https://github.com/boutproject/BOUT-dev/pull/1766) and
15-
[this pull request](https://github.com/boutproject/BOUT-dev/pull/1740) for details.
10+
Python tools for working with [BOUT++](https://github.com/boutproject/BOUT-dev.git).
1611

1712
> **NOTE**: This package will likely be superseded by
1813
[`xBOUT`](https://github.com/boutproject/xBOUT) in the near future
1914

2015
# Dependencies
2116

22-
`boutdata` depends on `boututils` which again depends on
23-
[`netcfd4`](https://github.com/Unidata/netcdf4-python) which requires
24-
[`HDF5`](https://www.h5py.org) and
17+
`boutdata` uses [`netcfd4`](https://github.com/Unidata/netcdf4-python)
18+
which requires [`HDF5`](https://www.h5py.org) and
2519
[`netcdf-4`](https://github.com/Unidata/netcdf-c/releases) are
2620
installed, and that the `nc-config` utility is in your `PATH`. This
2721
can be install with

pyproject.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ keywords = [
2828
"data-visualization",
2929
]
3030
license = {text = "GNU Lesser General Public License v3 or later (LGPLv3+)"}
31-
authors = [{name = "Ben Dudson", email = "benjamin.dudson@york.ac.uk"}]
31+
authors = [{name = "Ben Dudson", email = "benjamin.dudson@york.ac.uk"}, {name = "BOUT++ team"}]
3232
urls = {project = "https://github.com/boutproject/boutdata"}
3333
dependencies = [
3434
"sympy>=1.5.1",
3535
"numpy>=1.22.0",
3636
"matplotlib>=3.2.1",
3737
"natsort>=8.1.0",
3838
"scipy>=1.4.1",
39-
"boututils>=0.1.9",
39+
"netCDF4",
4040
]
4141
dynamic = ["version"]
4242

@@ -52,14 +52,11 @@ docs = [
5252
[project.scripts]
5353
bout-squashoutput = "boutdata.scripts.bout_squashoutput:main"
5454

55-
[tool.setuptools]
56-
packages = ["boutdata"]
57-
5855
[tool.setuptools.dynamic]
5956
version = { attr = "setuptools_scm.get_version" }
6057

6158
[tool.setuptools_scm]
62-
write_to = "boutdata/_version.py"
59+
write_to = "src/boutdata/_version.py"
6360

6461
[tool.pytest.ini_options]
6562
addopts = "--cov=boutdata"
Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
""" Routines for exchanging data to/from BOUT++ """
22

3-
# Import this, as this almost always used when calling this package
43
from boutdata.collect import collect, attributes
4+
from boututils.boutarray import BoutArray
5+
from boututils.boutwarnings import alwayswarn
6+
from boututils.run_wrapper import (
7+
launch,
8+
launch_safe,
9+
shell,
10+
shell_safe,
11+
determineNumberOfCPUs,
12+
build_and_log,
13+
)
514

6-
__all__ = ["attributes", "collect", "gen_surface", "pol_slice"]
15+
16+
__all__ = [
17+
"attributes",
18+
"collect",
19+
"gen_surface",
20+
"pol_slice",
21+
"BoutArray",
22+
"alwayswarn",
23+
"launch",
24+
"launch_safe",
25+
"shell",
26+
"shell_safe",
27+
"determineNumberOfCPUs",
28+
"build_and_log",
29+
]
730

831
__name__ = "boutdata"
932

File renamed without changes.

0 commit comments

Comments
 (0)