Skip to content

Commit

Permalink
Merge pull request #308 from ioannis-vm/codespell_faster_workflow
Browse files Browse the repository at this point in the history
Codespell: Speed up workflow
  • Loading branch information
fmckenna authored Sep 19, 2024
2 parents 5c08650 + f740757 commit b0ae13f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
14 changes: 7 additions & 7 deletions modules/createEVENT/stochasticWave/StochasticWave.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env python3 # noqa: EXE001, D100
#!/usr/bin/env python3 # noqa: EXE001

"""
Notable portions of this code are derived courtesy of the welib python package
Notable portions of this code are derived courtesy of the welib python package
and the following source:
Copyright 2019 E. Branlard
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
""" # noqa: D205, D400

import argparse
import json
Expand All @@ -17,13 +17,13 @@
from welib.tools.figure import defaultRC

defaultRC()
import Ex1_WaveKinematics # noqa: E402
import Ex2_Jonswap_spectrum # noqa: E402
import Ex3_WaveTimeSeries # noqa: E402
import Ex4_WaveLoads # noqa: E402
from welib.hydro.morison import * # noqa: E402, F403
from welib.hydro.wavekin import * # noqa: E402, F403

import Ex1_WaveKinematics
import Ex2_Jonswap_spectrum
import Ex3_WaveTimeSeries
import Ex4_WaveLoads

class FloorForces: # noqa: D101
def __init__(self, recorderID=-1): # noqa: N803
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@
"source": [
"import pandas as pd\n",
"\n",
"with open('BeamDatabase1.csv') as file: # noqa: PTH123\n",
"with open('BeamDatabase1.csv', 'r') as file: # noqa: PTH123\n",
" beam_section_database = pd.read_csv(file, header=0)\n",
"\n",
"# Beam section weight shall be less than 300 lb/ft\n",
"# Beam flange thickness shall be less than 1.75 inch.\n",
"target_index = []\n",
"for indx in beam_section_database['index']:\n",
" if (\n",
" beam_section_database.loc[indx, 'weight'] >= 300 # noqa: PLR2004\n",
" or beam_section_database.loc[indx, 'tf'] >= 1.75 # noqa: PLR2004\n",
" ):\n",
" target_index.append(indx) # noqa: PERF401\n",
" if beam_section_database.loc[indx, 'weight'] >= 300:\n",
" target_index.append(indx)\n",
" elif beam_section_database.loc[indx, 'tf'] >= 1.75:\n",
" target_index.append(indx)\n",
"clean_beam_section = beam_section_database.drop(index=target_index)\n",
"clean_beam_section.to_csv('BeamDatabase2.csv', sep=',', index=False)"
]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ignore = ["ANN", "D211", "D212", "Q000", "Q003", "COM812", "D203", "ISC001", "E5
preview = false

[tool.ruff.lint.per-file-ignores]
"path/to/folder/*" = ["ALL"]
"*.ipynb" = ["ALL"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"
Expand Down

0 comments on commit b0ae13f

Please sign in to comment.