Skip to content

Commit 68e5a08

Browse files
authored
Ruff fixes (#455)
* Ignore ruff and pre-commit config files * Add local ruff config * Add extend configuration to ruff.toml * Fix whitespace issues * Fix linting errors in Python files
1 parent b9ff2c3 commit 68e5a08

Some content is hidden

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

100 files changed

+1304
-1310
lines changed

.github/build_real.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ touch ~/.config/pip/constraints.txt
1414
pip install .[optview,testing] -v
1515

1616
# move pip constraints file back
17-
mv ~/.config/pip/constraints.txt.bkup ~/.config/pip/constraints.txt
17+
mv ~/.config/pip/constraints.txt.bkup ~/.config/pip/constraints.txt

.github/workflows/linux-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
versions: [{python: "3.10", numpy: "1.22"}, {python: "3.11", numpy: "1.25"}, {python: "3.12", numpy: "2.1"}]
1919
steps:
2020
- uses: actions/checkout@v4
21-
- uses: actions/setup-python@v5
21+
- uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.versions.python }}
2424
- name: Install runtime numpy ${{ matrix.versions.numpy }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
syntax: glob
2+
3+
# Ignore ruff and pre-commit config files
4+
.pre-commit-config.yaml
5+
26
build
37
doc/_build
48
*.pyc

.zenodo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
"name": "Joaquim R. R. A. Martins"
1717
}
1818
]
19-
}
19+
}

doc/_static/pyOptSparse_logo.svg

Lines changed: 1 addition & 1 deletion
Loading

doc/changes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ The following list summarizes some of the changes/improvements made to pyOpt to
1515
* User specification of design variable scaling
1616
* User specification of constraint scaling
1717
* Design variable returns in dictionary format only
18-
* Specification of linear constraints, dense or sparse
19-
* Sparse non-linear Jacobians
18+
* Specification of linear constraints, dense or sparse
19+
* Sparse non-linear Jacobians
2020
* New history file format. Uses SQLite dictionaries.
2121
* Fixed hot start bug where first call to user functions is a gradient. It is now guaranteed, that the first call is to the function evaluation, not the gradient.
2222
* Various bug fixes in SNOPT

doc/guide.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Linear constraints in pyOptSparse are defined exclusively by ``jac``, ``lower``,
210210
For linear constraint :math:`g_L \leq Ax + b \leq g_U`, the constraint definition would look like:
211211

212212
.. code-block:: python
213-
213+
214214
optProb.addConGroup("con", num_cons, linear=True, wrt=["xvars"], jac={"xvars": A}, lower=gL - b, upper=gU - b)
215215
216216
Users should not provide the linear constraint values (i.e., :math:`g = Ax + b`) in a user-defined objective/constraint function.
@@ -310,4 +310,4 @@ See the optimizer-specific documentation page for more details.
310310

311311
Postprocessing
312312
++++++++++++++
313-
The result of the optimization is returned in a :class:`pyoptsparse.pyOpt_solution.Solution` object.
313+
The result of the optimization is returned in a :class:`pyoptsparse.pyOpt_solution.Solution` object.

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Some key features of pyOptSparse include:
1212

1313

1414
pyOptSparse is a fork of `pyOpt <http://www.pyopt.org/>`_.
15-
However, it is not backwards compatible with pyOpt and thus optimization scripts will need to be modified to use pyOptSparse.
15+
However, it is not backwards compatible with pyOpt and thus optimization scripts will need to be modified to use pyOptSparse.
1616

1717
Getting Started
1818
===============

doc/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ To install pyOptSparse including those dependencies, run
9393

9494
pip install .[optview]
9595

96-
If you encounter a ``no module named tkinter`` error when trying to run optview, you may need to `install tkinter on your system <https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter>`__.
96+
If you encounter a ``no module named tkinter`` error when trying to run optview, you may need to `install tkinter on your system <https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter>`__.
9797

9898
Testing
9999
-------

doc/optimizers/CONMIN.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ API
1616

1717
.. autoclass:: CONMIN
1818
:members: __call__
19-

0 commit comments

Comments
 (0)