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

Merge boututils into boutdata #67

Merged
merged 137 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
71faff3
first commit
loeiten May 24, 2019
2209dda
Added files
loeiten May 24, 2019
68c7b6a
pip 0.1.0 commit
loeiten May 24, 2019
07c7517
Fixed netcdf error
loeiten May 24, 2019
d7a9262
Addressing the mayavi issue
loeiten May 24, 2019
4691501
Added .travis.yml
loeiten May 24, 2019
090c3b4
Fixes to travis and README
loeiten May 24, 2019
29c9484
Added import test
loeiten May 24, 2019
e1b0229
Added secret
loeiten May 24, 2019
9728460
Updated README with links to PRs and issues
loeiten Aug 18, 2019
9dc1448
Make mayavi an optional dependency
johnomotani Oct 25, 2019
fc723b7
Make mayavi optional in requirements.txt
johnomotani Oct 25, 2019
6cf46fc
Bump version number
johnomotani Oct 26, 2019
e9dce6a
Merge pull request #3 from boutproject/optional-mayavi
loeiten Oct 26, 2019
3c9217a
Typofixes
loeiten Apr 11, 2020
c274642
Bumped versions in requirements.txt
loeiten Apr 14, 2020
bc93170
Added cftime
loeiten Apr 14, 2020
5f0c2e5
Added --ignore-installed
loeiten Apr 14, 2020
49ed81a
Uninstall previous numpy version
loeiten Apr 14, 2020
f7215dd
Merge pull request #4 from boutproject/6_build_failing
loeiten Apr 14, 2020
3672ead
Updated website info
loeiten May 4, 2020
c2a3226
http -> https
loeiten May 5, 2020
ed445a3
Updated contour link
loeiten May 5, 2020
82ff77b
Merge pull request #7 from boutproject/6_website
loeiten May 5, 2020
7ed3a7b
Support FieldPerp in DataFile
johnomotani Jul 5, 2020
dcf0b57
Use comma in single-element tuples
johnomotani Jul 6, 2020
6e0fbe6
Merge pull request #8 from boutproject/fieldperp-support
johnomotani Jul 6, 2020
620a42e
Merge changes from BOUT-dev
dschwoerer Sep 19, 2020
f599a57
remove bunch
dschwoerer Sep 20, 2020
986d518
Moved test directory
loeiten Sep 21, 2020
c0cdb17
Merge pull request #11 from boutproject/9_move_test
loeiten Sep 21, 2020
073ff33
Merge pull request #10 from boutproject/pylib_merge
johnomotani Oct 31, 2020
cc1f090
Added automatic release
loeiten Dec 21, 2020
a65d9a7
Updates from review #1
loeiten Dec 21, 2020
b9045e4
Fixes from reveiw 2
loeiten Dec 22, 2020
2610609
Support passing test arguments with CMake
johnomotani Jan 3, 2021
5b08322
Fix typo in showdata gif save
johnomotani Jan 3, 2021
380da7c
Support string-like variables in DataFile
johnomotani Jan 3, 2021
9b17a3c
Merge pull request #14 from boutproject/bout-dev-updates
bendudson Jan 3, 2021
545e46b
Merge pull request #15 from boutproject/string-support
bendudson Jan 3, 2021
f0ada15
Merge pull request #13 from boutproject/automatic_release
johnomotani Jan 3, 2021
ab394cb
When getting version with setuptools_scm, resolve __file__ path
johnomotani Jan 4, 2021
7ccff96
Add missing comma
johnomotani Jan 4, 2021
93d9599
Don't pip-install boututils on Travis
johnomotani Jan 4, 2021
e799596
Install setuptools_scm for Travis test
johnomotani Jan 4, 2021
9a1e904
Install requirements in Travis job
johnomotani Jan 4, 2021
3d7ac26
Simplify requirments installation for CI
johnomotani Jan 4, 2021
9cc3cd4
Install pytest-cov on Travis
ZedThree Jan 4, 2021
1db58c0
Merge pull request #16 from boutproject/resolve-path-for-version
ZedThree Jan 4, 2021
b7ba9ac
Converted travis to actions
loeiten Jan 5, 2021
2bb5cc6
Removed 3.9 as it seems unavailable on ubuntu atm
loeiten Jan 5, 2021
553f069
Installing missing codecov package
loeiten Jan 5, 2021
eb7d4aa
Update .github/workflows/test.yml
loeiten Jan 5, 2021
2f16de1
Fall-back to avoid hard dependency on setuptools_scm
johnomotani Jan 5, 2021
08b572d
Merge pull request #20 from boutproject/setuptools_scm-fallback
johnomotani Jan 5, 2021
ea63a77
Added coverage file
loeiten Jan 5, 2021
3c4bd15
Added linting files (without actually linting)
loeiten Jan 8, 2021
0a61f11
Passed black, whitespace, eof, prettier, isort
loeiten Jan 9, 2021
2b8818c
Fixed flake8 complaints
loeiten Jan 9, 2021
1b595ef
Merge branch '17_travis_to_actions' into 19_linting
loeiten Jan 10, 2021
c52d616
Remove contour.py as it seems to be unfinished
bendudson Jan 10, 2021
62709af
Change non-working example into docstring
bendudson Jan 10, 2021
9f0abfd
Remove #! and +x permission
dschwoerer Jan 17, 2021
61a8da7
Merge pull request #21 from boutproject/19_linting
johnomotani Jan 18, 2021
a7176c5
Merge pull request #18 from boutproject/17_travis_to_actions
loeiten Jan 18, 2021
db460ea
Merge branch 'master' into remove-contour
loeiten Jan 18, 2021
7059a6e
Merge branch 'master' into boutgrid-docs
loeiten Jan 18, 2021
e9a411f
Merge pull request #28 from boutproject/remove-contour
loeiten Jan 18, 2021
e05d5aa
Merge branch 'master' into shebang
loeiten Jan 18, 2021
4d1792b
Merge pull request #29 from boutproject/boutgrid-docs
loeiten Jan 18, 2021
d85070b
Merge pull request #30 from boutproject/shebang
loeiten Jan 18, 2021
0630c08
Read and write file-level attributes in DataFile
johnomotani Jan 18, 2021
e8b8468
Merge pull request #31 from boutproject/file-attributes
johnomotani Jan 19, 2021
9cf1392
fix __all__
dschwoerer Feb 15, 2021
f875382
raise errors that cannot be handeled
dschwoerer Feb 17, 2021
d45df12
using .get with default value avoids need for excpetion
dschwoerer Feb 17, 2021
6e76bee
disable comments
dschwoerer Apr 23, 2021
05d4c20
Cleanup
dschwoerer May 10, 2021
1b46157
run on all branches
dschwoerer May 10, 2021
dff94ba
Empty commit to trigger Github Actions
ZedThree May 25, 2021
a79a00a
Merge pull request #33 from boutproject/codecov
ZedThree May 25, 2021
e2008c5
Use internal bunch
dschwoerer Jul 7, 2021
ccfc688
Fix import
dschwoerer Jul 7, 2021
11bb66d
Use 'NETCDF4' as default format for DataFile
johnomotani Aug 11, 2021
9f16d57
Remove future
dschwoerer Oct 29, 2021
15305a6
make h5py optional
dschwoerer Oct 29, 2021
be39492
black
dschwoerer Oct 29, 2021
56894c9
Merge pull request #37 from boutproject/cleanup
dschwoerer Oct 29, 2021
46ea522
isort imports
dschwoerer Nov 1, 2021
59d44c6
Merge pull request #34 from boutproject/dschwoerer-patch-1
johnomotani Dec 6, 2021
f7b8b59
Merge pull request #35 from boutproject/default-to-NETCDF4
johnomotani Dec 6, 2021
1a6e635
DataFile.get() method
johnomotani Mar 14, 2022
c94705f
Merge pull request #38 from boutproject/DataFile-get-method
johnomotani Mar 14, 2022
449e2a4
Method to list file attributes of a DataFile
johnomotani Apr 6, 2022
989951a
Formatting changes from updated black
johnomotani Apr 6, 2022
f13d9a3
Update tool versions for pre-commit checks
johnomotani Apr 6, 2022
70c0645
Merge pull request #40 from boutproject/list-file-attributes
johnomotani Apr 7, 2022
0c94b7b
Merge remote-tracking branch 'utils/master' into merge-boututils
ZedThree Apr 8, 2022
cb077d5
Update README with current relationship to BOUT++ and boututils
ZedThree Apr 8, 2022
6d82ab8
Import the most useful `boututils` functions/classes into `boutdata`
ZedThree Apr 8, 2022
c331205
CI: Remove duplicated lint workflow
ZedThree Apr 8, 2022
d8e834e
Update requirements.txt
loeiten Aug 23, 2022
4cb8bc3
Merge pull request #41 from boutproject/Bump-numpy-version
loeiten Aug 23, 2022
6a3f607
Update requirements.txt
loeiten Sep 1, 2022
bb9b0b0
Merge pull request #42 from boutproject/Bump-numpy
loeiten Sep 2, 2022
c29b893
Move the definition of all bout_types of BoutArray to BoutArray
dschwoerer Sep 28, 2022
c02d6c6
Do ignore file we shouldn't track
dschwoerer Sep 28, 2022
2ae779e
Merge pull request #43 from boutproject/boutarray
ZedThree Sep 30, 2022
fbb0a5c
Fix bug in computation of derivative with DFT
mredenti Oct 28, 2022
c2e97a2
Ensure to always write int32
dschwoerer Mar 23, 2023
1ab5e72
Add basic xarray support
dschwoerer Mar 23, 2023
0a34513
CI: Update flake8 to github repo
dschwoerer Mar 23, 2023
bf2335d
Auto update pre-commit-config
dschwoerer Mar 23, 2023
7ba5147
black format
dschwoerer Mar 23, 2023
618616b
Merge pull request #47 from boutproject/write-int32
ZedThree Apr 26, 2023
0554ff6
Merge pull request #48 from boutproject/xarray
ZedThree Apr 26, 2023
0641c91
Merge pull request #45 from mredenti/calculus-deriv-dft
ZedThree Apr 26, 2023
5704739
Move to pyproject.toml package config
ZedThree May 12, 2023
4f771bb
Refactor CI
ZedThree May 12, 2023
80d1fb1
Fix bare `except`
ZedThree May 12, 2023
098c1ab
CI: Update publishing workflow
ZedThree May 12, 2023
a967915
Remove fallback backport of importlib.metadata
ZedThree May 12, 2023
70540aa
Apply black
ZedThree May 12, 2023
5fdba8e
Replace most common uses of string concatenation with f-strings
ZedThree May 12, 2023
5dc35ad
Remove imports from `builtin`
ZedThree May 12, 2023
433995f
Merge pull request #50 from boutproject/modernise
ZedThree May 16, 2023
6ba636f
Update README.md
dschwoerer Jan 5, 2024
a5c1411
Merge pull request #53 from boutproject/dschwoerer-patch-1
dschwoerer Apr 30, 2024
2c30f24
Do not compare types, use `isinstance()`
dschwoerer Apr 30, 2024
0dd5d96
black
dschwoerer Apr 30, 2024
6c22995
Merge pull request #54 from boutproject/ruff-fix
ZedThree Apr 30, 2024
dc3e7a5
Merge branch 'master' into merge-boututils
ZedThree Jul 23, 2024
8211cce
Make `boututils` a local package
ZedThree Jul 23, 2024
f45c944
Merge remote-tracking branch 'utils/master' into merge-boututils
ZedThree Jul 23, 2024
e15a3f9
Apply black
ZedThree Jul 23, 2024
716aecc
Move both modules under `src`
ZedThree Jul 23, 2024
3d737da
Apply black
ZedThree Jul 23, 2024
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
38 changes: 38 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Formatting (black & isort)
on:
push:
branches: master
paths:
- '**.py'

