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

Black Formatting #281

Merged
merged 66 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
2ccc286
Merge pull request #267 from MHKiT-Software/develop
ssolson Aug 31, 2023
ae6b715
assert to exception
ssolson Nov 21, 2023
7614867
Revert "Ensure interpolation values are within range when sampling co…
ssolson Nov 21, 2023
d09e606
Merge branch 'master' of https://github.com/MHKiT-Software/MHKiT-Pyth…
ssolson Nov 29, 2023
35a917c
Merge branch 'develop' of https://github.com/ssolson/MHKiT-Python int…
ssolson Nov 29, 2023
7ef8c7a
black format
ssolson Nov 29, 2023
d1c65f1
add a dev requirements
ssolson Nov 29, 2023
b0ed12a
add check for black formatting
ssolson Nov 29, 2023
ec6331c
add pre commit
ssolson Nov 29, 2023
afd3171
Merge branch 'develop' of https://github.com/MHKiT-Software/MHKiT-Pyt…
ssolson Dec 6, 2023
667a416
Merge branch 'develop' of https://github.com/ssolson/MHKiT-Python int…
ssolson Dec 6, 2023
b18d585
Merge branch 'lint' of https://github.com/ssolson/MHKiT-Python into lint
ssolson Jan 2, 2024
dbbc63c
change API key
ssolson Jan 3, 2024
da97b9b
Merge branch 'develop' of https://github.com/MHKiT-Software/MHKiT-Pyt…
ssolson Jan 3, 2024
1e88f00
Treat the None as string "None"
ssolson Jan 11, 2024
eacbcbd
black formatting
ssolson Jan 11, 2024
1614805
remove unused imports, add some type checks
ssolson Jan 12, 2024
3fdda1a
no coverage on artifact load
ssolson Jan 12, 2024
a41f7ab
black formatting
ssolson Jan 12, 2024
332b331
add scipy to TEST env
ssolson Jan 13, 2024
0922388
remove no dependencies
ssolson Jan 14, 2024
797ff26
remove debug imports
ssolson Jan 14, 2024
bd3988d
revert to original main.yaml
ssolson Jan 14, 2024
954edfb
black
ssolson Jan 14, 2024
04f24e0
river io to usgs and d3d
ssolson Jan 15, 2024
3299e60
move d3d tidal into tidal/io
ssolson Jan 15, 2024
2935fc8
quick test to call d3d from tidal
ssolson Jan 15, 2024
3f3dcad
snake_case
ssolson Jan 15, 2024
4103c70
`product` is deprecated as of NumPy 1.25.0
ssolson Jan 15, 2024
7d65eb7
fix import path
ssolson Jan 15, 2024
fd9f9c3
increase test coverage
ssolson Jan 15, 2024
6e3d11a
black
ssolson Jan 15, 2024
cedd6b6
update test filename
ssolson Jan 15, 2024
83719a8
correct name
ssolson Jan 15, 2024
8abfd62
wait fox James to respond
ssolson Jan 16, 2024
5442c6d
increase mooring graphics coverage
ssolson Jan 16, 2024
f85e3ff
increase test coverage
ssolson Jan 16, 2024
ac4e89a
increase coverage
ssolson Jan 16, 2024
683bfcb
catch strings passed as TypeError
ssolson Jan 16, 2024
357306d
Increase coverage on dataTypes
ssolson Jan 16, 2024
f793ce0
throw error on strings passed
ssolson Jan 16, 2024
4d65466
black
ssolson Jan 16, 2024
da60139
remove unused imports
ssolson Jan 19, 2024
1603518
additional input checks
ssolson Jan 19, 2024
d76aa2f
test env contours invalid inputs
ssolson Jan 19, 2024
0ae25f6
uncomment tests
ssolson Jan 19, 2024
b285d5a
do not include cached API requests in coverage
ssolson Jan 19, 2024
816a5f9
black
ssolson Jan 19, 2024
48d8cc4
fix & improve type checks
ssolson Jan 25, 2024
e22dbd0
fix bug on slicing after setting min_bins to 4
ssolson Jan 25, 2024
2fe090e
increase test coverage
ssolson Jan 25, 2024
594e65b
black
ssolson Jan 25, 2024
dc2aee4
Merge branch 'develop' of https://github.com/MHKiT-Software/MHKiT-Pyt…
ssolson Jan 26, 2024
7aa0ef2
black
ssolson Jan 26, 2024
6dba1df
remove debug
ssolson Jan 26, 2024
eb4b896
black v24.1.0
ssolson Jan 26, 2024
af9d191
fix implementation from #284
ssolson Jan 29, 2024
08182e0
finalize tests for `cpsd_quasisync_1D`
ssolson Jan 29, 2024
93278f3
black
ssolson Jan 29, 2024
41e3a42
remove "alt_raw" merge artifact
ssolson Jan 30, 2024
16832d0
remove positive frequencies test
ssolson Jan 30, 2024
434c78f
black formatting
ssolson Jan 30, 2024
c771f24
black
ssolson Jan 30, 2024
b74110e
Merge branch 'develop' of https://github.com/MHKiT-Software/MHKiT-Pyt…
ssolson Jan 30, 2024
c2513a7
black
ssolson Jan 30, 2024
997847d
add back copula tests
ssolson Feb 1, 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
24 changes: 24 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Black Code Formatter

on: [push, pull_request]

jobs:
black:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"

- name: Install Black
run: |
python -m pip install --upgrade pip
pip install black

- name: Check Black Formatting
run: black --check .
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Prepare data
run: |
source activate TEST
pytest mhkit/tests/river/test_io.py
pytest mhkit/tests/river/test_io_usgs.py
pytest mhkit/tests/tidal/test_io.py
pytest mhkit/tests/wave/io/test_cdip.py

Expand All @@ -107,7 +107,7 @@ jobs:
fail-fast: false
matrix:
os: ${{fromJson(needs.set-os.outputs.matrix_os)}}
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ['3.8', '3.9', '3.10', '3.11']
env:
PYTHON_VER: ${{ matrix.python-version }}

Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
fail-fast: false
matrix:
os: ${{fromJson(needs.set-os.outputs.matrix_os)}}
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
fail-fast: false
matrix:
os: ${{fromJson(needs.set-os.outputs.matrix_os)}}
python-version: [3.8, 3.9, 3.10, 3.11]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .hscfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hs_endpoint = https://developer.nrel.gov/api/hsds
hs_username =
hs_password =
hs_api_key = 3K3JQbjZmWctY0xmIfSYvYgtIcM3CN0cb1Y2w9bf
hs_api_key = jODGciIBnejrYd9GXxgXjbbAjMDLBMWQer05P98N
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# To run Black formating every time you commit:
# pip install pre-commit
# pre-commit install
repos:
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,15 @@ The GitHub platform has the pull request feature that allows you to propose chan
7. If you want to allow anyone with push access to the upstream repository to make changes to your pull request, select **Allow edits from maintainers**.
8. To create a pull request that is ready for review, click **Create Pull Request**. To create a draft pull request, use the drop-down and select **Create Draft Pull Request**, then click **Draft Pull Request**. More information about draft pull requests can be found [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests)
9. MHKiT-Python adminstrators will review your pull request and contact you if needed.

## Code Formatting in MHKiT

MHKiT adheres to the "black" code formatting standard to maintain a consistent and readable code style. Developers contributing to MHKiT have several options to ensure their code meets this standard:

1. **Manual Formatting with Black**: Install the 'black' formatter and run it manually from the terminal to format your code. This can be done by executing a command like `black [file or directory]`.

2. **IDE Extension**: If you are using an Integrated Development Environment (IDE) like Visual Studio Code (VS Code), you can install the 'black' formatter as an extension. This allows for automatic formatting of code within the IDE.

3. **Pre-Commit Hook**: Enable the pre-commit hook in your development environment. This automatically formats your code with 'black' each time you make a commit, ensuring that all committed code conforms to the formatting standard.

For detailed instructions on installing and using 'black', please refer to the [Black Documentation](https://black.readthedocs.io/en/stable/). This resource provides comprehensive guidance on installation, usage, and configuration of the formatter.
Loading
Loading