defaults:
run:
shell: bash

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install black
run: |
python -m pip install --upgrade pip
pip install black isort
- name: Version
run: |
python --version
black --version
isort --version
- name: Run black
run: |
black boututils
- name: Run isort
run: |
isort boututils
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[skip ci] Apply black/isort changes"
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Test and lint

on:
# Run each time we push and pull requests
Expand All @@ -10,10 +10,8 @@ concurrency:
cancel-in-progress: true

jobs:
# As we are running on different environments, we are splitting the jobs
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobs
local:
runs-on: ${{ matrix.os }}
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,5 @@ dmypy.json
.idea/
*.sw[po]

boutdata/_version.py
src/boutdata/_version.py
src/boututils/_version.py
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,15 @@
[![PEP8](https://img.shields.io/badge/code%20style-PEP8-brightgreen.svg)](https://www.python.org/dev/peps/pep-0008/)
[![License](https://img.shields.io/badge/license-LGPL--3.0-blue.svg)](https://github.com/boutproject/boutdata/blob/master/LICENSE)

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

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

# Dependencies

`boutdata` depends on `boututils` which again depends on
[`netcfd4`](https://github.com/Unidata/netcdf4-python) which requires
[`HDF5`](https://www.h5py.org) and
`boutdata` uses [`netcfd4`](https://github.com/Unidata/netcdf4-python)
which requires [`HDF5`](https://www.h5py.org) and
[`netcdf-4`](https://github.com/Unidata/netcdf-c/releases) are
installed, and that the `nc-config` utility is in your `PATH`. This
can be install with
Expand Down
9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ keywords = [
"data-visualization",
]
license = {text = "GNU Lesser General Public License v3 or later (LGPLv3+)"}
authors = [{name = "Ben Dudson", email = "benjamin.dudson@york.ac.uk"}]
authors = [{name = "Ben Dudson", email = "benjamin.dudson@york.ac.uk"}, {name = "BOUT++ team"}]
urls = {project = "https://github.com/boutproject/boutdata"}
dependencies = [
"sympy>=1.5.1",
"numpy>=1.22.0",
"matplotlib>=3.2.1",
"natsort>=8.1.0",
"scipy>=1.4.1",
"boututils>=0.1.9",
"netCDF4",
]
dynamic = ["version"]

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

[tool.setuptools]
packages = ["boutdata"]

[tool.setuptools.dynamic]
version = { attr = "setuptools_scm.get_version" }

[tool.setuptools_scm]
write_to = "boutdata/_version.py"
write_to = "src/boutdata/_version.py"

[tool.pytest.ini_options]
addopts = "--cov=boutdata"
27 changes: 25 additions & 2 deletions boutdata/__init__.py → src/boutdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
""" Routines for exchanging data to/from BOUT++ """

# Import this, as this almost always used when calling this package
from boutdata.collect import collect, attributes
from boututils.boutarray import BoutArray
from boututils.boutwarnings import alwayswarn
from boututils.run_wrapper import (
launch,
launch_safe,
shell,
shell_safe,
determineNumberOfCPUs,
build_and_log,
)

__all__ = ["attributes", "collect", "gen_surface", "pol_slice"]

__all__ = [
"attributes",
"collect",
"gen_surface",
"pol_slice",
"BoutArray",
"alwayswarn",
"launch",
"launch_safe",
"shell",
"shell_safe",
"determineNumberOfCPUs",
"build_and_log",
]

__name__ = "boutdata"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading